我在部署时遇到问题,下面是我收到的错误消息:
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ core ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.296 s
[INFO] Finished at: 2014-11-26T17:05:00+02:00
[INFO] Final Memory: 13M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project core: Deployment failed: repository element w
as not specified in the POM inside distributionManagement element or in -DaltDep
loymentRepository=id::layout::url parameter -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
我在网上查了一些资源,没有一个适合我的案例,我认为这与我的pom.xml
有关,下面是它的相关部分:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>repository.springframework.maven.release</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
<repository>
<id>Appid</id>
<name>AppName</name>
<url>http://IPaddress/nexus/content/repositories/Myapps/</url>
</repository>
</repositories>
问题是什么?如何解决?
3条答案
按热度按时间rn0zuynd1#
您应该在
pom.xml
的分发管理部分中包含要部署的存储库。示例:
见分销管理
72qzrwbm2#
在pom.xml中,您应该将distributionManagement配置添加到要部署的位置。
在下面的示例中,我使用文件系统作为位置。
您可以在部署时使用以下命令添加另一个位置(但要避免上述错误,您应至少配置1个存储库):
wgx48brx3#
已通过在main pom.xml的distributionManagement选项卡下添加存储库URL修复此问题。
Jenkin maven目标:清理部署-U -Dmaven.test.skip=真