Issue Details (XML | Word | Printable)

Key: MECLIPSE-548
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Joe Freeman
Votes: 15
Watchers: 10
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Eclipse Plugin

MECLIPSE-442 should be reverted. Classpath container entries should come before 3rd party jars in .classpath

Created: 07/Apr/09 10:57 AM   Updated: 26/Oct/09 05:08 AM
Return to search
Component/s: Core : Dependencies resolution and build path (.classpath)
Affects Version/s: 2.6
Fix Version/s: 2.8

Time Tracking:
Not Specified

Environment: all
Issue Links:
Related
 
dependent
 


 Description  « Hide

A patch was accepted into maven 2.6 as part of jira MECLIPSE-442 that configures eclipse to compile with a different order than the jre will load with. This patch moved the container classpaths to the end of the classpath in eclipse. This behavior is incorrect. The JRE's jar files should come before any 3rd party libraries on the classpath because those classes will be loaded before any of the 3rd party jars and because the JRE's classes cannot be overridden by classes in a 3rd party jar.

I understand why MECLIPSE-442 wanted to reverse the order so they could pick up the properties files. The best way to do this was to create properties files in the indvidual projects if he needed at run time or in the test/resources directory if it was only needed for unit testing. project resources come before everything in eclipse

With this patch added to maven 2.6, we have a situation where eclipse tells us we have compiler error when maven command line compilations do not.



Arnaud Heritier added a comment - 07/Apr/09 11:05 AM

A simple testcase to help us to see if this time we don't do another error could be a good thing...
thx.


Ben Caradoc-Davies added a comment - 14/Apr/09 01:10 AM - edited

I second the rating of this bug as critical. This bug breaks Eclipse integration for GeoTools, because maven-eclipse-plugin does not honour exclusions of transitive dependencies, and GeoTools Eclipse integration relies on xml-apis provided by the JRE being compatible with xerces 2.7 and being earlier on the classpath. Yes, this sucks, but it works.

To reproduce with Maven 2.0.10 (use a Java 5 JDK):

(1) svn co -r32785 http://svn.osgeo.org/geotools/trunk geotools-trunk

(2) cd geotools-trunk

(3) mvn -Dmaven.test.skip install eclipse:eclipse

(4) import into Eclipse, and see modules fail to compile


Ben Caradoc-Davies added a comment - 14/Apr/09 01:59 AM

Workaround for this bug is to pin your project to version 2.5:

<build>
    <pluginManagement>
      <plugins>
        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-eclipse-plugin</artifactId>
           <version>2.5</version>
 ...

Ben Caradoc-Davies added a comment - 14/Apr/09 02:01 AM

Robert Newson added a comment - 14/Apr/09 08:56 AM

this also broke my project. I have a dependency on mx4j (it's transitive and shouldn't appear on here, but that's a different bug).

It took a few frustrating hours to track down why I could not compile in Eclipse but could in Maven. Please revert this change. I have pinned to 2.5.1 for now.


Arnaud Heritier added a comment - 14/Apr/09 09:10 AM

Do not hesitate to vote for the issue. I always try to check them (http://www.sonatype.org/~j2ee-hudson/reports/plugin-votes.html#Maven%202.x%20Eclipse%20Plugin). For this issue, isn't there a different case for a jre container (which should be at the beginning) and others containers (which should be at the end to be able to override them MECLIPSE-442)


Rustam Abdullaev added a comment - 21/May/09 03:41 AM

I would suggest to make this configurable. Most application servers can be configured to place their classes before or after application classes. But I agree that JRE classes must come first in any case.


Joe Freeman added a comment - 15/Jun/09 12:24 PM

How many votes does this have to have before it makes a release. Version 2.7 just came out and it still has the same incorrect classpath ordering for the JDK/JRE


Ben Caradoc-Davies added a comment - 15/Jun/09 09:12 PM

I suspect that we need to get this assigned to someone. I will email the project lead.

GeoTools is still pinned to 2.5, and so it will remain until this bug is fixed.


Barrie Treloar made changes - 16/Jun/09 01:20 AM
Field Original Value New Value
Fix Version/s 2.8 [ 14813 ]
Ben Caradoc-Davies added a comment - 16/Jun/09 01:41 AM

Thanks, Barrie.


Paul Benedict made changes - 06/Jul/09 11:46 AM
Link This issue relates to MECLIPSE-581 [ MECLIPSE-581 ]
Aziz Joumady made changes - 26/Oct/09 05:08 AM
Link This issue is depended upon by MECLIPSE-605 [ MECLIPSE-605 ]