Maven Jetty 插件兼容性问题

Maven Jetty plugin compatibility issue

我正在尝试在此网页中构建示例项目:

http://open-services.net/resources/tutorials/integrating-products-with-oslc/running-the-examples/

一切正常,但在启动 Ninacrm 项目(最后一步)时出现异常。

遇到这样的错误:

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilde with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building nina-crm-example 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> jetty-maven-plugin:9.3.0.v20150612:run-exploded (default-cli) @ ninacrm >>>
[WARNING] The POM for woodstox:wstx-asl:jar:3.0.0 is missing, no dependency information available
[WARNING] The artifact jdom:jdom:jar:1.1 has been relocated to org.jdom:jdom:jar:1.1
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ninacrm ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ ninacrm ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ninacrm ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ ninacrm ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ninacrm ---
[INFO] Surefire report directory: C:\Users\markel\git\org.eclipse.lyo.docs\ninacrm\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.ecliplse.lyo.samples.ninacrm.ParseTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ ninacrm ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ninacrm] in [C:\Users\markel\git\org.eclipse.lyo.docs\ninacrm\target\ninacrm]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\markel\git\org.eclipse.lyo.docs\ninacrm\src\main\webapp]
[INFO] Webapp assembled in [107 msecs]
[INFO] Building war: C:\Users\markel\git\org.eclipse.lyo.docs\ninacrm\target\ninacrm.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO] 
[INFO] <<< jetty-maven-plugin:9.3.0.v20150612:run-exploded (default-cli) @ ninacrm <<<
[WARNING] The artifact jdom:jdom:jar:1.1 has been relocated to org.jdom:jdom:jar:1.1
[INFO] 
[INFO] --- jetty-maven-plugin:9.3.0.v20150612:run-exploded (default-cli) @ ninacrm ---
[WARNING] Error injecting: org.eclipse.jetty.maven.plugin.JettyRunWarExplodedMojo
java.lang.TypeNotPresentException: Type org.eclipse.jetty.maven.plugin.JettyRunWarExplodedMojo not present
at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:115)
at org.eclipse.sisu.space.NamedClass.load(NamedClass.java:46)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
at com.google.inject.internal.ProviderInternalFactory.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.eclipse.sisu.plexus.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:993)
at com.google.inject.Scopes.get(Scopes.java:59)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:462)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:120)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/maven/plugin/JettyRunWarExplodedMojo : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access0(URLClassLoader.java:71)
at java.net.URLClassLoader.run(URLClassLoader.java:361)
at java.net.URLClassLoader.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:389)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:107)
... 41 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.193 s
[INFO] Finished at: 2015-10-16T11:36:44+01:00
[INFO] Final Memory: 15M/224M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.0.v20150612:run-exploded (default-cli) on project ninacrm: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.3.0.v20150612:run-exploded failed: Unable to load the mojo 'run-exploded' in the plugin 'org.eclipse.jetty:jetty-maven-plugin:9.3.0.v20150612' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/eclipse/jetty/maven/plugin/JettyRunWarExplodedMojo : Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.eclipse.jetty:jetty-maven-plugin:9.3.0.v20150612
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-maven-plugin/9.3.0.v20150612/jetty-maven-plugin-9.3.0.v20150612.jar
[ERROR] urls[1] = file:/C:/Users/markel/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/C:/Users/markel/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/C:/Users/markel/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
[ERROR] urls[4] = file:/C:/Users/markel/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[5] = file:/C:/Users/markel/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/C:/Users/markel/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/C:/Users/markel/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/C:/Users/markel/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/C:/Users/markel/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-tools-api/3.1/maven-plugin-tools-api-3.1.jar
[ERROR] urls[10] = file:/C:/Users/markel/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[11] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-util/9.3.0.v20150612/jetty-util-9.3.0.v20150612.jar
[ERROR] urls[12] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-webapp/9.3.0.v20150612/jetty-webapp-9.3.0.v20150612.jar
[ERROR] urls[13] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-xml/9.3.0.v20150612/jetty-xml-9.3.0.v20150612.jar
[ERROR] urls[14] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-servlet/9.3.0.v20150612/jetty-servlet-9.3.0.v20150612.jar
[ERROR] urls[15] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-quickstart/9.3.0.v20150612/jetty-quickstart-9.3.0.v20150612.jar
[ERROR] urls[16] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-jaas/9.3.0.v20150612/jetty-jaas-9.3.0.v20150612.jar
[ERROR] urls[17] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-security/9.3.0.v20150612/jetty-security-9.3.0.v20150612.jar
[ERROR] urls[18] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-plus/9.3.0.v20150612/jetty-plus-9.3.0.v20150612.jar
[ERROR] urls[19] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-jndi/9.3.0.v20150612/jetty-jndi-9.3.0.v20150612.jar
[ERROR] urls[20] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-server/9.3.0.v20150612/jetty-server-9.3.0.v20150612.jar
[ERROR] urls[21] = file:/C:/Users/markel/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
[ERROR] urls[22] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-http/9.3.0.v20150612/jetty-http-9.3.0.v20150612.jar
[ERROR] urls[23] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-io/9.3.0.v20150612/jetty-io-9.3.0.v20150612.jar
[ERROR] urls[24] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-jmx/9.3.0.v20150612/jetty-jmx-9.3.0.v20150612.jar
[ERROR] urls[25] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/jetty-annotations/9.3.0.v20150612/jetty-annotations-9.3.0.v20150612.jar
[ERROR] urls[26] = file:/C:/Users/markel/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
[ERROR] urls[27] = file:/C:/Users/markel/.m2/repository/org/ow2/asm/asm/5.0.1/asm-5.0.1.jar
[ERROR] urls[28] = file:/C:/Users/markel/.m2/repository/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar
[ERROR] urls[29] = file:/C:/Users/markel/.m2/repository/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar
[ERROR] urls[30] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-server-impl/9.3.0.v20150612/javax-websocket-server-impl-9.3.0.v20150612.jar
[ERROR] urls[31] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-client-impl/9.3.0.v20150612/javax-websocket-client-impl-9.3.0.v20150612.jar
[ERROR] urls[32] = file:/C:/Users/markel/.m2/repository/javax/websocket/javax.websocket-api/1.0/javax.websocket-api-1.0.jar
[ERROR] urls[33] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/websocket-server/9.3.0.v20150612/websocket-server-9.3.0.v20150612.jar
[ERROR] urls[34] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/websocket-common/9.3.0.v20150612/websocket-common-9.3.0.v20150612.jar
[ERROR] urls[35] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/websocket-api/9.3.0.v20150612/websocket-api-9.3.0.v20150612.jar
[ERROR] urls[36] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/websocket-client/9.3.0.v20150612/websocket-client-9.3.0.v20150612.jar
[ERROR] urls[37] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/websocket/websocket-servlet/9.3.0.v20150612/websocket-servlet-9.3.0.v20150612.jar
[ERROR] urls[38] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/apache-jsp/9.3.0.v20150612/apache-jsp-9.3.0.v20150612.jar
[ERROR] urls[39] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/toolchain/jetty-schemas/3.1.M0/jetty-schemas-3.1.M0.jar
[ERROR] urls[40] = file:/C:/Users/markel/.m2/repository/org/mortbay/jasper/apache-jsp/8.0.20.M0/apache-jsp-8.0.20.M0.jar
[ERROR] urls[41] = file:/C:/Users/markel/.m2/repository/org/mortbay/jasper/apache-el/8.0.20.M0/apache-el-8.0.20.M0.jar
[ERROR] urls[42] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/orbit/org.eclipse.jdt.core/3.8.2.v20130121/org.eclipse.jdt.core-3.8.2.v20130121.jar
[ERROR] urls[43] = file:/C:/Users/markel/.m2/repository/org/eclipse/jetty/apache-jstl/9.3.0.v20150612/apache-jstl-9.3.0.v20150612.jar
[ERROR] urls[44] = file:/C:/Users/markel/.m2/repository/org/apache/taglibs/taglibs-standard-spec/1.2.1/taglibs-standard-spec-1.2.1.jar
[ERROR] urls[45] = file:/C:/Users/markel/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.1/taglibs-standard-impl-1.2.1.jar
[ERROR] urls[46] = file:/C:/Users/markel/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

