Я пытаюсь настроить прокси-репозиторий Nexus maven и создать небольшое приложение с открытым исходным кодом, чтобы убедиться, что оно проходит через мой локальный экземпляр nexus.
У меня есть работающий локальный экземпляр Nexus, и я создал хранилище maven-proxy-test после этого этого урока
Это мои settings.xml:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/repository/maven-proxy-test/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://localhost:8081/repository/maven-proxy-test/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://localhost:8081/repository/maven-proxy-test/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
<proxies>
<proxy>
<id>ullink-proxy-id</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.ullink.lan</host>
<port>9876</port>
<nonProxyHosts>*.ullink.lan</nonProxyHosts>
</proxy>
<proxy>
<id>ullink-proxy-id2</id>
<active>true</active>
<protocol>https</protocol>
<host>proxy.ullink.lan</host>
<port>9876</port>
<nonProxyHosts>*.ullink.lan</nonProxyHosts>
</proxy>
</proxies>
</settings>
Затем я клонировал этот плагин jenkins и попытался запустить
mvn package
Вывод:
[INFO] Scanning for projects...
Downloading: http://localhost:8081/repository/maven-proxy-test/org/jenkins-ci/plugins/plugin/3.1/plugin-3.1.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.jenkins-ci.plugins:parameterized-trigger:2.35.3-SNAPSHOT: Could not transfer artifact org.jenkins-ci.plugins:plugin:pom:3.1 from/to nexus (http://localhost:8081/repository/maven-proxy-test/): Access denied to: http://localhost:8081/repository/maven-proxy-test/org/jenkins-ci/plugins/plugin/3.1/plugin-3.1.pom , ReasonPhrase:Forbidden. and 'parent.relativePath' points at no local POM @ line 4, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jenkins-ci.plugins:parameterized-trigger:2.35.3-SNAPSHOT (C:\projects\parameterized-trigger-plugin\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.jenkins-ci.plugins:parameterized-trigger:2.35.3-SNAPSHOT: Could not transfer artifact org.jenkins-ci.plugins:plugin:pom:3.1 from/to nexus (http://localhost:8081/repository/maven-proxy-test/): Access denied to: http://localhost:8081/repository/maven-proxy-test/org/jenkins-ci/plugins/plugin/3.1/plugin-3.1.pom , ReasonPhrase:Forbidden. and 'parent.relativePath' points at no local POM @ line 4, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
P.S. Я за корпоративным прокси, который я настроил в Nexus Administrator.
Любая помощь очень ценится!