Maven从不同存储库的一个插件下载文件

我有奇怪的问题。 我有自己的远程存储库并上传他们的插件。 然后我尝试在打包项目时下载它。 Maven开始从own_remote_repo下载,但下载1个文件开始在repo1.maven.org/maven2上搜索另一个文件,当然找不到插件并失败。

我以前多次使用这个回购没有问题。

[编辑]

输出:

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://:/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是正确的。

有任何想法吗?

我从你的问题中理解的是你只有插件问题,我们使用nexus作为代理并且必须配置

  $USER_HOME/.m2/settings.xml 

请检查下面显示的pluginrepositories部分的配置。

    nexus * http://nexusurl/content/groups/public     nexus   central http://central  true   true      central http://central  true   true       nexus