You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by maven apache <ap...@gmail.com> on 2013/03/12 08:24:32 UTC

effective practice for web application development using maven

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?

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
yeah a fair point, but I was just pointing out that there is a difference
in what the user requests.


On 12 March 2013 09:32, Thomas Broyer <t....@gmail.com> wrote:

> On Tue, Mar 12, 2013 at 10:11 AM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
> > It's rough and a little bit alpha still. Please take a look at
> > jszip.orgwhere I have the jszip-maven-plugin which will use it's
> > reactor spider
> > senses to build the classpath from the reactor,
>
>
> I saw that, and I'll use it as an inspiration for a rewritten
> gwt-maven-plugin, thanks for the hard work.
> I think you should contribute it back to Jetty:
> http://jira.codehaus.org/browse/JETTY-1517
>
>
> > so e.g.
> >
> > # from the root of the reactor
> > $ mvn compile org.jszip.maven:jszip-maven-plugin:run
> >
>
> You should probably use process-classes instead of compile (just in case)
>

Re: effective practice for web application development using maven

Posted by Thomas Broyer <t....@gmail.com>.
On Tue, Mar 12, 2013 at 10:11 AM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> It's rough and a little bit alpha still. Please take a look at
> jszip.orgwhere I have the jszip-maven-plugin which will use it's
> reactor spider
> senses to build the classpath from the reactor,


I saw that, and I'll use it as an inspiration for a rewritten
gwt-maven-plugin, thanks for the hard work.
I think you should contribute it back to Jetty:
http://jira.codehaus.org/browse/JETTY-1517


> so e.g.
>
> # from the root of the reactor
> $ mvn compile org.jszip.maven:jszip-maven-plugin:run
>

You should probably use process-classes instead of compile (just in case)

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
It's rough and a little bit alpha still. Please take a look at
jszip.orgwhere I have the jszip-maven-plugin which will use it's
reactor spider
senses to build the classpath from the reactor, so e.g.

# from the root of the reactor
$ mvn compile org.jszip.maven:jszip-maven-plugin:run

will compile all your source code and start the first web application in
the reactor (there are cli options to help pick the web application to
serve) with dynamic reloading of the classpath... IOW when you recompile a
class in your IDE... webapp restarts to pick up the change... this is
because as long as you don't go past the "prepare-package" phase of the
lifecycle, the reactor points to ${project.build.outputDirectory} for the
primary artifact

OTOH, if you do

#from the root of the reactor
$ mvn package org.jszip.maven:jszip-maven-plugin:run

then only when you refresh the .jar file will the classpath be detected as
modified and the webapp restarted because on or after the "package" phase
in the lifecycle, the primary artifact is the .jar/.war/.ear/etc so
jszip-maven-plugin is watching for changes in that.

