0

セレンテストを実行できるように、Mavenビルド内でJettyを起動しようとすると、例外が発生します。

私が得ている例外は次のとおりです。

[ERROR] Failed to execute goal org.mortbay.jetty:jetty-maven-plugin:8.0.0.RC0:run (start-jetty) on project THEPROJECTIAMWORKINGON: Failure: Object is not of type class org.eclipse.jetty.webapp.WebAppContext -> [Help 1]org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mortbay.jetty:jetty-maven-plugin:8.0.0.RC0:run (start-jetty) on project THEPROJECTIAMWORKINGON: Failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:203)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:451)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:188)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:134)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failure
    at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:358)
    at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:273)
    at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:548)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
    ... 19 more
Caused by: java.lang.IllegalArgumentException: Object is not of type class org.eclipse.jetty.webapp.WebAppContext
    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:310)
    at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:273)
    at org.mortbay.jetty.plugin.JettyRunMojo.applyJettyXml(JettyRunMojo.java:540)
    at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:289)
    ... 23 more

私は現在、必要最低限​​のjetty.xmlを使用して、それを機能させようとしています。

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">


</Configure>

そして、pom.xmlのプラグインコードは現時点では次のようになっています。

   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <configuration>
     <scanIntervalSeconds>15</scanIntervalSeconds>
     <stopKey>stop-me</stopKey>
     <stopPort>9999</stopPort>
   </configuration>
   <executions>
     <execution>
       <id>start-jetty</id>
       <phase>pre-integration-test</phase>
       <goals>
         <goal>run</goal>
       </goals>
       <configuration>
         <scanIntervalSeconds>0</scanIntervalSeconds>
         <daemon>true</daemon>
         <jettyConfig>src/test/resources/jetty.xml</jettyConfig>
       </configuration>
     </execution>
     <execution>
       <id>stop-jetty</id>
       <phase>post-integration-test</phase>
       <goals>
         <goal>stop</goal>
       </goals>
     </execution>
   </executions>

誰かがこれを見たことがありますか?または、修正する必要があるアイデアがありますか?

4

1 に答える 1

0

わかりましたので、しばらくいじくり回した後、問題が何であるかを理解しました。POM に jettyConfig の代わりに jettyEnvXml が必要でした

于 2012-08-29T21:55:59.887 に答える