无法在Eclipse中执行目标 - Maven项目

时间:2015-06-07 12:28:35

标签: eclipse maven

我在Eclipse中打开了一个Maven项目。当我点击Run as - > Maven构建并输入“clean install”作为目标,然后我收到以下错误消息:

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder 
org.apache.maven.lifecycle.internal.builder.
singlethreaded.SingleThreadedBuilder with a thread count of 1


[INFO]  
[INFO] ---------------------------------------------------------------------    
[INFO] Building OCL 0.0.1-SNAPSHOT
[INFO] ---------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ OCL ---
[INFO] 
[INFO] --- monticore-maven-plugin:4.1.1:generate (default) @ OCL ---
[INFO] Downloading: http://nexus.se.rwth-aachen.de/content/groups/monticore/
de/se_rwth/commons/se-commons-utilities/1.7.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.se.rwth
 aachen.de/content/groups/monticore/de/
 se_rwth/commons/se-commons-utilities/1.7.0-SNAPSHOT/
 maven-metadata.xml    (1006 B at 0.2 KB/sec)
 [INFO] Downloading: http://nexus.se.rwth- 
 aachen.de/content/groups/monticore/
 de/se_rwth/commons/se-commons/1.7.0-SNAPSHOT/maven-metadata.xml
 [INFO] Downloaded: http://nexus.se.rwth-   
 aachen.de/content/groups/monticore/de/se_rwth/commons/se-commons/1.7.0-
 SNAPSHOT/maven-metadata.xml (607 B at 0.5 KB/sec)
 [INFO] Downloading: http://nexus.se.rwth-      
 aachen.de/content/groups/monticore/de/
 se_rwth/commons/se-commons-logging/1.7.0-SNAPSHOT/maven-metadata.xml
 [INFO] Downloaded: http://nexus.se.rwth- 
 aachen.de/content/groups/monticore/de/
se_rwth/commons/se-commons-logging/1.7.0-SNAPSHOT
/maven-metadata.xml (1004 B at 0.2 KB/sec)
[INFO] Downloading: http://nexus.se.rwth-        
aachen.de/content/groups/monticore/de/
se_rwth/commons/se-commons-groovy/1.7.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.se.rwth- 
aachen.de/content/groups/monticore/de/se_rwth/
commons/se-commons-groovy/1.7.0-SNAPSHOT/
maven-metadata.xml (2 KB at 1.3 KB/sec)
[WARNING] Error injecting: de.monticore.mojo.GenerateMojo
java.lang.TypeNotPresentException: Type de.monticore.mojo.GenerateMojo 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$1.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$2$1.
  call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.
  callInContext(InjectorImpl.java:1047)
at com.google.inject.internal.InjectorImpl$2.
  get(InjectorImpl.java:993)
at com.google.inject.Scopes$1$1.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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:       
  de/monticore/mojo/GenerateMojo : 
  Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
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: 29.582 s
[INFO] Finished at: 2015-06-07T13:42:38+01:00
[INFO] Final Memory: 12M/89M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal de.monticore.mojo:monticore-maven-     
plugin:4.1.1:generate (default) on project OCL: 
Execution default of goal de.monticore.mojo:monticore-maven-   
plugin:4.1.1:generate failed: Unable to load the mojo 'generate' in the  
plugin 'de.monticore.mojo:monticore-maven-plugin:4.1.1' due to an API    
incompatibility: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: 
de/monticore/mojo/GenerateMojo : Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>de.monticore.mojo:monticore-maven-plugin:4.1.1
 [ERROR] strategy =     
 org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
 [ERROR] urls[0] = file:/C:/Users/Abdullah- 
 PC/.m2/repository/de/monticore/mojo/monticore-maven-plugin/4.1.1/monticore-    
 maven-plugin-4.1.1.jar
 [ERROR] urls[1] = file:/C:/Users/Abdullah-   
 PC/.m2/repository/de/monticore/monticore-generator/4.1.1/monticore-
 generator-4.1.1.jar
 [ERROR] urls[2] = file:/C:/Users/Abdullah-   
 PC/.m2/repository/de/monticore/monticore-runtime/4.1.1/monticore-runtime-
 4.1.1.jar
 [ERROR] urls[3] = file:/C:/Users/Abdullah-  
 PC/.m2/repository/de/se_rwth/commons/se-commons-utilities/1.7.0-    
 SNAPSHOT/se-commons-utilities-1.7.0-SNAPSHOT.jar
 [ERROR] urls[4] = file:/C:/Users/Abdullah-   
 PC/.m2/repository/de/se_rwth/commons/se-commons-logging/1.7.0-SNAPSHOT/se-   
 commons-logging-1.7.0-SNAPSHOT.jar
 [ERROR] urls[5] = file:/C:/Users/Abdullah-  
 PC/.m2/repository/com/google/inject/guice/3.0/guice-3.0.jar
 [ERROR] urls[6] = file:/C:/Users/Abdullah-
 PC/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
 [ERROR] urls[7] = file:/C:/Users/Abdullah-
 PC/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
 [ERROR] urls[8] = file:/C:/Users/Abdullah-  
 PC/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar
 [ERROR] urls[9] = file:/C:/Users/Abdullah-
 PC/.m2/repository/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.jar
 [ERROR] urls[10] = file:/C:/Users/Abdullah-
 PC/.m2/repository/org/antlr/antlr4/4.3/antlr4-4.3.jar
 [ERROR] urls[11] = file:/C:/Users/Abdullah-  
 PC/.m2/repository/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.jar
 [ERROR] urls[12] = file:/C:/Users/Abdullah-
 PC/.m2/repository/org/antlr/ST4/4.0.8/ST4-4.0.8.jar
 [ERROR] urls[13] = file:/C:/Users/Abdullah-
 PC/.m2/repository/org/freemarker/freemarker/2.3.20/freemarker-2.3.20.jar
 [ERROR] urls[14] = file:/C:/Users/Abdullah-
