I want my build process to deploy my war to a remote server. until now i have ran mvn clean install tomcat7:deploy
This seem wrong to me as it should probably be part of the deploy phase. But if I try to do a mvn deploy i get:
Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
Since I haven’t defined any repository to deploy to (I don’t really want to deploy to a remote repository, just using this phase to execute the tomcat maven plugin…)
I want to be able to run the tomcat maven plugin without deploying to any remote repository. Is that possible ?
The plugin doesn’t execute by default. You have to add an execution to it, or call it like you did(f.e. mvn clean install tomcat7:deploy).
The deploy on Tomcat has nothing to do with the Maven deploy phase/deploying to a remote repository.
To bind the Tomcat deployment to a certain phase, add something like this to your tomcat maven plugin configuration:
In this configuration, the deployment to Tomcat will occur in the pre-integration-test phase, which is the most common phase to do this in I believe.