I had specified the plugin dependency incorrectly in my project's
pom.xml. Here's the correct way to do it (I had used "SNAPSHOT"
instead of "2.0-beta-2-SNAPSHOT")::

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.0-beta-2-SNAPSHOT</version>
            </plugin>
        </plugins>
    </build>

So now maven uses the correct plugin, but fails saying it cant find
class org.codehaus.surefire.Surefire. Full output below.

-Yogi

$ m2 -X test
+ Error stacktraces are turned on.
[DEBUG] Building Maven user-level plugin registry from:
'/home/yogi/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from:
'/home/yogi/apps/maven-2.0-beta-3/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[INFO] 
----------------------------------------------------------------------------
[INFO] Building Maven Quick Start Archetype
[INFO]    task-segment: [test]
[INFO] 
----------------------------------------------------------------------------
[DEBUG] maven-resources-plugin: resolved to version 2.0 from local repository
[DEBUG] Retrieving parent-POM from the repository for project:
null:maven-resources-plugin:maven-plugin:2.0
[DEBUG] maven-compiler-plugin: resolved to version 2.0-beta-2-SNAPSHOT
from local repository
[DEBUG] Skipping disabled repository central
[DEBUG] maven-compiler-plugin: using locally installed snapshot
[DEBUG] Retrieving parent-POM from the repository for project:
null:maven-compiler-plugin:maven-plugin:2.0-beta-2-SNAPSHOT
[DEBUG] maven-compiler-plugin: using locally installed snapshot
[DEBUG] maven-compiler-plugin: using locally installed snapshot
[DEBUG] Skipping disabled repository central
[DEBUG] Skipping disabled repository central
[DEBUG] maven-surefire-plugin: using locally installed snapshot
[DEBUG] Retrieving parent-POM from the repository for project:
null:maven-surefire-plugin:maven-plugin:2.0-beta-2-SNAPSHOT
[DEBUG] Skipping disabled repository central
[DEBUG] Skipping disabled repository central
[DEBUG] maven-plugin-parent: using locally installed snapshot
[DEBUG] maven-surefire-plugin: using locally installed snapshot
[DEBUG] maven-surefire-plugin: using locally installed snapshot
[DEBUG] maven-compiler-plugin: using locally installed snapshot
[DEBUG] org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.0
(selected for runtime)
[DEBUG]   commons-io:commons-io:jar:1.0 (selected for runtime)
[DEBUG]     junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-resources-plugin:2.0:resources' -->
[DEBUG]   (f) filters = []
[DEBUG]   (f) outputDirectory = /home/yogi/tmp/work/maven/sample/target/classes
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG]   (f) resources = [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[DEBUG] com.tw:sample:jar:1.0-SNAPSHOT (selected for null)
[DEBUG] 
org.apache.maven.plugins:maven-compiler-plugin:maven-plugin:2.0-beta-2-SNAPSHOT
(selected for runtime)
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compiler-manager:jar:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compiler:pom:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
plexus:plexus-components:pom:1.1.2
[DEBUG]   plexus:plexus-compiler-manager:jar:1.5 (selected for runtime)
[DEBUG]     junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compiler-api:jar:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compiler:pom:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
plexus:plexus-components:pom:1.1.2
[DEBUG]     plexus:plexus-compiler-api:jar:1.5 (selected for runtime)
[DEBUG]       junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compiler-javac:jar:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compilers:pom:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
null:plexus-compiler:pom:1.5
[DEBUG] Retrieving parent-POM from the repository for project:
plexus:plexus-components:pom:1.1.2
[DEBUG]   plexus:plexus-compiler-javac:jar:1.5 (selected for runtime)
[DEBUG]     junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG]     plexus:plexus-compiler-api:jar:1.5 (selected for runtime)
[DEBUG]   plexus:plexus-compiler-api:jar:1.5 (selected for runtime)
[DEBUG]     junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0-beta-2-SNAPSHOT:compile'
-->
[DEBUG]   (f) basedir = /home/yogi/tmp/work/maven/sample
[DEBUG]   (f) buildDirectory = /home/yogi/tmp/work/maven/sample/target
[DEBUG]   (f) classpathElements =
[/home/yogi/tmp/work/maven/sample/target/classes]
[DEBUG]   (f) compileSourceRoots =
[/home/yogi/tmp/work/maven/sample/src/main/java]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) outputDirectory = /home/yogi/tmp/work/maven/sample/target/classes
[DEBUG]   (f) outputFileName = sample-1.0-SNAPSHOT
[DEBUG]   (f) projectArtifact = com.tw:sample:jar:1.0-SNAPSHOT
[DEBUG]   (f) staleMillis = 0
[DEBUG] -- end configuration --
[INFO] [compiler:compile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/home/yogi/tmp/work/maven/sample/src/main/java]
[DEBUG] Classpath: [/home/yogi/tmp/work/maven/sample/target/classes]
[DEBUG] Output directory: /home/yogi/tmp/work/maven/sample/target/classes
[INFO] Nothing to compile - all classes are up to date
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-resources-plugin:2.0:testResources'
-->
[DEBUG]   (f) filters = []
[DEBUG]   (f) outputDirectory =
/home/yogi/tmp/work/maven/sample/target/test-classes
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG]   (f) resources = [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[DEBUG] com.tw:sample:jar:1.0-SNAPSHOT (selected for null)
[DEBUG]   junit:junit:jar:3.8.1 (selected for test)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0-beta-2-SNAPSHOT:testCompile'
-->
[DEBUG]   (f) basedir = /home/yogi/tmp/work/maven/sample
[DEBUG]   (f) buildDirectory = /home/yogi/tmp/work/maven/sample/target
[DEBUG]   (f) classpathElements =
[/home/yogi/tmp/work/maven/sample/target/classes,
/home/yogi/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar]
[DEBUG]   (f) compileSourceRoots =
[/home/yogi/tmp/work/maven/sample/src/test/java]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) outputDirectory =
/home/yogi/tmp/work/maven/sample/target/test-classes
[DEBUG]   (f) outputFileName = sample-1.0-SNAPSHOT
[DEBUG]   (f) staleMillis = 0
[DEBUG] -- end configuration --
[INFO] [compiler:testCompile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/home/yogi/tmp/work/maven/sample/src/test/java]
[DEBUG] Classpath: [/home/yogi/tmp/work/maven/sample/target/classes
 /home/yogi/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar]
