I'm developing an JavaFX e4 application. So far I followed the tutorials and I also got the example application up an running. I created a new project and included my code / views etc and the application works fine when started from eclipse. Now I want to export this app via maven, this is where I'm stuck.
I also need some external libraries, which are available as eclipse java projects. Some of these projects include Java code (like a selfwritten commons-lib) and others just include some jar files. Eclipse allows me include these projects via the feature.xml
(just by clicking 'add').
So far everything works fine, when I start the app via the 'product' file and eclipse manages to resolve all dependencies and start my JavaFX e4 application without any errors.
When I try to build the application via maven from the terminal I get the following error:
[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
The missing dependency is an eclipse Java project which includes some jars and some Java src files. Like I already said, eclipse manages to resolve the dependency and shows my GUI, maven is not able to resolve the dependency. I have no idea where the problem lies. First I thought of changeing the commons project to maven project with a proper configured pom.xml
but without any success.
After all these years I found a solution for the problem. It was an malformed manifest, which has been created by maven (due to default values). See here for the solution Maven: prefers manifest dependencies over pom.xml dependencies