当我尝试运行mvn jetty时,我遇到了一个奇怪的错误:在我的项目上运行。当我在另一个系统上运行我的代码时,一切正常,但在我的Mac上,我得到了这个奇怪的错误。它以前工作过,但突然间它无法工作。
这是错误消息:
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0:run (default-cli) on project assignment2-gui: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0:run failed: Unable to load the mojo 'run' in the plugin 'org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/eclipse/jetty/maven/plugin/JettyRunMojo : Unsupported major.minor version 51.0
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-maven-plugin/9.1.0.M0/jetty-maven-plugin-9.1.0.M0.jar
[ERROR] urls[1] = file:/Users/eivindml/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/Users/eivindml/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/Users/eivindml/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
[ERROR] urls[4] = file:/Users/eivindml/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[5] = file:/Users/eivindml/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/Users/eivindml/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/Users/eivindml/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/Users/eivindml/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/Users/eivindml/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-tools-api/3.1/maven-plugin-tools-api-3.1.jar
[ERROR] urls[10] = file:/Users/eivindml/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[11] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-util/9.1.0.M0/jetty-util-9.1.0.M0.jar
[ERROR] urls[12] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-webapp/9.1.0.M0/jetty-webapp-9.1.0.M0.jar
[ERROR] urls[13] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-xml/9.1.0.M0/jetty-xml-9.1.0.M0.jar
[ERROR] urls[14] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-servlet/9.1.0.M0/jetty-servlet-9.1.0.M0.jar
[ERROR] urls[15] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-jaas/9.1.0.M0/jetty-jaas-9.1.0.M0.jar
[ERROR] urls[16] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-security/9.1.0.M0/jetty-security-9.1.0.M0.jar
[ERROR] urls[17] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-plus/9.1.0.M0/jetty-plus-9.1.0.M0.jar
[ERROR] urls[18] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-jndi/9.1.0.M0/jetty-jndi-9.1.0.M0.jar
[ERROR] urls[19] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-server/9.1.0.M0/jetty-server-9.1.0.M0.jar
[ERROR] urls[20] = file:/Users/eivindml/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
[ERROR] urls[21] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-http/9.1.0.M0/jetty-http-9.1.0.M0.jar
[ERROR] urls[22] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-io/9.1.0.M0/jetty-io-9.1.0.M0.jar
[ERROR] urls[23] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-jmx/9.1.0.M0/jetty-jmx-9.1.0.M0.jar
[ERROR] urls[24] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-annotations/9.1.0.M0/jetty-annotations-9.1.0.M0.jar
[ERROR] urls[25] = file:/Users/eivindml/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
[ERROR] urls[26] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/orbit/org.objectweb.asm/3.1.0.v200803061910/org.objectweb.asm-3.1.0.v200803061910.jar
[ERROR] urls[27] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-server-impl/9.1.0.M0/javax-websocket-server-impl-9.1.0.M0.jar
[ERROR] urls[28] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-client-impl/9.1.0.M0/javax-websocket-client-impl-9.1.0.M0.jar
[ERROR] urls[29] = file:/Users/eivindml/.m2/repository/javax/websocket/javax.websocket-api/1.0/javax.websocket-api-1.0.jar
[ERROR] urls[30] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/websocket-server/9.1.0.M0/websocket-server-9.1.0.M0.jar
[ERROR] urls[31] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/websocket-common/9.1.0.M0/websocket-common-9.1.0.M0.jar
[ERROR] urls[32] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/websocket-api/9.1.0.M0/websocket-api-9.1.0.M0.jar
[ERROR] urls[33] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/websocket-client/9.1.0.M0/websocket-client-9.1.0.M0.jar
[ERROR] urls[34] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/websocket/websocket-servlet/9.1.0.M0/websocket-servlet-9.1.0.M0.jar
[ERROR] urls[35] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/jetty-jsp/9.1.0.M0/jetty-jsp-9.1.0.M0.jar
[ERROR] urls[36] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/toolchain/jetty-schemas/3.1.M0/jetty-schemas-3.1.M0.jar
[ERROR] urls[37] = file:/Users/eivindml/.m2/repository/javax/servlet/jsp/javax.servlet.jsp-api/2.3.1/javax.servlet.jsp-api-2.3.1.jar
[ERROR] urls[38] = file:/Users/eivindml/.m2/repository/org/glassfish/web/javax.servlet.jsp/2.3.2/javax.servlet.jsp-2.3.2.jar
[ERROR] urls[39] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/orbit/javax.servlet.jsp.jstl/1.2.0.v201105211821/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
[ERROR] urls[40] = file:/Users/eivindml/.m2/repository/org/eclipse/jetty/orbit/org.apache.taglibs.standard.glassfish/1.2.0.v201112081803/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar
[ERROR] urls[41] = file:/Users/eivindml/.m2/repository/org/glassfish/javax.el/3.0.0/javax.el-3.0.0.jar
[ERROR] urls[42] = file:/Users/eivindml/.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:/Users/eivindml/.m2/repository/org/eclipse/jetty/orbit/javax.activation/1.1.0.v201105071233/javax.activation-1.1.0.v201105071233.jar
[ERROR] urls[44] = file:/Users/eivindml/.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]]
所以我的Mac上的设置可能有问题,但它之前已经有用了,我不能说自上次工作以来我已经改变了什么。我唯一能想到的就是我用brew去掉并安装了postgres。
答案 0 :(得分:0)
我找到了解决方案。
我实际上是安装了使用brew的postgres打破了它。
brew intall postgres
还安装了较新版本的maven,但这已将java版本设置为1.6。所以我做了brew remove maven
,当我现在运行mvn --version
时,它给了我:
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /usr/share/maven
Java version: 1.7.0_40, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"
一切都按预期运作。 :)