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

Java Maven从不同的存储库从一个插件下载文件,java,maven-2,maven,Java,Maven 2,Maven,我有个奇怪的问题。我有自己的远程存储库和上传他们的插件。然后我尝试在打包项目时下载它。Maven开始从自己的\u remote\u repo下载,但下载1个文件开始在repo1.Maven.org/maven2上搜索另一个文件,当然找不到插件并失败 我以前多次使用该回购协议,没有任何问题 [编辑] 输出: Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1

我有个奇怪的问题。我有自己的远程存储库和上传他们的插件。然后我尝试在打包项目时下载它。Maven开始从自己的\u remote\u 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://<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
下载:http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom
[信息]在repository central中找不到资源'com.my.maven.plugin:maven plugin:pom:1.1.3'(http://repo1.maven.org/maven2)
下载:http://:/nexus/content/groups/public/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom
3K下载(maven-plugin-1.1.3.pom)
下载:http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.jar
[信息]在repository central中找不到资源'com.my.maven.plugin:maven plugin:maven plugin:1.1.3'(http://repo1.maven.org/maven2)
[信息]------------------------------------------------------------------------
[错误]生成失败
[信息]------------------------------------------------------------------------
[信息]找不到所需的插件:找不到插件-检查目标名称是否正确:无法从任何存储库下载工件
正如您在加载maven-plugin-1.1.3.pom后看到的,maven尝试从maven中央repo下载jar文件

带有插件的jar文件位于nexus上的同一目录中,名称与maven尝试查找的jar文件相同。 从nexus加载的maven-plugin-1.1.3.pom是正确的


有什么想法吗?

我从你的问题中了解到的是,你只有插件方面的问题,我们使用插件作为代理,必须进行配置

 $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>

关系
*
http://nexusurl/content/groups/public
关系
中心的
http://central
真的
真的
中心的
http://central
真的
真的
关系

您能发布一个maven的示例输出来显示这一点吗?完成。我希望这对你有帮助,谢谢。将pluginRepositories添加到我的pom.xml中,并正确启动加载。但我无法解决主要问题:为什么maven开始从不同的存储库下载plubin的部分。。。