Pluto
  1. Pluto
  2. PLUTO-389

Pluto-Ant-Task can not be built because of missing junit dependency

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.3, 1.2.0
    • Fix Version/s: 1.1.4, 1.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Pluto-Ant-Task can not be built because of missing junit dependency:

      (it seems, that pluto-ant-task is using junit-3.7, because it was downloaded)

      pluto-1.1.3/pluto-ant-tasks $ mvn install -e
      + Error stacktraces are turned on.
      [INFO] Scanning for projects...
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building Pluto Ant Tasks
      [INFO] task-segment: [install]
      [INFO] ----------------------------------------------------------------------------
      Downloading: http://repo1.maven.org/maven2/castor/castor/1.0/castor-1.0.pom
      [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
      [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
      [INFO] Setting property: velocimacro.messages.on => 'false'.
      [INFO] Setting property: resource.loader => 'classpath'.
      [INFO] Setting property: resource.manager.logwhenfound => 'false'.
      [INFO] [pluto:process

      {execution: default}

      ]
      [INFO] [resources:resources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:compile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [resources:testResources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:testCompile]
      [INFO] No sources to compile
      [INFO] [surefire:test]
      [INFO] Setting reports dir: /home/chrisra/pluto/pluto-1.1.3/pluto-ant-tasks/target/surefire-reports
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error executing surefire

      tried to access method junit.framework.TestCase.<init>()V from class org.apache.maven.surefire.battery.assertion.BatteryAssert
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Error executing surefire
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing surefire
      at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:376)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
      ... 16 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:313)
      at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:221)
      at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:371)
      ... 18 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at org.apache.maven.surefire.SurefireUtils.instantiateBattery(SurefireUtils.java:54)
      at org.apache.maven.surefire.Surefire.instantiateBatteries(Surefire.java:262)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:93)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
      ... 25 more
      Caused by: java.lang.IllegalAccessError: tried to access method junit.framework.TestCase.<init>()V from class org.apache.maven.surefire.battery.assertion.BatteryA
      ssert
      at org.apache.maven.surefire.battery.assertion.BatteryAssert.<init>(BatteryAssert.java:22)
      at org.apache.maven.surefire.battery.AbstractBattery.<init>(AbstractBattery.java:31)
      at org.apache.maven.surefire.battery.DirectoryBattery.<init>(DirectoryBattery.java:39)
      ... 33 more
      [INFO] ------------------------------------------------------------------------
      INFO] Total time: 3 seconds
      [INFO] Finished at: Tue Jul 03 22:30:53 CEST 2007
      [INFO] Final Memory: 8M/15M
      [INFO] ------------------------------------------------------------------------

        Activity

        Hide
        Elliot Metsger added a comment -

        Nice, not a bug! Thanks Christian -

        Show
        Elliot Metsger added a comment - Nice, not a bug! Thanks Christian -
        Hide
        Christian Raschka added a comment -

        That's it. I had maven-surefire-plugin 2.1.3 installed. After an update it builds fine.

        Show
        Christian Raschka added a comment - That's it. I had maven-surefire-plugin 2.1.3 installed. After an update it builds fine.
        Hide
        Elliot Metsger added a comment -

        Christian,

        I can't reproduce this either with trunk or the 1.1.x branch. I've tried reproducing this bug with a clean (totally empty) maven repository.

        I'm guessing that this may be a bug in the Surefire plugin. Can you tell me which version you are running? I'm running version 2.3. You can update to the latest version by passing the '-U' argument to 'mvn'.

        esm:~/src/pluto/pluto-ant-tasks$ mvn help:describe -Dplugin=surefire
        [INFO] Scanning for projects...
        [INFO] Searching repository for plugin with prefix: 'help'.
        [INFO] ----------------------------------------------------------------------------
        [INFO] Building Pluto Ant Tasks
        [INFO] task-segment: [help:describe] (aggregator-style)
        [INFO] ----------------------------------------------------------------------------
        [INFO] [help:describe]
        [INFO] Plugin: 'org.apache.maven.plugins:maven-surefire-plugin:2.3'
        -----------------------------------------------
        Group Id: org.apache.maven.plugins
        Artifact Id: maven-surefire-plugin
        Version: 2.3
        Goal Prefix: surefire
        Description:

        Surefire is a test framework project.

        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESSFUL
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: < 1 second
        [INFO] Finished at: Sun Jul 08 18:11:06 EDT 2007
        [INFO] Final Memory: 3M/6M
        [INFO] ------------------------------------------------------------------------

        Show
        Elliot Metsger added a comment - Christian, I can't reproduce this either with trunk or the 1.1.x branch. I've tried reproducing this bug with a clean (totally empty) maven repository. I'm guessing that this may be a bug in the Surefire plugin. Can you tell me which version you are running? I'm running version 2.3. You can update to the latest version by passing the '-U' argument to 'mvn'. esm:~/src/pluto/pluto-ant-tasks$ mvn help:describe -Dplugin=surefire [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'help'. [INFO] ---------------------------------------------------------------------------- [INFO] Building Pluto Ant Tasks [INFO] task-segment: [help:describe] (aggregator-style) [INFO] ---------------------------------------------------------------------------- [INFO] [help:describe] [INFO] Plugin: 'org.apache.maven.plugins:maven-surefire-plugin:2.3' ----------------------------------------------- Group Id: org.apache.maven.plugins Artifact Id: maven-surefire-plugin Version: 2.3 Goal Prefix: surefire Description: Surefire is a test framework project. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Sun Jul 08 18:11:06 EDT 2007 [INFO] Final Memory: 3M/6M [INFO] ------------------------------------------------------------------------
        Hide
        Elliot Metsger added a comment -

        I haven't tried to verify the bug, but it should be fixed for 1.1.4 if it exists.

        Show
        Elliot Metsger added a comment - I haven't tried to verify the bug, but it should be fixed for 1.1.4 if it exists.
        Hide
        Christian Raschka added a comment -

        Strange. I've tried it with maven 2.0.4, 2.0.6 and 2.0.7 with no difference.

        If i delete all junit things in the maven repository, maven downloads junit-3.7 and junit-3.8.1. Don't know why:

        pluto-ant-tasks $ mvn install
        [INFO] Scanning for projects...
        [INFO] -------------------------------------------------------------------------

        [INFO] Building Pluto Ant Tasks
        [INFO] task-segment: [install]
        [INFO] -------------------------------------------------------------------------

        Downloading: http://repo1.maven.org/maven2/junit/junit/3.7/junit-3.7.pom
        745b downloaded
        Downloading: http://repo1.maven.org/maven2/junit/junit/3.7/junit-3.7.jar
        114K downloaded
        Downloading: http://repo1.maven.org/maven2/junit/junit/3.8.1/junit-3.8.1.pom
        998b downloaded
        [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus
        .velocity.ContextClassLoaderResourceLoader'.
        [INFO] Setting property: velocimacro.messages.on => 'false'.
        [INFO] Setting property: resource.loader => 'classpath'.
        [INFO] Setting property: resource.manager.logwhenfound => 'false'.
        [INFO] [remote-resources:process

        {execution: default}

        ]
        [INFO] [resources:resources]
        [INFO] Using default encoding to copy filtered resources.
        [INFO] [compiler:compile]
        [INFO] Nothing to compile - all classes are up to date
        [INFO] [resources:testResources]
        [INFO] Using default encoding to copy filtered resources.
        [INFO] [compiler:testCompile]
        [INFO] No sources to compile
        Downloading: http://repo1.maven.org/maven2/junit/junit/3.8.1/junit-3.8.1.jar
        118K downloaded
        [INFO] [surefire:test]
        [INFO] Setting reports dir: /home/chrisra/pluto/pluto-168-trunk/pluto-ant-tasks/
        target/surefire-reports
        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] Error executing surefire

        tried to access method junit.framework.TestCase.<init>()V from class org.apache.
        maven.surefire.battery.assertion.BatteryAssert
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 7 seconds
        [INFO] Finished at: Wed Jul 04 15:51:24 CEST 2007
        [INFO] Final Memory: 10M/19M
        [INFO] ------------------------------------------------------------------------

        Show
        Christian Raschka added a comment - Strange. I've tried it with maven 2.0.4, 2.0.6 and 2.0.7 with no difference. If i delete all junit things in the maven repository, maven downloads junit-3.7 and junit-3.8.1. Don't know why: pluto-ant-tasks $ mvn install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------- — [INFO] Building Pluto Ant Tasks [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------- — Downloading: http://repo1.maven.org/maven2/junit/junit/3.7/junit-3.7.pom 745b downloaded Downloading: http://repo1.maven.org/maven2/junit/junit/3.7/junit-3.7.jar 114K downloaded Downloading: http://repo1.maven.org/maven2/junit/junit/3.8.1/junit-3.8.1.pom 998b downloaded [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus .velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [remote-resources:process {execution: default} ] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] No sources to compile Downloading: http://repo1.maven.org/maven2/junit/junit/3.8.1/junit-3.8.1.jar 118K downloaded [INFO] [surefire:test] [INFO] Setting reports dir: /home/chrisra/pluto/pluto-168-trunk/pluto-ant-tasks/ target/surefire-reports [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing surefire tried to access method junit.framework.TestCase.<init>()V from class org.apache. maven.surefire.battery.assertion.BatteryAssert [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7 seconds [INFO] Finished at: Wed Jul 04 15:51:24 CEST 2007 [INFO] Final Memory: 10M/19M [INFO] ------------------------------------------------------------------------
        Hide
        Craig Doremus added a comment -

        I do not have problems building the ant task. I'm using Maven 2.0.6. What version are you using? The ant task module does not have any unit tests, so a JUnit dependency is not necessary.

        Show
        Craig Doremus added a comment - I do not have problems building the ant task. I'm using Maven 2.0.6. What version are you using? The ant task module does not have any unit tests, so a JUnit dependency is not necessary.
        Hide
        Christian Raschka added a comment -

        added junit dependency

        Show
        Christian Raschka added a comment - added junit dependency

          People

          • Assignee:
            Elliot Metsger
            Reporter:
            Christian Raschka
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development