You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by peekay_21 <sa...@gmail.com> on 2011/08/30 15:47:01 UTC
Multiple WAR deploy with maven to tomcat
I have n number of war files I want to deploy using a maven build to a tomcat
server.
I have configured the tomcat plug-in for doing the deployment for WAR files
that are outside the project workspace.
It seems to me though that the build see that there is nothing in the
project and just ends because there is nothing to compile.
Is this expected behavior when doing a maven build?
the entire purpose of the project is to just deploy the war files via maven
nothing else, I'm sure I'm just missing some little thing that should be
obvious.
attached is my pom file any help would be appreciated.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SeverSetup</groupId>
<artifactId>SeverSetup</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>csr</id>
<phase>pre-integration-test</phase>
<configuration>
<url>http://localhost:8080/manager</url>
<server>tomcat</server>
<path>/csr</path>
<warFile>${war.path}/console/console.war</warFile>
</configuration>
</execution>
<execution>
<id>mobile</id>
<phase>pre-integration-test</phase>
<configuration>
<url>http://localhost:8080/manager</url>
<server>tomcat</server>
<path>/mobile</path>
<warFile>${war.path}/mobile/mobile.war</warFile>
</configuration>
</execution>
<execution>
<id>alerts</id>
<phase>pre-integration-test</phase>
<configuration>
<url>http://localhost:8080/manager</url>
<server>tomcat</server>
<path>/alerts</path>
<warFile>${project.root}/alerts/target/alerts.war</warFile>
</configuration>
</execution>
<execution>
<id>enrollment</id>
<phase>pre-integration-test</phase>
<configuration>
<url>http://localhost:8080/manager</url>
<server>tomcat</server>
<path>/enrollment</path>
<warFile>${project.root}/enrollment/target/enrollment.war</warFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.2</version>
<configuration></configuration>
</plugin>
</plugins>
</build>
<properties>
<project.root>root</project.root>
<war.path>war/path</war.path>
</properties>
</project>
--
View this message in context: http://maven.40175.n5.nabble.com/Multiple-WAR-deploy-with-maven-to-tomcat-tp4750066p4750066.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Multiple WAR deploy with maven to tomcat
Posted by Anders Hammar <an...@hammar.net>.
Ah. What you have done is bound plugin executions to the Maven build
lifecycle. But the way you execute things you're executing the plugin
directly. Due to how you've configured the plugin executions in the
pom (not using pluginManagement) this is not applied when calling the
plugin directly.
So with your current setup, calling
mvn pre-integration-test
should work as it will perform a lifecycle build.
Or, which I think is a more suitable solution to what you want to do,
is to configure the plugin through pluginManagement and then call the
plugin directly. But as you want to deploy several artifacts I'm not
sure that the latter suggestion would work with the plugin your using.
You need to check the documentation. If it doesn't work, I think that
you could use the Cargo plugin as it supports multiple deployables
through one single configuration.
/Anders
PS. I just now noticed that this was sent to the dev list. You should
move the thread to the users list as the dev list is for maven
development questions.
On Tue, Aug 30, 2011 at 17:33, peekay_21 <sa...@gmail.com> wrote:
> I am executing:
> mvn tomcat:deploy
>
> For clarification "pom packaging" is simply an empty project with just the
> .project file and pom.xml, is that what your referring to?
> If so I have done that and the result was the same.
> is there some other maven distinction for "pom packaging"?
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Multiple-WAR-deploy-with-maven-to-tomcat-tp4750066p4750462.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Multiple WAR deploy with maven to tomcat
Posted by peekay_21 <sa...@gmail.com>.
I am executing:
mvn tomcat:deploy
For clarification "pom packaging" is simply an empty project with just the
.project file and pom.xml, is that what your referring to?
If so I have done that and the result was the same.
is there some other maven distinction for "pom packaging"?
--
View this message in context: http://maven.40175.n5.nabble.com/Multiple-WAR-deploy-with-maven-to-tomcat-tp4750066p4750462.html
Sent from the Maven Developers mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Multiple WAR deploy with maven to tomcat
Posted by Anders Hammar <an...@hammar.net>.
What command are you issuing? You need to execute up to at least the
the pre-integration-test phase.
Also, you've configured the project to be a jar project (as that's the
default packaging). You should probably go with a pom packaging
instead, and then Maven will not try to build a jar in you project.
/Anders
On Tue, Aug 30, 2011 at 15:47, peekay_21 <sa...@gmail.com> wrote:
> I have n number of war files I want to deploy using a maven build to a tomcat
> server.
> I have configured the tomcat plug-in for doing the deployment for WAR files
> that are outside the project workspace.
> It seems to me though that the build see that there is nothing in the
> project and just ends because there is nothing to compile.
> Is this expected behavior when doing a maven build?
> the entire purpose of the project is to just deploy the war files via maven
> nothing else, I'm sure I'm just missing some little thing that should be
> obvious.
>
> attached is my pom file any help would be appreciated.
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>SeverSetup</groupId>
> <artifactId>SeverSetup</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <build>
> <plugins>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>tomcat-maven-plugin</artifactId>
> <version>1.1</version>
> <executions>
> <execution>
> <id>csr</id>
> <phase>pre-integration-test</phase>
> <configuration>
> <url>http://localhost:8080/manager</url>
> <server>tomcat</server>
> <path>/csr</path>
>
> <warFile>${war.path}/console/console.war</warFile>
> </configuration>
> </execution>
> <execution>
> <id>mobile</id>
> <phase>pre-integration-test</phase>
> <configuration>
> <url>http://localhost:8080/manager</url>
> <server>tomcat</server>
> <path>/mobile</path>
> <warFile>${war.path}/mobile/mobile.war</warFile>
> </configuration>
> </execution>
> <execution>
> <id>alerts</id>
> <phase>pre-integration-test</phase>
> <configuration>
> <url>http://localhost:8080/manager</url>
> <server>tomcat</server>
> <path>/alerts</path>
>
> <warFile>${project.root}/alerts/target/alerts.war</warFile>
> </configuration>
> </execution>
> <execution>
> <id>enrollment</id>
> <phase>pre-integration-test</phase>
> <configuration>
> <url>http://localhost:8080/manager</url>
> <server>tomcat</server>
> <path>/enrollment</path>
>
> <warFile>${project.root}/enrollment/target/enrollment.war</warFile>
> </configuration>
> </execution>
> </executions>
>
> </plugin>
> <plugin>
> <groupId>org.codehaus.cargo</groupId>
> <artifactId>cargo-maven2-plugin</artifactId>
> <version>1.1.2</version>
> <configuration></configuration>
> </plugin>
> </plugins>
> </build>
> <properties>
> <project.root>root</project.root>
> <war.path>war/path</war.path>
> </properties>
> </project>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Multiple-WAR-deploy-with-maven-to-tomcat-tp4750066p4750066.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org