[DEBUG] Output directory: /home/yogi/tmp/work/maven/sample/target/test-classes
[INFO] Nothing to compile - all classes are up to date
[DEBUG] com.tw:sample:jar:1.0-SNAPSHOT (selected for null)
[DEBUG]   junit:junit:jar:3.8.1 (selected for test)
[DEBUG] 
org.apache.maven.plugins:maven-surefire-plugin:maven-plugin:2.0-beta-2-SNAPSHOT
(selected for runtime)
[DEBUG]   junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] Skipping disabled repository central
[DEBUG] surefire-booter: resolved to version 1.4-20050919.220602-1
from repository snapshots
[DEBUG] Retrieving parent-POM from the repository for project:
null:surefire-booter:jar:1.4-20050919.220602-1
[DEBUG]   surefire:surefire-booter:jar:1.4-SNAPSHOT (selected for runtime)
[DEBUG] Skipping disabled repository central
[DEBUG] surefire: resolved to version 1.4-20051003.005342-2 from
repository snapshots
[DEBUG] Retrieving parent-POM from the repository for project:
null:surefire:jar:1.4-20051003.005342-2
[DEBUG]     surefire:surefire:jar:1.4-SNAPSHOT (selected for runtime)
[DEBUG]       junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] surefire: resolved to version 1.4-20051003.005342-2 from
repository snapshots
[DEBUG] Retrieving parent-POM from the repository for project:
null:surefire:jar:1.4-20051003.005342-2
[DEBUG]   surefire:surefire:jar:1.4-SNAPSHOT (selected for runtime)
[DEBUG]     junit:junit:jar:3.8.1 (selected for runtime)
[DEBUG] surefire-booter: resolved to version 1.4-20050919.220602-1
from repository snapshots
[DEBUG] surefire: resolved to version 1.4-20051003.005342-2 from
repository snapshots
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-surefire-plugin:2.0-beta-2-SNAPSHOT:test'
-->
[DEBUG]   (f) basedir = /home/yogi/tmp/work/maven/sample
[DEBUG]   (f) classesDirectory = /home/yogi/tmp/work/maven/sample/target/classes
[DEBUG]   (f) classpathElements =
[/home/yogi/tmp/work/maven/sample/target/classes,
/home/yogi/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar]
[DEBUG]   (f) localRepository = [local] -> file:///home/yogi/.m2/repository
[DEBUG]   (f) pluginArtifacts = [junit:junit:jar:3.8.1,
surefire:surefire:jar:1.4-20051003.005342-2,
surefire:surefire-booter:jar:1.4-20050919.220602-1,
org.apache.maven:maven-plugin-api:jar:2.0-beta-4-SNAPSHOT,
org.codehaus.plexus:plexus-utils:jar:1.0.4-SNAPSHOT,
org.apache.maven:maven-artifact:jar:2.0-beta-4-SNAPSHOT]
[DEBUG]   (f) printSummary = true
[DEBUG]   (f) reportFormat = brief
[DEBUG]   (f) reportsDirectory =
/home/yogi/tmp/work/maven/sample/target/surefire-reports
[DEBUG]   (f) testClassesDirectory =
/home/yogi/tmp/work/maven/sample/target/test-classes
[DEBUG]   (f) useFile = true
[DEBUG] -- end configuration --
[INFO] [surefire:test]
[INFO] Setting reports dir:
/home/yogi/tmp/work/maven/sample/target/surefire-reports
[DEBUG] Test Classpath :
[DEBUG] /home/yogi/tmp/work/maven/sample/target/test-classes
[DEBUG] /home/yogi/tmp/work/maven/sample/target/classes
[DEBUG] /home/yogi/tmp/work/maven/sample/target/classes
[DEBUG] /home/yogi/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[INFO] 
----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
----------------------------------------------------------------------------
[INFO] Diagnosis: Error executing surefire
[INFO] 
----------------------------------------------------------------------------
[DEBUG] Trace:

org.apache.maven.plugin.MojoExecutionException: Error executing surefire
        at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:291)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:419)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:599)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:546)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:529)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:326)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:152)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:237)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:251)
        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: java.lang.ClassNotFoundException: org.codehaus.surefire.Surefire
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at 
org.codehaus.surefire.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:69)
        at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:94)
        at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:286)
        ... 16 more
[INFO] 
----------------------------------------------------------------------------
[INFO] 
----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
----------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Oct 24 17:43:03 IST 2005
[INFO] Final Memory: 2M/5M
[INFO] 
----------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to