Got a simple task upon: mvn deploy copy final artifact org.foo.MyProject_1.2.3.war to /tomcat/webapps/myproject.war
Set up pom according to the maven docs:
...
<distributionManagement>
<repository>
<id>local_tomcat</id>
<url>/tomcat/webapps</url>
</repository>
</distributionManagement>
...
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>2.2</version>
</extension>
</extensions>
...
But it didn’t work. By some reason wagon tries to create directory /org/foo/MyProject/1.2.3 and fails.
Of course i could utilise tomcat:deploy or ant, but i thought deploy was a right choice for deployment.
It appears to me that i mistreated deploy plug in. It is just the same as install with ability to install artifact on remote repository. Am i right?
If deploy is wrong choice what is proper way of transferring/renaming files in maven?
Wagon looks nice though not sure if it can rename files.
thanx in advance
The deploy in the Maven meaning is to put artifacts into a remote repository (usually a repository manager or sometimes Maven central) and NOT into containers like Tomcat etc. Furthermore based on the lifecylce in Maven the deploy phase comes after the install phase which means in other words that the install has already run if you have called mvn deploy.
If you would like to deploy an artifact (usually a war) to Tomcat the maven-tomcat-plugin is the right choice. For doing a kind of integration tests the cargo2-maven-plugin might be a better solution.