Version Information
Maven 3.0.4Eclipse Indigo
The Error
The following error was produced by the Maven compile goal:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project blah: Compilation failure: Compilation failure:
[ERROR] Blah.java:[6,17] error: package javax.jnlp does not exist
The Solution
The problem was caused by the scope I had defined for the jnlp-api dependency in a child module in a multi-module Maven project. In the parent module inside the distributionManagement tag in the pom.xml, I defined the scope as "provided". The problem occurred when I accidentally defined the scope for that dependency in the child's pom.xml as "runtime". The fix was of course to make the scopes match in both pom.xml files.I could have saved a lot more time debugging this, if Maven would have produced a more specific error message. Oh well.
1 comment:
Hi,
Similar issue, Eclipse compiles but maven m2 plugin (clean package) fails.
[ERROR] SomeClass.java:[41,50] error: incompatible types: Long cannot be converted to Float
The type mismatch indeed existed but Eclipse showed the projects as correctly compiled.
Any idea why both compile tasks behave differently?
Best
Luis
Post a Comment