Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate class with symlinks #50

Closed
davidB opened this issue May 20, 2011 · 1 comment
Closed

Duplicate class with symlinks #50

davidB opened this issue May 20, 2011 · 1 comment

Comments

@davidB
Copy link
Owner

davidB commented May 20, 2011

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

@xylo
Copy link

xylo commented Jul 31, 2011

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?

@davidB davidB closed this as completed in 0eff8a8 Aug 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants