rustock rustock - 1 year ago 405
Java Question

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin

I'm trying compile using

mvn install
but I'm getting this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project test: Compilation failure: Compilation failure:

pom.xml file:

<project xmlns="" xmlns:xsi=""






How to fix it?

Answer Source

Your issue is most likely the <scope> of the dependency. When inside of the IDE, all scopes are added to the build path of the project. However, when running mvn only the appropriate scopes are added to the classpath for the javac command. For example, if you had a class in /src/main/java that imported a class from one of your dependencies scoped to <scope>test</scope>, the IDE would be able to build the project, but mvn would fail in the manner you are experiencing.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download