Dón*_*nal 5 java tomcat maven-2
当我mvn deploy在我的项目中运行时<packaging>war</packaging>出现错误:
[错误]无法在项目store-service-impl上执行目标org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy(默认部署):部署失败:未在distributionManagement中的POM中指定存储库元素元素或-DaltDeploymentRepository = id :: layout :: url参数中
默认情况下,deploy:deploy目标似乎绑定到deploy生命周期阶段。换句话说,当deploy生命周期阶段运行时,Maven将尝试将生成的工件(在这种情况下为.war文件)部署到远程存储库。
就我而言,我想将战争部署到远程Tomcat实例,而不是远程Maven存储库。我已将以下内容添加到pom.xml
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<!--
<executions>
<execution>
<id>deploy-tomcat</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
-->
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>http://10.60.60.60:8080/manager</cargo.remote.uri>
<cargo.remote.username>jack</cargo.remote.username>
<cargo.remote.password>secret</cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>remote</type>
</deployer>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
当我运行时,这将成功部署.war mvn cargo:deploy。但是,如果然后deploy通过取消注释<executions>元素将该目标绑定到Maven生命周期的阶段,则会出现上述错误。
似乎已将cargo:deploy目标添加到绑定到该deploy阶段的目标中,但是我想用该deploy:deploy目标替换绑定到deploy生命周期阶段的cargo:deploy目标(默认情况下),这可能吗?
您应该将货物绑定到pre-integration-test而不是deploy- 然后您的故障安全测试可以在此阶段针对部署的战争文件运行integration-test。您将使用运行测试mvn verify。
| 归档时间: |
|
| 查看次数: |
2525 次 |
| 最近记录: |