PC/.m2/repository/de/se_rwth/commons/se-commons-groovy/1.7.0-SNAPSHOT/se-   
commons-groovy-1.7.0-SNAPSHOT.jar
[ERROR] urls[15] = file:/C:/Users/Abdullah-
PC/.m2/repository/jline/jline/2.12/jline-2.12.jar
[ERROR] urls[16] = file:/C:/Users/Abdullah-PC/.m2/repository/commons-
io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[17] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/codehaus/groovy/groovy/2.3.0/groovy-2.3.0.jar
[ERROR] urls[18] = file:/C:/Users/Abdullah-
PC/.m2/repository/de/monticore/monticore-grammar/4.1.1/monticore-grammar-
4.1.1.jar
[ERROR] urls[19] = file:/C:/Users/Abdullah-
PC/.m2/repository/de/monticore/lang/cd4analysis/0.0.1-MCGen.3/cd4analysis-
0.0.1-MCGen.3.jar
[ERROR] urls[20] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/antlr/antlr4-annotations/4.3/antlr4-annotations-
4.3.jar
[ERROR] urls[21] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/antlr/antlr4-runtime/4.3/antlr4-runtime-4.3.jar
[ERROR] urls[22] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/abego/treelayout/org.abego.
treelayout.core/1.0.1/org.abego.treelayout.core-1.0.1.jar
[ERROR] urls[23] = file:/C:/Users/Abdullah-
PC/.m2/repository/de/monticore/de.monticore.java/4.1.0.M2/de.monticore.java-
4.1.0.M2.jar
[ERROR] urls[24] = file:/C:/Users/Abdullah-   
PC/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-   
0.9.0.M2.jar
[ERROR] urls[25] = file:/C:/Users/Abdullah-
PC/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[26] = file:/C:/Users/Abdullah-   
PC/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[27] = file:/C:/Users/Abdullah-   
PC/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-
no_aop.jar
[ERROR] urls[28] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/eclipse/sisu/org.eclipse.
sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.jar
[ERROR] urls[29] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.19/plexus-
interpolation-1.19.jar
[ERROR] urls[30] = file:/C:/Users/Abdullah-  
PC/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.17/plexus-utils-
3.0.17.jar
[ERROR] urls[31] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/codehaus/plexus/plexus-component-
annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[32] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-
dispatcher-1.3.jar
[ERROR] urls[33] = file:/C:/Users/Abdullah-   
PC/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-
1.4.jar
[ERROR] urls[34] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-
annotations/3.3/maven-plugin-annotations-3.3.jar
[ERROR] urls[35] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-
reporting-api-3.0.jar
[ERROR] urls[36] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.6/doxia-sink-api-
1.6.jar
[ERROR] urls[37] = file:/C:/Users/Abdullah-
PC/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.6/doxia-   
logging-api-1.6.jar
[ERROR] urls[38] = file:/C:/Users/Abdullah-PC/.m2/repository/xml-apis/xml-
apis/1.0.b2/xml-apis-1.0.b2.jar
[ERROR] urls[39] = file:/C:/Users/Abdullah-   
PC/.m2/repository/com/google/guava/guava/18.0/guava-18.0.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

