Why does Maven Jetty Plugin not find a class in a standard jetty jar -


i'm using jetty 9.0.4v20130625 running using maven-jetty-plugin. have implemented own loginservice class handle users logging in realm. on 1 of lines, attempt use org.eclipse.jetty.util.security.credential class during execution throws noclassdeffounderror on line.

my target directory contains being deployed jetty instance. within web-inf/lib folder not contain jetty-util-9.0.4.v20130625.jar expected because plugin should have believe rules out conflicting jars. causing jetty instance not find jar?

i using eclipse, , shows no errors in code. set maven project , maven handles dependencies. set not package jetty jars should provided jetty when deployed. here pom.xml:

<project ...>   ...   <packaging>war</packaging>   ...   <dependencies>     <dependency>       <groupid>junit</groupid>       <artifactid>junit</artifactid>       <version>3.8.1</version>       <scope>test</scope>     </dependency>     <dependency>       <groupid>org.eclipse.jetty</groupid>       <artifactid>jetty-webapp</artifactid>       <version>9.0.4.v20130625</version>       <scope>provided</scope>     </dependency>     <dependency>       <groupid>org.mongodb</groupid>       <artifactid>mongo-java-driver</artifactid>       <version>2.11.2</version>     </dependency>    </dependencies>   <build>     <finalname>...</finalname>     <plugins>       <plugin>         <groupid>org.apache.maven.plugins</groupid>         <artifactid>maven-compiler-plugin</artifactid>         <version>3.1</version>         <configuration>           <source>1.7</source>           <target>1.7</target>         </configuration>       </plugin>        <plugin>         <groupid>org.eclipse.jetty</groupid>         <artifactid>jetty-maven-plugin</artifactid>         <version>9.0.4.v20130625</version>         <configuration>           <scanintervalseconds>10</scanintervalseconds>           <webapp>             <contextpath>/...</contextpath>           </webapp>           <login-config>             <auth-method>form</auth-method>             <realm-name>test realm</realm-name>             <form-login-config>               <form-login-page>/loginauth.html?param=redirect</form-login-page>               <form-error-page>/loginauth.html?param=failed</form-error-page>             </form-login-config>           </login-config>         </configuration>       </plugin>        <plugin>         <groupid>org.apache.maven.plugins</groupid>         <artifactid>maven-scm-plugin</artifactid>         <version>1.8.1</version>         <configuration>           <connectiontype>developerconnection</connectiontype>         </configuration>       </plugin>        <plugin>         <artifactid>maven-antrun-plugin</artifactid>         <version>1.7</version>         <executions>           <execution>             <phase>install</phase>             <configuration>               <tasks>                 <ant target="deploy" />               </tasks>             </configuration>             <goals>               <goal>run</goal>             </goals>           </execution>         </executions>         <dependencies>           <dependency>             <groupid>com.jcraft</groupid>             <artifactid>jsch</artifactid>             <version>0.1.50</version>           </dependency>           <dependency>             <groupid>org.apache.ant</groupid>             <artifactid>ant-jsch</artifactid>             <version>1.9.2</version>           </dependency>         </dependencies>       </plugin>     </plugins>   </build> </project> 

i checked sure plugin depends on jetty-util.jar , seen here

something may part of problem: implement new loginservice interface class, extending mappedloginservice class implements loginservice (it's in jetty jars) , i'm overriding of methods. causing problem?

jetty hides of implementation classes webapp's classloader. if need access them inside webapp, need put them webapp's web-inf/lib (in case add dependency jetty-util jar).

this classloading mechanism described here: http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html

btw, configuration jetty-maven-plugin pom.xml seems contain lines web.xml (i.e. inside elements). believe maven ignores configuration doesn't understand, perhaps things not configured way think are? also, don't see setup using custom loginservice.


Comments