Maven скачать файлы из одного плагина из разных репозиториев - PullRequest
2 голосов
/ 27 октября 2011

У меня странная проблема.У меня есть собственный удаленный репозиторий и загружаю свой плагин.Затем я пытаюсь загрузить его во время упаковки проекта.Maven начинает загрузку с own_remote_repo, но при загрузке 1 файла начинается поиск других файлов на repo1.maven.org/maven2, и, конечно, не удается найти плагин, и происходит сбой.

Я использовал этот репозиторий много раз раньше без проблем.

[edit]

output:

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.pommaven пытается загрузить файл jar из центрального репозитория maven ....

Файл jar с подключаемым модулем находится в той же директории на нексусе, и его имя совпадает с именем файла jar, который пытается найти maven.Maven-plugin-1.1.3.pom, скачанный с nexus, верен.

Есть идеи?

1 Ответ

3 голосов
/ 28 октября 2011

Что я понимаю из вашего вопроса, так это то, что у вас есть проблемы только с плагинами, мы используем 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>
...