这是我在构建Open Day Light YangTools时遇到的错误
[ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.2.1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-compiler-plugin:jar:3.2.1 in nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.2.1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-compiler-plugin:jar:3.2.1 in nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:133)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:148)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:267)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:240)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:233)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:85)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.apache.maven.plugins:maven-compiler-plugin:jar:3.2.1 in nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:295)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
... 20 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.apache.maven.plugins:maven-compiler-plugin:jar:3.2.1 in http://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:232)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:599)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:518)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
... 24 more
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-aggregator</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>yangtools</name> <!-- Used by Sonar to set project name -->
<packaging>pom</packaging>
<scm>
<connection>scm:git:ssh://git.opendaylight.org:29418/yangtools.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/yangtools.git</developerConnection>
<url>https://wiki.opendaylight.org/view/YANG_Tools:Main</url>
<tag>HEAD</tag>
</scm>
<modules>
<module>common</module>
<module>yang</module>
<module>websocket</module>
<module>yang-validation-tool</module>
</modules>
<profiles>
<profile>
<id>benchmarks</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>benchmarks</module>
</modules>
</profile>
<profile>
<!--
This profile is to ensure we only build javadocs reports
when we plan to deploy Maven site for our project.
-->
<id>maven-site</id>
<activation>
<file>
<exists>${user.dir}/deploy-site.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate</goal>
</goals>
<phase>package</phase>
<configuration>
<!-- ignore javadoc warnings caused by JDK8 -->
<additionalparam>${javadoc.args}</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>checkstyle-logging</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
<!--
Maven Site Configuration
The following configuration is necessary for maven-site-plugin to
correctly identify the correct deployment path for OpenDaylight Maven
sites.
-->
<url>${odl.site.url}/${project.groupId}/${stream}/</url>
<distributionManagement>
<site>
<id>opendaylight-site</id>
<url>${nexus.site.url}/</url>
</site>
</distributionManagement>
</project>
在使用 mvn clean install 或 mvn clean install -U 从 cli 构建 maven 构建时。