The jetty plugin is not fully reactor aware... in fact to my knowledge my
jszip-maven-plugin experiments are currently the only fully reactor and pom
change aware plugins... once I figure out a good API for handling this type
of stuff (the jszip-maven-plugin is currently full of hacks to make it do
the magic it does) I fully intend bringing the API to the ASF (hence why
all contributors to the jszip.org maven plugin must license under ASLv2.

If you don't like that my plugin is in alpha, I have heard that the webby
eclipse plugin offers a subset of the jszip-maven-plugin functionality for
people using Eclipse+M2E as their IDE.

Alternatively you can look into tools such as JRebel which support less
hard webapp reloading (where they dynamically replace the classes without
stop-starting the entire webapp) but AFAIR those options require paying
mony to use them after their evaluation period expires (unless you can get
a FOSS license for using them)

-Stephen


On 12 March 2013 07:24, maven apache <ap...@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?
>

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
Ok, cool, good to know... glad to be pushing people to make the users life
easier.

BTW I expect to be able to make the pom reloading stuff available for other
plugins to use as a nicer API. I don't recommend copying my tricks directly
as there are some hidden assumptions that I am making which I will be able
to abstract away when I turn this into an API (which is part of the process
of preparing 1.0-beta-1)


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

> On Tue, Mar 12, 2013 at 11:09 AM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
> > Also that way of using tomcat is really just relying on rebuilding the
> > artifacts again
> >
>
> AFAICT, the tomcat-maven-plugin works more-or-less the same as your
> jszip-maven-plugin, except it only scans the dependent projects'
> outputDirectory (while you also scan the POMs). At least it works as you
> described for jszip: when your IDE recompiles a class or otherwise copy a
> resource to the outputDirectory, the webapp is automatically restarted
> (which BTW has unfortunate side-effects if you happen to use Guice:
> https://github.com/tbroyer/gwt-maven-archetypes/issues/19)
>

Re: effective practice for web application development using maven

Posted by Thomas Broyer <t....@gmail.com>.
On Tue, Mar 12, 2013 at 11:09 AM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> Also that way of using tomcat is really just relying on rebuilding the
> artifacts again
>

AFAICT, the tomcat-maven-plugin works more-or-less the same as your
jszip-maven-plugin, except it only scans the dependent projects'
outputDirectory (while you also scan the POMs). At least it works as you
described for jszip: when your IDE recompiles a class or otherwise copy a
resource to the outputDirectory, the webapp is automatically restarted
(which BTW has unfortunate side-effects if you happen to use Guice:
https://github.com/tbroyer/gwt-maven-archetypes/issues/19)

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
Also that way of using tomcat is really just relying on rebuilding the
artifacts again


On 12 March 2013 09:29, Thomas Broyer <t....@gmail.com> wrote:

> On Tue, Mar 12, 2013 at 8:24 AM, maven apache <apachemaven0@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/>
>

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
AFAIK, currently only jszip-maven-plugin responds to changes in the
dependencies in your pom files.

All the others require ^C, up arrow, enter

On Saturday, 16 March 2013, maven apache wrote:

> Thanks all you guys for the ideas.
>
> And it seems that the tomcat-maven-plugin is rather simple. And I prefer to
> it.
>
> However I can not found any docs about how to make it auto-scan the change
> of the dependency project. Do I miss anything?
>
> 2013/3/12 Stephen Connolly <st...@gmail.com>
>
> > 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....@gmail.com> wrote:
> >
> > > On Tue, Mar 12, 2013 at 11:07 AM, Stephen Connolly <
> > > stephen.alan.connolly@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....@gmail.com> wrote:
> > > >
> > > > > On Tue, Mar 12, 2013 at 8:24 AM, maven apache <
> > apachemaven0@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>> http://xn--nna.ma.xn--bwa-xxb.je/> <
> > > http://xn--nna.ma.xn--bwa-xxb.je/>
> > >
> >
>


-- 
Sent from my phone

RE: effective practice for web application development using maven

Posted by Martin Gainty <mg...@hotmail.com>.
Hes showing you how to 1)run a profile
2)create a profile using the <profile> element
<!-- your profile can include any number of plugins which themselves can include <dependencies> as seen here --><profiles>
    <profile>
        <id>full-build</id>
        <activation>
            <property>
                <name>build</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>                  .....................                  <executions>                     <execution>                     ...                    </execution>                   </executions>
                  <dependencies>
                   <dependency>                            .....
                    </dependency>
                  </dependencies>                </plugin>             </plugins>           </build>
       </profile>

HTH
Martin ______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 > From: apachemaven0@gmail.com
> Date: Sat, 16 Mar 2013 13:15:10 +0800
> Subject: Re: effective practice for web application development using maven
> To: users@maven.apache.org
> 
> Thanks all you guys for the ideas.
> 
> And it seems that the tomcat-maven-plugin is rather simple. And I prefer to
> it.
> 
> However I can not found any docs about how to make it auto-scan the change
> of the dependency project. Do I miss anything?
> 
> 2013/3/12 Stephen Connolly <st...@gmail.com>
> 
> > 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....@gmail.com> wrote:
> >
> > > On Tue, Mar 12, 2013 at 11:07 AM, Stephen Connolly <
> > > stephen.alan.connolly@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....@gmail.com> wrote:
> > > >
> > > > > On Tue, Mar 12, 2013 at 8:24 AM, maven apache <
> > apachemaven0@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/> <
> > > > > 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/> <
> > > http://xn--nna.ma.xn--bwa-xxb.je/>
> > >
> >
 		 	   		  

Re: effective practice for web application development using maven

Posted by maven apache <ap...@gmail.com>.
Thanks all you guys for the ideas.

And it seems that the tomcat-maven-plugin is rather simple. And I prefer to
it.

However I can not found any docs about how to make it auto-scan the change
of the dependency project. Do I miss anything?

2013/3/12 Stephen Connolly <st...@gmail.com>

> 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....@gmail.com> wrote:
>
> > On Tue, Mar 12, 2013 at 11:07 AM, Stephen Connolly <
> > stephen.alan.connolly@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....@gmail.com> wrote:
> > >
> > > > On Tue, Mar 12, 2013 at 8:24 AM, maven apache <
> apachemaven0@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/> <
> > > > 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/> <
> > http://xn--nna.ma.xn--bwa-xxb.je/>
> >
>

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
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....@gmail.com> wrote:

> On Tue, Mar 12, 2013 at 11:07 AM, Stephen Connolly <
> stephen.alan.connolly@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....@gmail.com> wrote:
> >
> > > On Tue, Mar 12, 2013 at 8:24 AM, maven apache <apachemaven0@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/>
>

Re: effective practice for web application development using maven

Posted by Thomas Broyer <t....@gmail.com>.
On Tue, Mar 12, 2013 at 11:07 AM, Stephen Connolly <
stephen.alan.connolly@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....@gmail.com> wrote:
>
> > On Tue, Mar 12, 2013 at 8:24 AM, maven apache <apachemaven0@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/>
> >
>



-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>

Re: effective practice for web application development using maven

Posted by Stephen Connolly <st...@gmail.com>.
I don't think that is an issue any more with org.eclipse.jetty's maven
plugin


On 12 March 2013 09:29, Thomas Broyer <t....@gmail.com> wrote:

> On Tue, Mar 12, 2013 at 8:24 AM, maven apache <apachemaven0@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/>
>

Re: effective practice for web application development using maven

Posted by Thomas Broyer <t....@gmail.com>.
On Tue, Mar 12, 2013 at 8:24 AM, maven apache <ap...@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/>