When I run mvn deploy in my project with <packaging>war</packaging> , I get an error:
[ERROR] Failed to fulfill target org.apache.maven.plugins: maven-deploy-plugin: 2.5: deploy (default-deploy) to project-service-impl repository: deployment failed: repository element is not specified in POM inside distribution control element or in -DaltDeploymentRepository = id :: layout :: url parameter
It appears that, by default, the deploy:deploy target is tied to the deploy lifecycle phase. In other words, Maven will try to deploy the created artifact (the .war file in this case) to the remote repository when the deploy life cycle phase is executed.
In my case, I want to deploy the war to a remote Tomcat instance, and not to a remote Maven repository. I added the following to 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> <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>
This successfully deploys .war when running mvn cargo:deploy . However, if I then bind this target to the deploy phase of the Maven life cycle by uncommenting the <executions> element, I get the above error.
It seems that the cargo:deploy target has been added to the goals associated with the deploy phase, but I want to replace the deploy:deploy target associated with the deploy life cycle phase (default) with the cargo:deploy target, is this possible?
source share