2013/9/9 Greg Amerson <[email protected]>:
> Hello all,
>
> I'm trying to use the tomcat7-maven-plugin, specifically running the *mvn
> tomcat7:run* command.
>
> However, in my case I have two requirements that are different than the
> documentation provides for and I'm wondering if it is possible with the
> current tomcat7-maven-plugin.
>
> 1. need to deploy several jars to the global tomcat classpath (i.e. same as
> copying them into <tomcat.home>/lib/ext/ folder in a standalone install).
> 2. need to deploy a war to the ROOT context but instead of packaging the
> current project from source, I just need to point to an existing WAR as a
> dependency.
>
> So in my project there will be no webapp source. I simply want to run a
> tomcat with some extra jars in /lib/ext/ directory and also deploy a war
> that is obtained via a <dependency> with war type instead of packaged from
> source.
>
> Thanks in advance for any help!
>
Hi,
I don't know if it could answer your question but I think I do
something similar for integration testing.
First to add jar to embedded tomcat used by by the plugin, Ideclare
those Jar as dependencies for the plugin.
Then to add a different war I use the dependency plugin to unzip the
war in the current project build directory and then use the tomcat
plugin to launch it :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unzip-webapp</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${artifact-to-import}</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/webapp</outputDirectory>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>run-war-only</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<path>/</path>
<port>8080</port>
<uriEncoding>UTF-8</uriEncoding>
<warDirectory>${project.build.directory}/webapp/</warDirectory>
<fork>true</fork>
<ignorePackaging>true</ignorePackaging>
<contextFile>${project.build.directory}/webapp/META-INF/context.xml</contextFile>
</configuration>
</execution>
<execution>
<id>tomcat-shutdown</id>
<goals>
<goal>shutdown</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
</plugin>
.
Cédric
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]