tags:

views:

708

answers:

1

I have been able to run some web services locally through Maven's jetty plugin for testing purposes for some time now. I was able to run about 7 services like this and it worked fine. Recently, without any configuration changes, I started receiving the following errors:

$ mvn jetty:run -Puat
[INFO] Scanning for projects...
Downloading: http://www.ibiblio.org/maven/org.mortbay.jetty/poms/maven-jetty-plugin-6.1.22.pom
[INFO] ------------------------------------------------------------------------
[INFO] Building delta1-cashdata-ws
[INFO]    task-segment: [jetty:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing jetty:run
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
-----------------------------------------------------
this realm = app0.child-container[org.mortbay.jetty:maven-jetty-plugin:6.1.22]
urls[0] = file:/c:/Documents and Settings/lemojon/.m2/repository/org/mortbay/jetty/maven-jetty-plugin/6.1.22/maven-jetty-plugin-6.1.22.jar
urls[1] = file:/c:/Documents and Settings/lemojon/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/c:/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.mortbay.jetty:maven-jetty-plugin:6.1.22:run': Unable to load the mojo 'org.mortbay.jetty:maven-jetty-plugin:6.1.22:run' in the plugin 'org.mortbay.jetty:maven-jetty-plugin'. A required class is missing: org/mortbay/jetty/webapp/WebAppContext
org.mortbay.jetty.webapp.WebAppContext
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Nov 30 16:32:00 EST 2009
[INFO] Final Memory: 11M/22M
[INFO] ------------------------------------------------------------------------

Here is the configuration from the POM:

<build>
    <plugins>
     <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
       <connectors>
        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
         <port>8083</port>
        </connector>
       </connectors>
      </configuration>
     </plugin>
    </plugins>
</build>

This configuration has not changed since I was able to run it successfully. I tried updating the version of Maven (from 2.0.9 to 2.2.1), but this did not solve anything. I also tried deleting the .m2/repository/org/mortbay/jetty directory and redownloading in the build cycle, but this also did not solve anything.

A: 

Recently, without any configuration changes, I started receiving the following errors [...]

Maybe you didn't change anything... But maybe you started to use a new version of the maven-jetty-plugin. Try to revert to the previous version:

<build>
  <plugins>
    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <version>6.1.21</version>
      <configuration>
        <connectors>
          <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
            <port>8083</port>
          </connector>
        </connectors>
      </configuration>
    </plugin>
  </plugins>
</build>

Actually, one should ALWAYS lock down plugin version for build reproducibility (even if I'm not sure this will solve the problem here). New things can break your build, you don't want to get them without control.

Pascal Thivent
Thanks for catching that, it worked!
jclemon
Glad it was helpful. BTW, the common way of recognizing a good answer is upvoting it and accepting it :)
Pascal Thivent