Today I ran into a perplexing Eclipse/Maven issue where my Maven project would compile just fine according to Eclipse, but the Maven compile goal would fail. If you are reading this you probably had the same issue and this might help.
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.
Read more...
