preslavrachev / maven-play-plugin

Automatically exported from code.google.com/p/maven-play-plugin
0 stars 0 forks source link

commons-codec conflict causes build errors in eclipse #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a (non play) project with a dependency on commons-codec-1.3
2. Create a play project with a dependency on the previous project. 
3. In some controller, use Base64.decodeBase64("asdasd")
4. Add exclusion on commons-codec for the dependency in the play project

What is the expected output? What do you see instead?

I would expect this to compile properly, because the commons-codec-14 appears 
in my maven dependencies when the exclusion is in place. 

This is actually a toy example. In the real example, there is another 
dependency in between which seems to only output commons-codec-14, and that 
also fails.

So, exclusion or no exclusion, it appears that the maven builder is picking up 
the commons-codec-13 jar which does not contain the desired method. This 
concerns me, because--if this is a general thing--it's possible other incorrect 
jar versions are being pick up elsewhere, but they just luckily have the proper 
method signatures, so there are no complaints.

What version of the product are you using? On what operating system?
Beta7, m2e, eclipse

Please provide any additional information below.
Interestingly, I don't seem to get any complaints if I execute 

mvn play:clean play:precompile play:war-inplace

the problems seems to only occur within the Eclipse builder. 

Original issue reported on code.google.com by phil...@phillipwright.info on 23 Apr 2014 at 5:01

GoogleCodeExporter commented 9 years ago
I cannot reproduce your problem. Attached example project prepared based on 
your description, but it works for me on M2E 1.4 (Scala-IDE 3.0.2).

Can you create a project which does not work?
What is your M2Eclipse configuration: version, any M2E extensions?

Original comment by gslowiko...@gmail.com on 23 Apr 2014 at 7:58

Attachments:

GoogleCodeExporter commented 9 years ago
Here are some pom files that seem to reproduce the issue for me

Original comment by phil...@phillipwright.info on 23 Apr 2014 at 2:17

Attachments:

GoogleCodeExporter commented 9 years ago
I am using Eclipse 3.7.0, m2e 0.12.1.20110112-1712, no m2e extensions that I am 
aware of.

Maybe it's the old version of m2e. I'll see if I can reproduce this in another 
Eclipse with a more recent m2e.

Original comment by phil...@phillipwright.info on 23 Apr 2014 at 2:19

GoogleCodeExporter commented 9 years ago
I can also reproduce this using the pom files above in Eclipse Kepler with m2e 
1.4

Original comment by phil...@phillipwright.info on 23 Apr 2014 at 2:43

GoogleCodeExporter commented 9 years ago
Sorry, that was without the exclusion. The exclusion does seem to work in this 
environment. Should the exclusion be necessary, though? 

Original comment by phil...@phillipwright.info on 23 Apr 2014 at 2:50

GoogleCodeExporter commented 9 years ago
Let me do some more testing. I think if you use the play default parent for 
both, then it works fine, but if the parent of the project introducing the 
codec has a different parent, things seem to get messy (but I haven't yet 
distilled it to a nice reproducible case). Our base adds a repository and some 
other things, but none of them should be causing this problem, I don't think.

Original comment by phil...@phillipwright.info on 23 Apr 2014 at 3:31

GoogleCodeExporter commented 9 years ago
This exclusion should be there, provided commons-codec 1.4 is backward 
compatible with 1.3, and I think it is.

You used very old M2E version. I've recently had similar (even more strange) 
problem with it - see http://dev.eclipse.org/mhonarc/lists/m2e-dev/msg01543.html

There are problems with isolation of your project's libraries from M2E 
internals. Maybe you found one of such problems, fortunately already resolved.

Original comment by gslowiko...@gmail.com on 24 Apr 2014 at 9:26

GoogleCodeExporter commented 9 years ago
Side note.

I don't like using a parent from outside of the reactor in multi-module 
projects too.
This reduces the content of your play module significantly, but prevents from 
inheriting settings from multi-module parent.

Alternatively you can copy all the content from "play-app-default-parent" to 
your project. If you have no Selenium tests, you can remove Selenium and 
Failsafe plugins configurations and "play-selenium-junit4" dependency. If you 
have no unit tests you can remove Surefire configuration. You can remove 
"docviewer" and "testrunner" modules dependencies too, if you don't need them.
This will simplify pom.xml file.

Original comment by gslowiko...@gmail.com on 24 Apr 2014 at 9:36

GoogleCodeExporter commented 9 years ago
Source of the problem and a solution found. The problem was on M2E side, 
upgrading helped.

Original comment by gslowiko...@gmail.com on 29 Apr 2014 at 11:50