You can work around that by creating a profile called e.g. run

in the root pom you just do

<profiles>
<profile>
<id>run</id>
<build>
  <defaultGoals>test-compile</defaultGoals>
  <properties>
    <skipTests>true</skipTests>
  </properties>
</build>
</profile>
</profiles>

and then in the webapp pom you do

<profiles>
<profile>
<id>run</id>
<build>
<plugins>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<executions>
<execution>
<id>run</id>
<phase>test-compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugins>
</build>
</profile>
</profiles>

And then

$ mvn -Prun

and bob's your uncle...

OK not as handy as my -DrunModule=

but it does work (though I ususally go as far as verify when doing those
tricks in the cases where I cannot use jszip-maven-plugin because I haven't
ported all the jetty features)


On 12 March 2013 10:39, Thomas Broyer <t.bro...@gmail.com> wrote:

> On Tue, Mar 12, 2013 at 11:07 AM, Stephen Connolly <
> stephen.alan.conno...@gmail.com> wrote:
>
> > I don't think that is an issue any more with org.eclipse.jetty's maven
> > plugin
> >
>
> Running "mvn org.eclipse.jetty:jetty-maven-plugin:9.0.0.v20130308:run" at
> the root of a multi-module still launches Jetty on the root project (the
> one with packaging=pom), and there's no way to ignore modules depending on
> their packaging (like tomcat-maven-plugin's ignorePackaging or
> jszip-maven-plugin's runPackages, only considering packaging=war modules by
> default) or targeting a specific module (like jszip-maven-plugin's
> runModule, which is a *great* idea BTW).
>
>
> >
> >
> > On 12 March 2013 09:29, Thomas Broyer <t.bro...@gmail.com> wrote:
> >
> > > On Tue, Mar 12, 2013 at 8:24 AM, maven apache <apachemav...@gmail.com
> > > >wrote:
> > >
> > > > Hi everyone:
> > > >
> > > > I am using maven3 as my J2EE application build tool.
> > > >
> > > > Now I meet some problem during my development --- I found it is so
> > > > inflexible to do the test or debug in the multiple modules.
> > > >
> > > > For example, I have a parent maven project whose pom.xml is like
> this:
> > > >
> > > >     <modules>
> > > >         <module>app-common</module>
> > > >         <module>app-webapp</module>
> > > >     </modules>
> > > >
> > > > And the app-common/pom.xml:
> > > >
> > > > <package>jar</package>
> > > >
> > > >
> > > > the app-webapp/pom.xml:
> > > >
> > > >             <package>war</package>
> > > >             <dependency>
> > > >                 <groupId>${project.groupId}</groupId>
> > > >                 <artifactId>app-common</artifactId>
> > > >                 <version>${project.version}</version>
> > > >             </dependency>
> > > >     <build>
> > > >         <finalName>app</finalName>
> > > >         <plugins>
> > > >             <plugin>
> > > >                 <groupId>org.mortbay.jetty</groupId>
> > > >                 <artifactId>maven-jetty-plugin</artifactId>
> > > >                 <configuration>
> > > >                     <scanIntervalSeconds>10</scanIntervalSeconds>
> > > >                     <stopKey>foo</stopKey>
> > > >                     <stopPort>9999</stopPort>
> > > >                 </configuration>
> > > >             </plugin>
> > > >         </plugins>
> > > >     </build>
> > > >
> > > > Now,the app-common project hold all the classed for the whole
> > > > application,and the app-webapp is responsible for the presentation.
> > > >
> > > > As you can see I use the jetty to set up the web application.
> > > >
> > > > However, each time I make some change inside the project app-common,
> > the
> > > > jetty can not detect it which means that I have to run the "mvn
> > install"
> > > > under the parent project,and restart the jetty to see the update.
> This
> > is
> > > > too inflexible.
> > > >
> > > > So I wonder how do you guys do this kind of development?
> > > >
> > >
> > >
> > > I don't use Jetty for multi-module builds; see
> > > http://jira.codehaus.org/browse/JETTY-1517
> > > The tomcat-maven-plugin (starting with 2.0) works great for multimodule
> > > builds; see
> > >
> > >
> >
> http://tomcat.apache.org/maven-plugin-2.1/run-mojo-features.html#Maven_project_structure
> > >
> > > --
> > > Thomas Broyer
> > > /tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/> <
> http://xn--nna.ma.xn--bwa-xxb.je/> <
> > http://xn--nna.ma.xn--bwa-xxb.je/> <
> > > http://xn--nna.ma.xn--bwa-xxb.je/>
> > >
> >
>
>
>
> --
> Thomas Broyer
> /tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/> <
> http://xn--nna.ma.xn--bwa-xxb.je/>
>

Reply via email to