gpt4 book ai didi

maven - mvn部署问题

转载 作者:行者123 更新时间:2023-12-04 19:38:30 24 4
gpt4 key购买 nike

我正在将Maven 3.0.3与Nexus和Jenkins一起使用

pom.xml

<distributionManagement> 
<repository>
<id>releases</id>
<url>http://xxx.xxx.xx.xx:8383/nexus/content/repositories/releases</url>
</repository>

<!-- Publish the versioned releases here -->
<snapshotRepository>
<id>releases</id>
<name>nexus</name>
<url>http://xxx.xxx.xx.xx:8383/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>


settings.xml

<servers>
<server>
<username>admin</username>
<password>bala</password>
<id>releases</id>
</server>
</servers>


当我做MVN部署

我收到以下错误。想知道我错过了什么,错过了什么?

---------------------------------------------------------------------

> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy
> (default-deploy) on project mdaq: Deployment failed: repository
> element was not specified in the POM inside distributionManagement
> element or in -DaltDeploymentRepository=id::layout::url parameter ->
> [Help 1]

-------------------------------------------------

最佳答案

快照存储库的<id>与发布存储库相同。为它们命名不同,然后在settings.xml文件中放入两个服务器定义。还为发布存储库提供一个<name>。像这样:

<distributionManagement> 
<repository>
<id>releases</id>
<name>nexus releases</name>
<url>http://xxx.xxx.xx.xx:8383/nexus/content/repositories/releases</url>
</repository>

<!-- Publish the versioned releases here -->
<snapshotRepository>
<id>snapshots</id>
<name>nexus snapshots</name>
<url>http://xxx.xxx.xx.xx:8383/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>


settings.xml

<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>bala</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>bala</password>
</server>
</servers>

关于maven - mvn部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8427381/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com