You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Martin Vysny (JIRA)" <ji...@codehaus.org> on 2007/01/04 11:24:10 UTC

[jira] Created: (SUREFIRE-61) Incorrect classpath ordering

Incorrect classpath ordering
----------------------------

                 Key: SUREFIRE-61
                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
             Project: surefire
          Issue Type: Bug
          Components: JUnit 3.x support
    Affects Versions: 2.0
         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
            Reporter: Martin Vysny
            Priority: Critical
         Attachments: my-app.zip

Surefire incorrectly interprets classpath ordering.
Steps to reproduce:

1. unzip my-app.zip - it's a simple mvn project created with
   mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
   and lightly patched

2. mvn test
   in my case, it prints out
jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
   which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed SUREFIRE-61.
--------------------------------

      Assignee: Brett Porter
    Resolution: Fixed

applied, thanks

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Assignee: Brett Porter
>            Priority: Critical
>             Fix For: 2.3.1
>
>         Attachments: my-app.zip, output.log, SUREFIRE61-surefire-booter-r558713.patch, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Barrett Snyder (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=comments#action_84148 ] 
            
Barrett Snyder commented on SUREFIRE-61:
----------------------------------------

After a bit more research and testing I was able to create a patch for the surefire-booter revision 489098. Patch is attached.

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>         Attachments: my-app.zip, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce:
> 1. unzip my-app.zip - it's a simple mvn project created with
>    mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
>    and lightly patched
> 2. mvn test
>    in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
>    which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated SUREFIRE-61:
---------------------------------

    Fix Version/s: 2.4

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce:
> 1. unzip my-app.zip - it's a simple mvn project created with
>    mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
>    and lightly patched
> 2. mvn test
>    in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
>    which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated SUREFIRE-61:
---------------------------------

      Fix Version/s:     (was: 2.4)
                     2.3.1
    Patch Submitted: [Yes]

will review patch for 2.3.1

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.3.1
>
>         Attachments: my-app.zip, output.log, SUREFIRE61-surefire-booter-r558713.patch, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Kenney Westerhof (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenney Westerhof updated SUREFIRE-61:
-------------------------------------

          Description: 
Surefire incorrectly interprets classpath ordering.
Steps to reproduce: 
1. unzip my-app.zip - it's a simple mvn project created with
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
and lightly patched 
2. mvn test
in my case, it prints out
jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

  was:
Surefire incorrectly interprets classpath ordering.
Steps to reproduce:

1. unzip my-app.zip - it's a simple mvn project created with
   mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
   and lightly patched

2. mvn test
   in my case, it prints out
jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
   which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

    Testcase included:   (was: yes)
           Complexity:   (was: Intermediate)

Cannot reproduce with surefire 2.4-snapshot from trunk. The classpath seems ok:
- first target/test-classes
- then target/classes
- then dependencies

It prints out the path to the target/test-classes/log4j.properties.

There's no 'sort' anywhere in the surefire sources.

Can you please check this again with the latest surefire snapshots to see if it's solved?

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Matt Read (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Read updated SUREFIRE-61:
------------------------------

    Attachment: output.log

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Gier updated SUREFIRE-61:
------------------------------

    Attachment: SUREFIRE61-surefire-booter-r558713.patch

Attaching a slightly cleaned up patch.

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61-surefire-booter-r558713.patch, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Matt Read (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102758 ] 

Matt Read commented on SUREFIRE-61:
-----------------------------------

This is causing me some major problems now. Can anyone comment in any way on why I'm getting an ordering of target/classes before target/test-classes in the example above?

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Matt Read (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98614 ] 

Matt Read commented on SUREFIRE-61:
-----------------------------------

2.4-SNAPSHOT gives me the opposite result, i.e. target/class first, then target/test-classes, then dependencies. As does 2.3.

I have attached output of the following commands:

mvn archetype:create -DgroupId=test -DartifactId=classpath_test -DarchetypeArtifactId=maven-archetype-quickstart
cd classpath_test
mvn -X test > output.log

Note this bit:

[DEBUG] Test Classpath :
[DEBUG]   C:\TEMP\a_directory_of_my_choosing\classpath_test\target\classes
[DEBUG]   C:\TEMP\a_directory_of_my_choosing\classpath_test\target\test-classes
[DEBUG]   C:\data\sandbox\maven2\repo\junit\junit\3.8.1\junit-3.8.1.jar



> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Asgeir S. Nilsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_88259 ] 

Asgeir S. Nilsen commented on SUREFIRE-61:
------------------------------------------

Any hope on getting this fixed and released on the maven-surefire-plugin 2.2 branch?

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>         Attachments: my-app.zip, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce:
> 1. unzip my-app.zip - it's a simple mvn project created with
>    mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
>    and lightly patched
> 2. mvn test
>    in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
>    which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102980 ] 

Paul Gier commented on SUREFIRE-61:
-----------------------------------

The issue can be seen mainly when the fork mode is set to never.  Because if the surefire plugin forks, then the ordering gets rearranged similar to what Barrett described.  However, I think this is caused by loading the paths into the properties object and then using an enumeration to iterate through them.  The Properties object doesn't retain the order of the loaded props, so they really could come out in any order, not just the sorted order that is shown above.

So I think that Barrett's approach is the right one.  The classpath elements really need to be sorted after they are loaded from properties file.  Hopefully someone will apply his patch or something similar to it soon :)

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Matt Read (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102928 ] 

Matt Read commented on SUREFIRE-61:
-----------------------------------

I've checked out the surefire code and SurefirePlugin.java - line 649 says:

// no need to add classes/test classes directory here - they are in the classpath elements already

I'm having major problems digging out exactly what is putting these directories on the classpath in the first place - it doesn't seem to be the responsibility of the SureFire plugin but perhaps passed in from Plexus? Can anyone point me in the right direction?

This issue is blocking a major release for me and I'm looking for as much help as possible. i'll certainly supply the patch if I get to the bottom of this!



> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Barrett Snyder (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-61?page=all ]

Barrett Snyder updated SUREFIRE-61:
-----------------------------------

    Attachment: SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch

Applies to revision 489098.

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>         Attachments: my-app.zip, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce:
> 1. unzip my-app.zip - it's a simple mvn project created with
>    mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
>    and lightly patched
> 2. mvn test
>    in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
>    which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Matt Read (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102758 ] 

Matt Read edited comment on SUREFIRE-61 at 7/20/07 5:15 AM:
------------------------------------------------------------

This is causing me some major problems now. Can anyone comment in any way on why I'm getting an ordering of target/classes before target/test-classes in the example above? I have to go back to 2.1.3 to find a version that puts target/test-classes in front of target/classes.


 was:
This is causing me some major problems now. Can anyone comment in any way on why I'm getting an ordering of target/classes before target/test-classes in the example above?

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: my-app.zip, output.log, SUREFIRE61_barrettas_surefire_surefire-booter_for_rev_489098.patch
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce: 
> 1. unzip my-app.zip - it's a simple mvn project created with
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> and lightly patched 
> 2. mvn test
> in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-61) Incorrect classpath ordering

