我以前多次使用过这个回购没有问题。
[编辑]
输出:
Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom
[INFO] Unable to find resource 'com.my.maven.plugin:maven-plugin:pom:1.1.3' in repository central (http://repo1.maven.org/maven2)
Downloading: http://<server>:<port>/nexus/content/groups/public/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom
3K downloaded (maven-plugin-1.1.3.pom)
Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.jar
[INFO] Unable to find resource 'com.my.maven.plugin:maven-plugin:maven-plugin:1.1.3' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository
因此,你可以看到在maven-plugin-1.1.3.pom maven的下载后尝试从maven中央仓库下载jar文件....
带有插件的jar文件位于nexus的同一目录中,名称等于maven尝试查找的jar文件。 从nexus下载的maven-plugin-1.1.3.pom是正确的。
有什么想法吗?
答案 0 :(得分:3)
我从您的问题中了解到,您只有插件问题,我们使用nexus作为代理并且必须配置
$USER_HOME/.m2/settings.xml
请检查下面显示的pluginrepositories
部分的配置。
<settings>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorof>*</mirrorof>
<url>http://nexusurl/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginrepositories>
<pluginrepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginrepository>
</pluginrepositories>
</profile>
</profiles>
<activeprofiles>
<activeprofile>nexus</activeprofile>
</activeprofiles>
</settings>