I got this inherited project using Maven/m2e as the build automation tool. All nice & cool except that this project, checked out of SVN as is, is broken... meaning it fails to build, with several duplicate class errors:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project myproj: Compilation failure: Compilation failure:
[ERROR] \Users\Daniel\workspace\myproj\target\generated-sources\cxf\org\package1\services\ClassA.java:[36,7] duplicate class: org.package1.services.ClassA
Now, it's true that ClassA
exists in the build environment 3 times:
c:/Users/Daniel/workspace/myproj/src/main/java/org/package1/services/ClassA.java
c:/Users/Daniel/workspace/myproj/src/main/java/org/package1/www/services/ClassA.java
c:/Users/Daniel/workspace/myproj/target/generated-sources/cxf/org/package1/services/ClassA.java
But they belong to different packages:
- package org.package1.services;
- package org.package1.www.services;
So, why would the compiler complain about a duplicate class?
(Or is it Maven that's complaining?)
I am not familiar with the design considerations of the original author, so any idea how to resolve these duplicates would be much appreciated.