Posted by "Barrett Snyder (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-61?page=comments#action_84144 ] 
            
Barrett Snyder commented on SUREFIRE-61:
----------------------------------------

This seems to be due to adding classpath entries into the surefire properties file in the form of "classpath.[number]" and then these are getting sorted with a string sort. Therefore 29 classpath entries would be sorted as:
classPathUrl.9
classPathUrl.8
classPathUrl.7
classPathUrl.6
classPathUrl.5
classPathUrl.4
classPathUrl.3
classPathUrl.2
classPathUrl.1
classPathUrl.0
classPathUrl.29
classPathUrl.28
classPathUrl.27
classPathUrl.26
classPathUrl.25
classPathUrl.24
classPathUrl.23
classPathUrl.22
classPathUrl.21
classPathUrl.20
classPathUrl.19
classPathUrl.18
classPathUrl.17
classPathUrl.16
classPathUrl.15
classPathUrl.14
classPathUrl.13
classPathUrl.12
classPathUrl.11
classPathUrl.10

This then gets read back in via the SurefireBooter.main method (only if execution was forked) and never re-sorted by number to correct the order, thus causing the classpath to get loaded in the incorrect order.

> Incorrect classpath ordering
> ----------------------------
>
>                 Key: SUREFIRE-61
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-61
>             Project: surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.0
>         Environment: maven2.0.4, sun-jdk-1.5.0.09, maven-surefire-plugin 2.2, surefire 2.0, gentoo linux x86
>            Reporter: Martin Vysny
>            Priority: Critical
>         Attachments: my-app.zip
>
>
> Surefire incorrectly interprets classpath ordering.
> Steps to reproduce:
> 1. unzip my-app.zip - it's a simple mvn project created with
>    mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
>    and lightly patched
> 2. mvn test
>    in my case, it prints out
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
> jar:file:/home/vyzivus/.m2/repository/jxta/jxta/2.0/jxta-2.0.jar!/log4j.properties
>    which is incorrect. log4j.properties is located both in jxta.jar and src/test/resources, but I think that src/test/resources takes precedence over jxta. This ordering is set correctly in surefire36745tmp file I think, but surefire seems to ignore the ordering.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira