You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same problem with duplicated classes when I try to compile my projects in Jenkins. On my system the path to the Jenkins working directory contains symlinks. Moreover Jenkins itself uses several symlinks for managing the builds. Thus I'm not sure which symlinks cause this bug.
Anyway, since our automatic Jenkins builds were broken for months now, today I invested some hours today to fix this bug. I discovered that the maven-scala-plugin uses getCanonicalPath when collecting the files for compilation, I assume this is done for prevent maven from compiling the same file twice. Unfortunately, in this case getCanonicalPath has exactly the opposite effect: The paths of Java source files returned by the maven-scala-plugin differ from those returned by the standard maven Java compiler and as a result we get "duplicate class" errors.
I assume in order to fix this bug correctly one has to adapt the Java compiler plugin, but I don't even know how it is called.?
As a workaround (to get my projects compiled under Jenkins) I replaced all occurrences of getCanonicalPath by getAbsolutePath. And it works again! :-)
I wonder if getAbsolutePath is needed somewhere or somehow in the plugin or if it can be simply replaced by getAbsolutePath without any issues?
The appears to be a problem with the maven scala plugin, symlinks and
the processing of java classes in scala folders: https://gist.github.com/980328
Basically, when it comes to processing the java sources, due to the
symlinks it's thinking that there're two folders instead of one.
This can be resolved by making sure you execute maven from an absolute
position.
see : http://groups.google.com/group/maven-and-scala/t/5d543de46dac2d1b
The text was updated successfully, but these errors were encountered: