Maven Resources Plugin
  1. Maven Resources Plugin
  2. MRESOURCES-152

The dependency of JUnit 3.8.1 may override the depended JUnit version of the project

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      As the following pages state:

      http://maven.apache.org/plugins/maven-resources-plugin/dependencies.html

      The maven resources plugin itself depends on the JUnit 3.8.1, and any project using this plugin will be introduced a transitive dependency of JUnit 3.8.1. This will cause the projects which use JUnit 4.x in their unit test fail to pass the compilation under the command line (i.e., via "mvn install"), but they could be compiled under eclipse.

      I can't understand why this plugin has to introduce the dependency of Junit. Is it really necessary? If it is, could you please upgrade the JUnit to version 4 or above? Since JUnit 4.x provides a lot of assertArrayEquals(...) functions, which are really widely used.

      Thank you in advance.

        Activity

        Hide
        Haixing Hu added a comment - - edited

        By the way, I set the priority to "blocker" because many of my project depends on JUnit 4 in theire unit tests. And also many of them depends on maven-resources-plugin. I have to implement a lot of assertArrayEquals(...) functions by myself to make them compiled

        Show
        Haixing Hu added a comment - - edited By the way, I set the priority to "blocker" because many of my project depends on JUnit 4 in theire unit tests. And also many of them depends on maven-resources-plugin. I have to implement a lot of assertArrayEquals(...) functions by myself to make them compiled
        Hide
        Haixing Hu added a comment -

        Ok, I found that the problem seems caused by the following component:

        org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1

        Here is the dependency tree of the maven-resources-plugin:

        [INFO]
        [INFO] — maven-dependency-plugin:2.1:tree (default-cli) @ maven-resources-plugin —
        [INFO] org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.3
        [INFO] +- org.apache.maven:maven-plugin-api:jar:2.0.6:compile
        [INFO] +- org.apache.maven:maven-project:jar:2.0.6:compile
        [INFO] | +- org.apache.maven:maven-profile:jar:2.0.6:compile
        [INFO] | +- org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
        [INFO] | - org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
        [INFO] +- org.apache.maven:maven-core:jar:2.0.6:compile
        [INFO] | +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-2:runtime
        [INFO] | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6:compile
        [INFO] | +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2:runtime
        [INFO] | | +- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-2:runtime
        [INFO] | | | - jtidy:jtidy:jar:4aug2000r7-dev:runtime
        [INFO] | | - xml-apis:xml-apis:jar:1.0.b2:runtime
        [INFO] | +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile
        [INFO] | | - org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile
        [INFO] | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
        [INFO] | +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
        [INFO] | +- org.apache.maven:maven-error-diagnostics:jar:2.0.6:compile
        [INFO] | +- commons-cli:commons-cli:jar:1.0:compile
        [INFO] | +- org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-2:runtime
        [INFO] | | - org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-2:runtime
        [INFO] | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.6:compile
        [INFO] | +- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
        [INFO] | +- org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-2:runtime
        [INFO] | | - com.jcraft:jsch:jar:0.1.27:runtime
        [INFO] | - classworlds:classworlds:jar:1.1:compile
        [INFO] +- org.apache.maven:maven-artifact:jar:2.0.6:compile
        [INFO] +- org.apache.maven:maven-settings:jar:2.0.6:compile
        [INFO] +- org.apache.maven:maven-model:jar:2.0.6:compile
        [INFO] +- org.apache.maven:maven-monitor:jar:2.0.6:compile
        [INFO] +- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
        [INFO] | - junit:junit:jar:3.8.1:compile
        [INFO] +- org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
        [INFO] +- org.apache.maven.shared:maven-filtering:jar:1.0-beta-4:compile
        [INFO] | - org.sonatype.plexus:plexus-build-api:jar:0.0.4:compile
        [INFO] +- org.codehaus.plexus:plexus-interpolation:jar:1.13:compile
        [INFO] - org.apache.maven.shared:maven-plugin-testing-harness:jar:1.0-beta-1:test

        Show
        Haixing Hu added a comment - Ok, I found that the problem seems caused by the following component: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 Here is the dependency tree of the maven-resources-plugin: [INFO] [INFO] — maven-dependency-plugin:2.1:tree (default-cli) @ maven-resources-plugin — [INFO] org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.3 [INFO] +- org.apache.maven:maven-plugin-api:jar:2.0.6:compile [INFO] +- org.apache.maven:maven-project:jar:2.0.6:compile [INFO] | +- org.apache.maven:maven-profile:jar:2.0.6:compile [INFO] | +- org.apache.maven:maven-artifact-manager:jar:2.0.6:compile [INFO] | - org.apache.maven:maven-plugin-registry:jar:2.0.6:compile [INFO] +- org.apache.maven:maven-core:jar:2.0.6:compile [INFO] | +- org.apache.maven.wagon:wagon- file:jar:1.0-beta-2:runtime [INFO] | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6:compile [INFO] | +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2:runtime [INFO] | | +- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-2:runtime [INFO] | | | - jtidy:jtidy:jar:4aug2000r7-dev:runtime [INFO] | | - xml-apis:xml-apis:jar:1.0.b2:runtime [INFO] | +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.6:compile [INFO] | | - org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7:compile [INFO] | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile [INFO] | +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile [INFO] | +- org.apache.maven:maven-error-diagnostics:jar:2.0.6:compile [INFO] | +- commons-cli:commons-cli:jar:1.0:compile [INFO] | +- org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-2:runtime [INFO] | | - org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-2:runtime [INFO] | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.6:compile [INFO] | +- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile [INFO] | +- org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-2:runtime [INFO] | | - com.jcraft:jsch:jar:0.1.27:runtime [INFO] | - classworlds:classworlds:jar:1.1:compile [INFO] +- org.apache.maven:maven-artifact:jar:2.0.6:compile [INFO] +- org.apache.maven:maven-settings:jar:2.0.6:compile [INFO] +- org.apache.maven:maven-model:jar:2.0.6:compile [INFO] +- org.apache.maven:maven-monitor:jar:2.0.6:compile [INFO] +- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile [INFO] | - junit:junit:jar:3.8.1:compile [INFO] +- org.codehaus.plexus:plexus-utils:jar:2.0.5:compile [INFO] +- org.apache.maven.shared:maven-filtering:jar:1.0-beta-4:compile [INFO] | - org.sonatype.plexus:plexus-build-api:jar:0.0.4:compile [INFO] +- org.codehaus.plexus:plexus-interpolation:jar:1.13:compile [INFO] - org.apache.maven.shared:maven-plugin-testing-harness:jar:1.0-beta-1:test
        Hide
        Haixing Hu added a comment - - edited

        It seems related to this issue

        http://jira.codehaus.org/browse/PLX-460

        It's said that the bug has been fixed in version 1.5.6, but the maven-resources-plugin still depends on 1.0-alpha-9-stable-1

        Show
        Haixing Hu added a comment - - edited It seems related to this issue http://jira.codehaus.org/browse/PLX-460 It's said that the bug has been fixed in version 1.5.6, but the maven-resources-plugin still depends on 1.0-alpha-9-stable-1
        Hide
        Dennis Lundberg added a comment -

        Pretty much all of Maven depends on plexus-container-default 1.0-alpha-9-stable-1, so this problem isn't going to go away any time soon.

        Your JUnit 4 dependency should should win over the 3.8.1 version. What does 'mvn dependency:tree' show for your project?

        Show
        Dennis Lundberg added a comment - Pretty much all of Maven depends on plexus-container-default 1.0-alpha-9-stable-1, so this problem isn't going to go away any time soon. Your JUnit 4 dependency should should win over the 3.8.1 version. What does 'mvn dependency:tree' show for your project?
        Hide
        Haixing Hu added a comment -

        Oh my god!
        It's so strange. I just recompiled the porject again and was surprised to found that the porject passed the compilation! But I swear it was not got compiled yeasterday.

        I remember that the only thing I have done is to remove all my "~/.m2" directory and force the maven to downloads all dependency again.

        Maybe some conflicts of dependency caused that problem.

        Anyway, the good news is that my project got compiled, and the bad news is that the protential bug may still exist and I can't reproduce it.

        So I close this issue.

        Show
        Haixing Hu added a comment - Oh my god! It's so strange. I just recompiled the porject again and was surprised to found that the porject passed the compilation! But I swear it was not got compiled yeasterday. I remember that the only thing I have done is to remove all my "~/.m2" directory and force the maven to downloads all dependency again. Maybe some conflicts of dependency caused that problem. Anyway, the good news is that my project got compiled, and the bad news is that the protential bug may still exist and I can't reproduce it. So I close this issue.
        Hide
        Haixing Hu added a comment -

        Just remove the directory "~/.m2", the bug dispeared.

        Show
        Haixing Hu added a comment - Just remove the directory "~/.m2", the bug dispeared.

          People

          • Assignee:
            Unassigned
            Reporter:
            Haixing Hu
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: