You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Gainty <mg...@hotmail.com> on 2013/09/10 11:55:11 UTC

RE: Deploying war from dependency with tomcat7-maven-plugin

 Oliver wrote this plugin so I will reference his doc 



> From: gregory.amerson@liferay.com
> Date: Mon, 9 Sep 2013 11:18:50 +0800
> Subject: Deploying war from dependency with tomcat7-maven-plugin
> To: users@tomcat.apache.org
> 
> Hello all,
> 
> I'm trying to use the tomcat7-maven-plugin, specifically running the *mvn
> tomcat7:run* command.
MG>
<project>
  <packaging>war</packaging>
  <build>
    ...
    <plugins>
      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0-beta-1</version>
        <executions>
          <execution>
            <id>tomcat-run</id>
            <goals>
              <goal>exec-war-only</goal>
            </goals>
            <phase>package</phase>
            <configuration>

     <!-- assume ROOT --->

               <path>/</path>
       <!-- extra dependencies to add jdbc driver mail jars -->
              <extraDependencies>
                <extraDependency>

> 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).

MG>COPY RESOURCES


MG>http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html
MG>as with tomcat7-maven-plugin bind to package phase

> 2. need to deploy a war to the ROOT context
MG>see ROOT above
 >but instead of packaging the current project from source, I just need to point to an existing WAR as a dependency.
MG>maven dependency implies required sub-artifact of current artifact you are processing
MG>can i assume you want to replace an 'already deployed war'?
MG>then you will want mvn package tomcat7:redeploy
MG>http://tomcat.apache.org/maven-plugin-2.0-beta-1/context-goals.html#aRedeploying_a_WAR_project
> 
> 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
MG>see COPY RESOURCES above
 
> and also deploy a war
> that is obtained via a <dependency> with war type instead of packaged from
> source
MG><packaging>war</packaging>
MG>http://tomcat.apache.org/maven-plugin-2.0-beta-1/executable-war-jar.html
> 
> Thanks in advance for any help!
> 
> -- 
> Greg Amerson
> Liferay Developer Tools
> Liferay, Inc. www.liferay.com

MG>Oliver please check accuracy