我还添加了pom.xml:

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

  <!-- == PROJECT COORDINATES =============================================>

<groupId>OCL</groupId>
<artifactId>OCL</artifactId>
<version>0.0.1-SNAPSHOT</version>

<!-- == PROJECT PROPERTIES ==============================================-->

<properties>

<!-- .. Libraries ..................................................... -->
<antlr.version>4.3</antlr.version>
<guava.version>18.0</guava.version>
<jsr305.version>3.0.0</jsr305.version>
<junit.version>4.11</junit.version>
<logback.version>1.1.2</logback.version>
<monticore.version>4.1.4</monticore.version>
<se-commons.version>1.7.0</se-commons.version>

<!-- .. Plugins ....................................................... -->
<compiler.plugin>3.2</compiler.plugin>
<monticore.plugin>4.1.1</monticore.plugin>

<!-- Classifiers -->
<grammars.classifier>grammars</grammars.classifier>

<!-- .. Misc .......................................................... -->
<java.version>1.8</java.version>

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

<!-- == PROJECT DEPENDENCIES =============================================->

<dependencies>
 <dependency>
  <groupId>de.se_rwth.commons</groupId>
  <artifactId>se-commons-logging</artifactId>
  <version>${se-commons.version}</version>
</dependency>

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>${guava.version}</version>
</dependency>

<dependency>
  <groupId>com.google.code.findbugs</groupId>
  <artifactId>jsr305</artifactId>
  <version>${jsr305.version}</version>
</dependency>

<dependency>
  <groupId>org.antlr</groupId>
  <artifactId>antlr4-annotations</artifactId>
  <version>${antlr.version}</version>
</dependency>

<dependency>
  <groupId>org.antlr</groupId>
  <artifactId>antlr4-runtime</artifactId>
  <version>${antlr.version}</version>
</dependency>

<!-- MontiCore Dependencies -->
<dependency>
  <groupId>de.monticore</groupId>
  <artifactId>monticore-runtime</artifactId>
  <version>${monticore.version}</version>
</dependency>

<dependency>
  <groupId>de.monticore</groupId>
  <artifactId>monticore-grammar</artifactId>
  <version>${monticore.version}</version>
</dependency>

<dependency>
  <groupId>de.monticore</groupId>
  <artifactId>monticore-grammar</artifactId>
  <version>${monticore.version}</version>
  <classifier>${grammars.classifier}</classifier>
  <scope>provided</scope>
</dependency>

<!-- .. Test Libraries ............................................... -->
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>${junit.version}</version>
  <scope>test</scope>
</dependency>

<dependency>
  <groupId>de.monticore</groupId>
  <artifactId>monticore-runtime</artifactId>
  <version>${monticore.version}</version>
  <type>test-jar</type>
  <scope>test</scope>
</dependency>

 <dependency>
   <groupId>ch.qos.logback</groupId>
   <artifactId>logback-classic</artifactId>
   <version>${logback.version}</version>
 </dependency>
</dependencies>

<!-- == PROJECT BUILD SETTINGS ===========================================->

<build>
<plugins>
  <!-- MontiCore Generation -->
  <plugin>
    <groupId>de.monticore.mojo</groupId>
    <artifactId>monticore-maven-plugin</artifactId>
    <version>${monticore.plugin}</version>
    <executions>
      <execution>
        <goals>
          <goal>generate</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

  <!-- Other Configuration -->
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${compiler.plugin}</version>
    <configuration>
      <source>${java.version}</source>
      <target>${java.version}</target>
    </configuration>
   </plugin>
  </plugins>
 </build>

 <!-- == DEPENDENCY & PLUGIN REPOSITORIES ===============================-->

<repositories>
  <repository>
   <id>se-public</id>
  <url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
 </repository>
</repositories>
<pluginRepositories>
<pluginRepository>
  <id>se-public</id>
  <url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
 </pluginRepository>
</pluginRepositories>

</project>

如何解决我的问题?

最好的问候,

0 个答案:

没有答案