JavaFX + java 7和Maven-2.2.1下载错误

时间:2012-12-21 08:06:39

标签: java maven javafx

我正在使用Apache Maven-2.2.1构建我的项目。

之前我运行maven步骤,成功下载maven存储库。然后我使用jdk1.6.0_10,我的JAVA_HOME环境变量有相同的jdk1.6.0_10条目。

现在我已经将我的Java版本从6更新到7,使用jdk1.7.0_09在JavaFX中构建应用程序,所以我将JAVAFX_HOME设置为jdk1.7.0_09,但JAVA_HOME仍然指向jdk1.6.0_10。这次maven正在成功下载,让我在构建时出现以下错误 -

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version': Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
org.apache.maven.shared.osgi.Maven2OsgiConverter
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version': Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:698)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginManagerException: Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:679)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
    at java.lang.Class.getDeclaredField(Class.java:1880)
    at hidden.org.codehaus.plexus.util.ReflectionUtils.getFieldByNameIncludingSuperclasses(ReflectionUtils.java:47)
    at org.codehaus.plexus.component.composition.FieldComponentComposer.getFieldByName(FieldComponentComposer.java:212)
    at org.codehaus.plexus.component.composition.FieldComponentComposer.findMatchingField(FieldComponentComposer.java:171)
    at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:62)
    at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
    at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
    at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
    at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
    at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
    at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
    at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
    at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:652)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.osgi.Maven2OsgiConverter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
    at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 36 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29 minutes 36 seconds
[INFO] Finished at: Fri Dec 21 13:07:49 IST 2012
[INFO] Final Memory: 13M/23M
[INFO] ------------------------------------------------------------------------

这是Java的问题,还是在Maven-2.2.1版本中进行了任何更改。我下载了这个版本的maven并与旧版本进行了比较,但没有找到任何更改。任何人都可以解决这个问题吗?

我试图用JAVA_HOME下载Maven-3.0.3(也尝试了Maven-2.2.1,但是得到了相同的错误)到jdk1.7.0_09,我已经澄清了JAVAFX_HOME的用法,它不用于maven下载。我仍然遇到同样的问题,下载Maven-3.0.3的例外是 -

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version': Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
org.apache.maven.shared.osgi.Maven2OsgiConverter
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version': Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:698)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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:601)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginManagerException: Unable to load the mojo 'com.sun.enterprise:osgiversion-maven-plugin:0.4.11:compute-osgi-version' in the plugin 'com.sun.enterprise:osgiversion-maven-plugin'. A required class is missing: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:679)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/maven/shared/osgi/Maven2OsgiConverter;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
    at java.lang.Class.getDeclaredField(Class.java:1897)
    at hidden.org.codehaus.plexus.util.ReflectionUtils.getFieldByNameIncludingSuperclasses(ReflectionUtils.java:47)
    at org.codehaus.plexus.component.composition.FieldComponentComposer.getFieldByName(FieldComponentComposer.java:212)
    at org.codehaus.plexus.component.composition.FieldComponentComposer.findMatchingField(FieldComponentComposer.java:171)
    at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:62)
    at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
    at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
    at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
    at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
    at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
    at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
    at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
    at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:652)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.osgi.Maven2OsgiConverter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
    at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 36 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19 minutes 30 seconds
[INFO] Finished at: Fri Dec 21 19:13:39 IST 2012
[INFO] Final Memory: 15M/63M
[INFO] ------------------------------------------------------------------------ 

如何解决这些错误?

谢谢!

0 个答案:

没有答案