maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edelson, Justin" <Justin.Edel...@mtvstaff.com>
Subject RE: Jetty and using src/test/webapp
Date Fri, 01 May 2009 16:12:42 GMT
The useTestClasspath configuration option adds test classes and
resources to the classpath used by jetty:run.

Justin

-----Original Message-----
From: Todd Orr [mailto:torr0101@gmail.com] 
Sent: Friday, May 01, 2009 11:39 AM
To: Maven Users List
Subject: Re: Jetty and using src/test/webapp

This is not so unusual. Consider that I have a similar issue. I have
spring configs that are only used for integration testing. These reside
in src/test/resource. When firing up jetty:run it cannot read those
resources as defined in my web.xml via classpath:resource. Furthermore,
the jetty plugin cannot resolve test dependencies. It seems ugly that I
have to include these deps in compile scope just to get jetty to find
them. The problem is that in essence the jetty plugin is only useful for
testing a production version of your code base. This is severely
limiting.

On Mon, Sep 22, 2008 at 10:27 PM, Brett Porter
<brett.porter@gmail.com>wrote:

> I think you'd have to copy the files all to one directory and use that

> instead, but that would prevent the automatic recompilation.
>
> You might be able to add a profile that adds the test directory as an 
> additional source directory, but be careful here that it will pollute 
> target/classes for an eventual build that doesn't run with clean.
>
> If you need an enhancement to the plugin to support multiple class 
> directories, that would need to be requested of the Jetty developers.
> They may have better ideas how to do this, as it seems like an unusual

> use case to me.
>
> - Brett
>
> 2008/9/23 Andrew Robinson <andrew.rw.robinson@gmail.com>:
> > I have a war project that was built that also has a
"src/test/webapp"
> > directory. The idea was that test pages could be made in this 
> > directory that would not be included in the normal war.
> >
> > I have got it mostly working except for the classes. I need to have 
> > both target/classes and target/test-classes on the classpath. Here 
> > is what I have been attempting to use:
> >
> >          <plugin>
> >            <groupId>org.mortbay.jetty</groupId>
> >            <artifactId>maven-jetty-plugin</artifactId>
> >            <version>6.1.12.rc2</version>
> >            <configuration>
> >              <scanIntervalSeconds>10</scanIntervalSeconds>
> >              
> > <webXml>${basedir}/src/test/webapp/WEB-INF/web.xml</webXml>
> >
>  
> <webAppSourceDirectory>${basedir}/src/test/webapp</webAppSourceDirecto
> ry>
> >              <webAppConfig>
> >                <contextPath>/demo-test</contextPath>
> >                <baseResource
> >
>  implementation="org.mortbay.resource.ResourceCollection">
> >                  <resourcesAsCSV>
> >                    src/test/webapp,src/main/webapp
> >                  </resourcesAsCSV>
> >                </baseResource>
> >              </webAppConfig>
> >            </configuration>
> >
> >
> > Looking here:
> >
> http://docs.codehaus.org/display/JETTY/Which+files+are+scanned+by+the+
> Jetty+Maven+Plugin
> >
> > It says that scanTargets are picked up, but that did not work.
> >
> > I set classesDirectory to "${basedir}/target/test-classes", but then

> > the "${basedir}/target/classes" were no longer on the classpath.
> >
> > How can I get jetty to run off of the src/test/webapp and include 
> > both "${basedir}/target/test-classes" and
"${basedir}/target/classes"?
> >
> > Thanks,
> > Andrew
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
>
> --
> Brett Porter
> Blog: http://blogs.exist.com/bporter/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message