Reputation: 141
Background:
CommonClassA.java
.Billtype.java
) in other module (EmployeeBilling) refers this class(CommonClassA.java
). Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
Tools:
Thanks in advance!
Upvotes: 14
Views: 35655
Reputation: 655
here is how I solved it (might be useful to others if in same case)
check the first build error, it says a jar file which is dependent has zero byte (file size is 0). That happens previously downloading that jar file was stopped in the middle.
Just delete that jar file's whole folder in your maven local repositary and then build again. Jar file will be auto download again.
Then build will be success.
Upvotes: 0
Reputation: 11431
It looks like you are using an old version of maven-compiler-plugin
(v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.
Upvotes: 0
Reputation: 487
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
Upvotes: 1
Reputation: 1038
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Good luck :)
Upvotes: 4
Reputation: 7940
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
If these steps don't work then show us your pom.
Upvotes: 4