【发布时间】:2014-09-15 11:12:42
【问题描述】:
我正在开发一个 JavaFX e4 应用程序。到目前为止,我关注了tutorials,并且还运行了示例应用程序。我创建了一个新项目并包含了我的代码/视图等,并且从 Eclipse 启动时应用程序运行良好。现在我想通过 maven 导出这个应用程序,这就是我卡住的地方。
我还需要一些外部库,它们可以作为 eclipse java 项目使用。其中一些项目包含 Java 代码(如自写的 commons-lib),而其他项目仅包含一些 jar 文件。 Eclipse 允许我通过feature.xml 包含这些项目(只需单击“添加”)。
到目前为止一切正常,当我通过“产品”文件启动应用程序时,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 项目,其中包括一些 jars 和一些 Java src 文件。就像我已经说过的,eclipse 设法解决依赖关系并显示我的 GUI,maven 无法解决依赖关系。我不知道问题出在哪里。首先,我想用正确配置的pom.xml 将 commons 项目更改为 maven 项目,但没有任何成功。
【问题讨论】:
标签: java maven javafx eclipse-rcp e4