这里是 Ninacrm 项目的 pom.xml 文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>net.openservices</groupId>
<artifactId>ninacrm</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>

<name>nina-crm-example</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.1</version>
        <scope>test</scope>
    </dependency>


    <dependency>
        <groupId>jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.1</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>com.hp.hpl.jena</groupId>
        <artifactId>jena</artifactId>
        <version>2.5.7</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>

</dependencies>

<build>
    <finalName>ninacrm</finalName>

    <plugins>

        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.0.v20150612</version>
            <configuration>
                <webAppConfig>
                    <contextPath>/ninacrm</contextPath>
                </webAppConfig>

                <!-- Jetty config adds logging -->
                <jettyConfig>${project.build.directory}/test-classes/jetty.xml</jettyConfig>

                <systemProperties>

                    <systemProperty>
                        <name>config.dir</name>
                        <value>${basedir}/src/test/resources</value>
                    </systemProperty>

                    <systemProperty>
                        <name>jetty.logs</name>
                        <value>${basedir}/target</value>
                    </systemProperty>

                    <systemProperty>
                        <name>jetty.port</name>
                        <value>8181</value>
                    </systemProperty>

                </systemProperties>

            </configuration>
        </plugin>

    </plugins>

</build>

</project>

我正在使用 Eclipse Luna 和 jdk 1.7,还尝试使用 Mars 和 jdk 1.8。 有人知道发生了什么事吗?

提前致谢。

在 运行 配置中,在 JRE 选项卡下,使用 Java 1.8 到 运行 它。