How to deploy and install using single command
I have an application that is broken into four Flex modules: 1) Main module 2) Sub module 1 3) Sub module 2 3) Library project.
We have created this project in the maven way.When we try b开发者_如何学Pythonuilding the project using mvn install, it is getting built fine. The war file is getting generated and is available in the target folder.
I now have a requirement where in I need to also deploy the project to tomcat server. In order to achieve this I have made use of the tomcat-maven-plugin provided by codehaus mojo project. When I try to do a mvn tomcat:deploy, the build is failing.The build engine is not able to look up my library project. If I try executing mvn tomcat:deploy-only, the war file that was generated when we did a mvn istall is getting deployed.
Can somebody help me out with this issue.
Maven version used: 3.1 Flex mojos version used : 4.0-beta-7
Thanks, Vennela
As said in the comments, the tomcat-maven-plugin executes the deploy after maven package phase.
Since deploying is pretty much another word for copying, you could also use the maven-war-plugin (which you probably are already using) if you are having trouble with the tomcat plugin. For example:
</plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory>
<outputDirectory>/sample/servlet/container/deploy</outputDirectory>
</configuration>
</plugin>
</plugins>
The above copies the war to outputDirectory and exploded war to webappDirectory, overriding the default paths (invoking eg. the command "mvn package")
Default way:
<project>
...
<groupId>com.example.projects</groupId>
<artifactId>documentedproject</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Documented Project</name>
<url>http://example.com</url>
...
</project>
Hope it helps.
精彩评论