maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Lamy" <>
Subject RE : More questions on maven-plugin-testing-harness
Date Fri, 16 Jun 2006 20:08:53 GMT

setVariableValueToObject( vm , "basedir", new File( getBasedir() ) );
Before vm.execute();

Take care getBaseDir() will point to your current project basedir.

If you use a test project located in

You will probably need to use something like (not tested) :

setVariableValueToObject( vm , "basedir", new File( getBasedir(),
"target/test-classes/projects/simple" ) );


-----Message d'origine-----
De : Jochen Wiedmann [] 
Envoyé : vendredi 16 juin 2006 21:51
À : Maven Users List
Objet : More questions on maven-plugin-testing-harness


thanks to Odea's help, I managed to get a few steps further. However, I
to return with another question in the end.

My plugin contains the following variable:

     * The base directory, relative to which directory names are
     * interpreted.
     * @parameter expression="${basedir}"
     * @required
     * @readonly
    public File basedir;

The plugin is started with the following code:

    public void testIt1() throws Exception
        File testPom = new File( getBasedir(), "src/test/it1/pom.xml" );
        ValidatorMojo vm = (ValidatorMojo) lookupMojo( "validate",
testPom );

However, the plugins execution fails, because basedir is null. I have
attempted to gain the base directory through a variable "project" of
MavenProject, which is initialized with ${project}, but this one is also

Any ideas?



To unsubscribe, e-mail:
For additional commands, e-mail:

This e-mail, any attachments and the information contained therein ("this message") are confidential
and intended solely for the use of the addressee(s). If you have received this message in
error please send it back to the sender and delete it. Unauthorized publication, use, dissemination
or disclosure of this message, either in whole or in part is strictly prohibited.
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues
dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement
à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par
erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées
de ce message, sont interdites.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message