我正在尝试部署到我们的内部关系存储库。我已经配置了一个 Maven 项目,我可以在其中执行mvn install
和mvn clean deploy
. 奇怪的是,当我SNAPSHOT
从版本中删除时,我得到一个404
.
这是我的 pom.xml,适用于SNAPSHOTS
:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>MavenExample</groupId>
<artifactId>com.mycompany</artifactId>
<version>1.0-SNAPSHOT</version>
<distributionManagement>
<repository>
<id>nexus</id>
<url>http://nexus.mycompany.com:8000/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<url>http://nexus.mycompany.com:8000/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>nexus</serverId>
<nexusUrl>http://nexus.mycompany.com:8000/repository/maven-releases/</nexusUrl>
<!-- update this to the correct id! -->
<stagingProfileId>myid</stagingProfileId>
</configuration>
</plugin>
</plugins>
</build>
</project>
当我更改<version>1.0-SNAPSHOT</version>
为<version>1.0</version>
我得到这个错误:
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.3:deploy (injected-nexus-deploy) on project explicit-staging-example: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.3:deploy failed: Nexus connection problem to URL [http://nexus.mycompany.com:8000/repository/maven-releases/ ]: 404 - Not Found -> [Help 1]
[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/PluginExecutionException
它们都在 nexus 中可用:
我尝试添加不同的插件,但没有运气。我不是专家,所以任何帮助将不胜感激!