Re: [jetty-user] [Jetty Maven Plugin] Not pulling in Test scope dependencies when useTestScope is true
Jan Bartel <[email protected]> Mon, 5 Mar 2012 14:29:19 +1100
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <CALg=Vpiq=ksQjiij3MdEXBisKM9iHXV1jNXYCLrD5u3_cNTO_A@mail.gmail.com> |
http://jira.codehaus.org/browse/JETTY-1491 Fixed in 7.6.2, 8.1.2 cheers Jan On 5 March 2012 14:18, Nathan Schile <[email protected]> wrote: > I have the plugin configured to pull in test classes and > dependencies[1], however it doesn't seem to be pulling in my test > dependencies. I am receiving a NoClassDefFoundError on the class from > a test dependency, if I switch the dependency to a scope of compile, > it works fine. > > My use case is that I have a jar that contains JAX-RS resources. I am > using the Jersey Maven Plugin to do integration testing using embedded > Jetty. I have a web.xml in /src/test/webapp/WEB-INF/, and have test > dependencies that mock out some services. The mock services are only > found when they are pulled in using a "compile" scope. I would > however like these dependencies to have a scope of "test" since they > are only used for testing. > > Any ideas? > > [1] useTestScope > http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin#Configuring_additional_parameters > > <plugin> > <groupId>org.mortbay.jetty</groupId> > <artifactId>jetty-maven-plugin</artifactId> > <version>8.1.0.v20120127</version> > <executions> > <execution> > <id>start-jetty</id> > <phase>pre-integration-test</phase> > <goals> > <goal>run</goal> > </goals> > <configuration> > <stopPort>${reserved.tomcat.stop.port}</stopPort> > <stopKey>foo</stopKey> > <daemon>true</daemon> > <contextPath>/${project.artifactId}</contextPath> > <useTestScope>true</useTestScope> > <connectors> > <connector > implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> > <port>${reserved.tomcat.port}</port> > <maxIdleTime>60000</maxIdleTime> > </connector> > </connectors> > > <webXml>${basedir}/src/test/webapp/WEB-INF/web.xml</webXml> > </configuration> > </execution> > <execution> > <id>stop-jetty</id> > <phase>post-integration-test</phase> > <goals> > <goal>stop</goal> > </goals> > <configuration> > <stopPort>${reserved.tomcat.stop.port}</stopPort> > <stopKey>foo</stopKey> > </configuration> > </execution> > </executions> > </plugin> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email