Eclipse JavaFX e4应用程序产品构建失败

时间:2014-09-15 11:12:43

标签: java maven javafx eclipse-rcp e4

我正在开发一个JavaFX e4应用程序。到目前为止,我跟着tutorials,我也得到了一个运行示例应用程序。我创建了一个新项目并包含了我的代码/视图等,从eclipse启动时应用程序运行正常。现在我想通过maven导出这个应用程序,这就是我被困住的地方。

我还需要一些外部库,它们可以作为eclipse java项目使用。其中一些项目包括Java代码(如自编的commons-lib),其他项目只包含一些jar文件。 Eclipse允许我通过feature.xml包含这些项目(只需单击“添加”)。 到目前为止一切正常,当我通过'product'文件启动应用程序时,eclipse设法解决所有依赖关系并启动我的JavaFX e4应用程序而没有任何错误。

当我尝试从终端通过maven构建应用程序时,我收到以下错误:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: mygui.app 1.0.0
[ERROR]   Missing requirement: mygui.app 1.0.0 requires 'bundle my.commom.vecmath 0.0.0' but it could not be found
[ERROR] 
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from mygui.app 1.0.0 to bundle my.commom.vecmath 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from mygui.app 1.0.0 to bundle my.commom.vecmath 0.0.0.", "No solution found because the problem is unsatisfiable."]
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    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: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from mygui.app 1.0.0 to bundle my.commom.vecmath 0.0.0.", "No solution found because the problem is unsatisfiable."]
    at org.eclipse.tycho.p2.resolver.AbstractResolutionStrategy.newResolutionException(AbstractResolutionStrategy.java:98)
    at org.eclipse.tycho.p2.resolver.ProjectorResolutionStrategy.resolve(ProjectorResolutionStrategy.java:88)
    at org.eclipse.tycho.p2.resolver.AbstractResolutionStrategy.resolve(AbstractResolutionStrategy.java:63)
    at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:126)
    at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:81)
    at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.doResolvePlatform(P2TargetPlatformResolver.java:374)
    at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.resolveDependencies(P2TargetPlatformResolver.java:350)
    at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:109)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:82)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    ... 11 more
[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/InternalErrorException

缺少的依赖项是一个eclipse Java项目,它包含一些jar和一些Java src文件。就像我已经说过的那样,eclipse设法解决依赖关系并显示我的GUI,maven无法解决依赖关系。我不知道问题出在哪里。首先,我想到使用正确配置的pom.xml将公共项目更改为maven项目,但没有任何成功。

2 个答案:

答案 0 :(得分:0)

maven-tycho构建指向的p2存储库(默认情况下,它很可能只指向efxclipse)必须包含所需的工件。查看releng项目中的pom.xml!

我们还通过论坛https://www.eclipse.org/forums/index.php/f/259/

为e(fx)剪辑提供支持

答案 1 :(得分:0)

经过这么多年,我找到了解决问题的方法。这是一个格式错误的清单,由maven创建(由于默认值)。请参阅此处了解解决方案Maven: prefers manifest dependencies over pom.xml dependencies