Re: Is it possible to start a maven2 process in your code.

2007-01-30 Thread Petar Tahchiev

On 30/01/07, Milos Kleint <[EMAIL PROTECTED]> wrote:


google for maven embedder.

Milos

On 1/30/07, Petar Tahchiev <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> Is there a way to instantiate a maven project process in the in my java
> program? I mean is it possible to do something like this:
>
>
>
> public static void main(String[] args) {
>
>  MavenProject mavenProject = new MavenProject(new Model());
>
>  ProjectExecutor executor = new ProjectExecutor();
>
>  executor.execute(mavenProject); //this is supposed to start in a
> separate thread.
> }
>
>
> Of course I know there's no such thing as the ProjectExecutor, what I am
> asking is - what is the way to execute a MavenProject object in
> my code?
>
> Thank you.
>
>
>
>
> --
> Regards, Petar!
> Karlovo, Bulgaria.
>
>

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



Thenk you gyus. I think this is what I am looking for:

http://maven.apache.org/guides/mini/guide-embedding-m2.html

Also I will try with the plexus classloader.

--
Regards, Petar!
Karlovo, Bulgaria.


Re: Is it possible to start a maven2 process in your code.

2007-01-30 Thread Milos Kleint

google for maven embedder.

Milos

On 1/30/07, Petar Tahchiev <[EMAIL PROTECTED]> wrote:

Hi guys,

Is there a way to instantiate a maven project process in the in my java
program? I mean is it possible to do something like this:



public static void main(String[] args) {

 MavenProject mavenProject = new MavenProject(new Model());

 ProjectExecutor executor = new ProjectExecutor();

 executor.execute(mavenProject); //this is supposed to start in a
separate thread.
}


Of course I know there's no such thing as the ProjectExecutor, what I am
asking is - what is the way to execute a MavenProject object in
my code?

Thank you.




--
Regards, Petar!
Karlovo, Bulgaria.




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



RE: Is it possible to start a maven2 process in your code.

2007-01-30 Thread jelle.volckaert
Hi Petar,

You can always run a cmd command from in your java code.

-> Runtime.getRuntim().exec(String[] cmdarray);

So your cmdarray could contain:
Index 0: mvn
Index 1: archetype:create
Index 2: -DgroupId=blabla
Index 3: -DartifactId=bla

I guess it works like that.
Haven't tried it myself, but you can give it a try.

Good luck !

Jelle


-Original Message-
From: Petar Tahchiev [mailto:[EMAIL PROTECTED] 
Sent: dinsdag 30 januari 2007 8:16
To: Maven Users List
Subject: Is it possible to start a maven2 process in your code.

Hi guys,

Is there a way to instantiate a maven project process in the in my java
program? I mean is it possible to do something like this:



public static void main(String[] args) {

 MavenProject mavenProject = new MavenProject(new Model());

 ProjectExecutor executor = new ProjectExecutor();

 executor.execute(mavenProject); //this is supposed to start in a
separate thread.
}


Of course I know there's no such thing as the ProjectExecutor, what I am
asking is - what is the way to execute a MavenProject object in
my code?

Thank you.




-- 
Regards, Petar!
Karlovo, Bulgaria.


This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

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



Is it possible to start a maven2 process in your code.

2007-01-29 Thread Petar Tahchiev

Hi guys,

Is there a way to instantiate a maven project process in the in my java
program? I mean is it possible to do something like this:



public static void main(String[] args) {

MavenProject mavenProject = new MavenProject(new Model());

ProjectExecutor executor = new ProjectExecutor();

executor.execute(mavenProject); //this is supposed to start in a
separate thread.
}


Of course I know there's no such thing as the ProjectExecutor, what I am
asking is - what is the way to execute a MavenProject object in
my code?

Thank you.




--
Regards, Petar!
Karlovo, Bulgaria.