Maven Jetty:插件管理器执行目标'org.mortbay.jetty:maven-jetty-plugin:6.1.22:run'中的内部错误

时间:2009-11-30 21:50:02

标签: maven-2 jetty

我已经能够通过Maven的jetty插件在本地运行一些Web服务,以便在一段时间内进行测试。我能够运行大约7个这样的服务,它运行良好。最近,在没有任何配置更改的情况下,我开始收到以下错误:

$ 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] ------------------------------------------------------------------------

以下是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>

这个配置没有改变,因为我能够成功运行它。我尝试更新Maven的版本(从2.0.9到2.2.1),但这并没有解决任何问题。我还尝试在构建周期中删除.m2 / repository / org / mortbay / jetty目录和redownloading,但这也没有解决任何问题。

1 个答案:

答案 0 :(得分:4)

  

最近,在没有任何配置更改的情况下,我开始收到以下错误[...]

也许你没有改变任何东西......但也许你开始使用新版本的maven-jetty-plugin。尝试恢复到以前的版本:

<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>

实际上,应该始终锁定插件版本以获得构建再现性(即使我不确定这会解决此问题)。新事物可能会破坏你的构建,你不想让它们无法控制。