You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by he...@dnbnor.no on 2006/06/01 14:54:01 UTC

RE: creating a new project with the MavenEmbedder

Hi

Have not had the time before now.

It still does not work. The basedir is still set to the current directory.

Which class is responsible for setting it?

Hermod

-----Original Message-----
From: hermod.opstvedt@dnbnor.no [mailto:hermod.opstvedt@dnbnor.no]
Sent: Wednesday, May 31, 2006 12:12 PM
To: dev@maven.apache.org
Subject: RE: creating a new project with the MavenEmbedder


Hi

I'll fix it, and give it a test run.

thnx
Hermod

-----Original Message-----
From: Trygve Laugstøl [mailto:trygvis@apache.org]
Sent: Wednesday, May 31, 2006 9:22 AM
To: Maven Developers List
Subject: Re: creating a new project with the MavenEmbedder


hermod.opstvedt@dnbnor.no wrote:
> Hi
> 
> I tried what you suggested, and it did create a project in a directory with the given artifactId, i.e:
> 
> mvn -f foo/pom.xml archetype:create -DartifactId=whatever <<< creates a project under whatever and the output is :
> 

[snip]

> Notice that the basedir from the log output does not match what was given as input parameter to .setBasedir. It looks like it is ignoring it alltogether.

This is as I though, the archetype plugin doesn't use the basedir as it 
should. Another guy at irc found out the same thing yesterday.

If you could try to fix the plugin yourself that would be great. What 
needs to be done:

Add this to the mojo [1]:

     /**
      * @parameter expression="${basedir}"
      */
     private File basedir;

and replace

         map.put( "basedir", basedir );

with

         map.put( "basedir", basedir.getAbsolutePath() );

and try that. If it works please create an issue and submit the patch 
like it's described in [2].

[1]: 
https://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java
[2]: http://maven.apache.org/guides/development/guide-m2-development.html

--
Trygve

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


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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


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


Re: creating a new project with the MavenEmbedder

Posted by Trygve Laugstøl <tr...@apache.org>.
hermod.opstvedt@dnbnor.no wrote:
> Hi
> 
> Have not had the time before now.
> 
> It still does not work. The basedir is still set to the current directory.

The ${basedir} will be set to the value you set in the embedder, this is 
working for me in my IDEA plugin where I use the embedder.

Can you include the patch from the assembly plugin so I can see what you 
did?

--
Trygve

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