You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jochen Wiedmann <jo...@gmail.com> on 2006/11/15 08:18:32 UTC

maven-plugin-testing-harness: Nonexistent component

Hi,

in order to fix some bugs in the javacc plugins JTBMojo, I wrote a
little integration test, based on the maven-plugin-testing-harness.
However, I am unable to get it running, because I always receive the
following error message:

[ERROR] Nonexistent component:
org.apache.maven.plugin.Mojoorg.codehaus.mojo:javacc-maven-plugin:2.2-SNAPSHOT:jtb
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Component descriptor cannot be found in the component repository:
org.apache.maven.plugin.Mojoorg.codehaus.mojo:javacc-maven-plugin:2.2-SNAPSHOT:jtb.
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:319)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:436)
	at org.codehaus.plexus.PlexusTestCase.lookup(PlexusTestCase.java:222)
	at org.apache.maven.plugin.testing.AbstractMojoTestCase.lookupMojo(AbstractMojoTestCase.java:164)
	at org.apache.maven.plugin.testing.AbstractMojoTestCase.lookupMojo(AbstractMojoTestCase.java:110)
	at org.codehaus.mojo.javacc.test.JTBMojoTest.newMojo(JTBMojoTest.java:42)
	at org.codehaus.mojo.javacc.test.JTBMojoTest.runTest(JTBMojoTest.java:53)
	at org.codehaus.mojo.javacc.test.JTBMojoTest.testJTB(JTBMojoTest.java:35)

Would anyone please be so kind to check what I might be doing wrong?
Here's my POM:

    <project>
     <modelVersion>4.0.0</modelVersion>
       <parent>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>javacc-maven-plugin</artifactId>
         <version>2.2-SNAPSHOT</version>
       </parent>
       <artifactId>javacc-maven-plugin-it1</artifactId>
       <build>
         <plugins>
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>javacc-maven-plugin</artifactId>
             <version>2.2-SNAPSHOT</version>
             <configuration/>
           </plugin>
         </plugins>
      </build>
  </project>

and here's my test case:
public class JTBMojoTest extends AbstractMojoTestCase {
    /**
     * Tests running the WSDL generator.
     */
    public void testJTB() throws Exception {
        final String dir = "src/test/it1";
        runTest(dir , "jtb" );
    }

    protected JTBMojo newMojo( String pDir, String pGoal ) throws Exception
    {
        final File baseDir = new File(new File(getBasedir()), pDir);
        File testPom = new File( baseDir, "pom.xml" );
        JTBMojo mojo = (JTBMojo) lookupMojo( pGoal, testPom );
        MavenProjectStub project = new MavenProjectStub(){
            public File getBasedir() { return baseDir; }
        };
        setVariableValueToObject(mojo, "project", project);
        return mojo;
    }

    protected void runTest( String pDir, String pGoal )
        throws Exception
    {
        newMojo( pDir, pGoal ).execute();
    }
}


Thanks,

Jochen



-- 
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org