Maven Embedder 3.3.9 Functional Example Help

2017-04-07 Thread Mitch Turner
Hello folks,

I am attempting to use maven-embedder:3.3.9 and have thus far been
unsuccessful.

I forked a functioning repo for Maven version 3.1.1 however I would like to
use 3.3.9 or newer.


My attempt to run 3.3.9 is here:
https://github.com/tc-turner/maven-embedder-otg/tree/339

You can see the full stack trace here:
https://github.com/tc-turner/maven-embedder-otg/issues/1


Here is a portion of the stack trace in case it is obvious to you:

mturner-ol:target mturner$ java -jar
maven-embedder-example-1-jar-with-dependencies.jar
[main] WARN Sisu - Error injecting:
org.apache.maven.project.DefaultProjectBuildingHelper
com.google.inject.ProvisionException: Unable to provision, see the
following errors:

1) No implementation for org.apache.maven.classrealm.ClassRealmManager
was bound.
  while locating org.apache.maven.project.DefaultProjectBuildingHelper

1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at 
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at 
org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at 
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at 
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at 
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
at 
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at 
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
at 
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at 
com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at 
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)



Does anyone have a functional example of using maven-embedder?

Thanks,

Mitchell Turner


Maven embedder: Compiler dependency could not be resolved

2015-02-08 Thread Albert Battle
I have maven projects *A* and *B*. Project *A* uses maven embedder 3.2.5
and builds with it project *B*.

MavenCli mavenCli = new MavenCli();
mavenCli.doMain(new String[] {"package"},
"C:\\Users\\JohnDoe\\Desktop\\abc", System.out, System.out);

But I get the exception:

Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its
dependencies could not be resolved: Failed to read artifact descriptor for
org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: Could not transfer
artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to
central (https://repo.maven.apache.org/maven2): No connector factories
available

I looked into my local repository folder and there is indeed no plugin
version 3.1. If I manually put it there the build is successful. But AFAIK
maven automatically should download all necessary plugins. But it doesn't
happen. I added

 
  org.apache.maven.wagon
  wagon-http
  2.8

to project *A* and still no luck.


Re: Maven Embedder

2011-08-18 Thread Anders Hammar
My understanding is that maven-embedder stopped being supported for
Maven 2 at v2.0.4 (there is no 2.0.5, 2.1.x, or 2.2.x for example).
Then it was re-introduced with Maven 3, but I'm guessing that the API
changed completely.
But I could be completely off...

/Anders

On Thu, Aug 18, 2011 at 15:31, Thiessen, Todd (Todd)
 wrote:
> Thanks for a link to those examples.
>
> I noticed that that pom has dependencies like:
>
>    
>      org.apache.maven
>      maven-model
>      3.0.1
>    
>
> This artifact is also a dependency of the maven-embedder artifact. The 
> statement I linked earlier regarding the maven embedder not being supported; 
> what does this really mean?  Does this mean that I shouldn't be using 
> maven-embedder but rather directly using the artifacts it depends on like 
> maven-model?
>
>> -Original Message-
>> From: t.cserve...@gmail.com [mailto:t.cserve...@gmail.com] On Behalf Of
>> Tamás Cservenák
>> Sent: Thursday, August 18, 2011 7:12 AM
>> To: Maven Users List
>> Subject: Re: Maven Embedder
>>
>> While you're use case is not quite clear to me ("combined view of
>> properties defined in pom and in profile..."), you could take a peek
>> at this:
>>
>> https://github.com/sonatype/sisu-maven-bridge
>>
>> It does offer effective pom for example...
>>
>> Patches, as always, are welcome! :)
>>
>>
>> Thanks,
>> ~t~
>>
>> On Wed, Aug 17, 2011 at 10:01 PM, Thiessen, Todd (Todd)
>>  wrote:
>> > I like the idea of using only the parts of the embedder that you
>> need.
>> >
>> > Is anything published anywhere which can list which components are
>> available for what tasks?
>> >
>> > I have been looking through the source for this artifact and its
>> dependencies:
>> >
>> >    
>> >        org.apache.maven
>> >        maven-embedder
>> >        3.0.3
>> >    
>> >
>> > But haven't had too much luck trying to piece it all together.
>> >
>> > Ultimately what I want to do is to be able to have a combined view of
>> the properties defined in the pom and in a profile defined in my local
>> settings.xml file.  I have found a number of classes like
>> "DefaultSettingsBuilder" and "DefaultProjectBuilder" but they all
>> require other classes which other classes, etc...
>> >
>> >> -Original Message-
>> >> From: Jason van Zyl [mailto:ja...@maven.org]
>> >> Sent: Wednesday, August 17, 2011 3:45 PM
>> >> To: Maven Users List
>> >> Subject: Re: Maven Embedder
>> >>
>> >> A single embedder really doesn't make any sense, or at least this is
>> >> what we have found working on Nexus, M2Eclipse, Hudson and a bunch
>> of
>> >> other tools. All of the use cases are slightly different and it is
>> just
>> >> easier to grab the individual components and piece them together as
>> >> required. We have several small embedders for all of the tools now.
>> We
>> >> could probably make another one now that might be useful but the
>> first
>> >> form of the embedder certainly wasn't which is why it was removed.
>> >>
>> >> On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
>> >>
>> >> > Hmm. Or is the Maven Embedder no longer supported?
>> >> >
>> >> > http://stackoverflow.com/questions/5141788/how-to-run-maven-from-
>> java
>> >> >
>> >> >
>> >> > From: Thiessen, Todd (Todd)
>> >> > Sent: Wednesday, August 17, 2011 11:27 AM
>> >> > To: users@maven.apache.org
>> >> > Subject: Maven Embedder
>> >> >
>> >> > Is there any kind of users guide for the maven embedder?  Not
>> finding
>> >> anything.
>> >> >
>> >> > I can find the source, but having to guess as to how to use the
>> >> classes.
>> >>
>> >> Thanks,
>> >>
>> >> Jason
>> >>
>> >> --
>> >> Jason van Zyl
>> >> Founder,  Apache Maven
>> >> http://twitter.com/jvanzyl
>> >> -
>> >>
>> >> happiness is like a butterfly: the more you chase it, the more it
>> will
>> >> elude you, but if you turn your attention to other things, it will
>> come
>> >> and sit softly on your shoulder ...
>> >>
>> >>  -- Thoreau
>> >>
>> >>
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> > For additional commands, e-mail: users-h...@maven.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>
>

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



Re: Maven Embedder

2011-08-18 Thread Jason van Zyl
The MavenEmbedder class is gone, the maven-embedder module that still exists in 
the source is a misnomer really. Though if you look at the MavenCli class 
you'll see how we use some of the components to do some basic things like 
execute goals, read settings and the like.

On Aug 18, 2011, at 9:31 AM, Thiessen, Todd (Todd) wrote:

> Thanks for a link to those examples.
> 
> I noticed that that pom has dependencies like:
> 
>
>  org.apache.maven
>  maven-model
>  3.0.1
>
> 
> This artifact is also a dependency of the maven-embedder artifact. The 
> statement I linked earlier regarding the maven embedder not being supported; 
> what does this really mean?  Does this mean that I shouldn't be using 
> maven-embedder but rather directly using the artifacts it depends on like 
> maven-model?
> 
>> -Original Message-
>> From: t.cserve...@gmail.com [mailto:t.cserve...@gmail.com] On Behalf Of
>> Tamás Cservenák
>> Sent: Thursday, August 18, 2011 7:12 AM
>> To: Maven Users List
>> Subject: Re: Maven Embedder
>> 
>> While you're use case is not quite clear to me ("combined view of
>> properties defined in pom and in profile..."), you could take a peek
>> at this:
>> 
>> https://github.com/sonatype/sisu-maven-bridge
>> 
>> It does offer effective pom for example...
>> 
>> Patches, as always, are welcome! :)
>> 
>> 
>> Thanks,
>> ~t~
>> 
>> On Wed, Aug 17, 2011 at 10:01 PM, Thiessen, Todd (Todd)
>>  wrote:
>>> I like the idea of using only the parts of the embedder that you
>> need.
>>> 
>>> Is anything published anywhere which can list which components are
>> available for what tasks?
>>> 
>>> I have been looking through the source for this artifact and its
>> dependencies:
>>> 
>>>
>>>org.apache.maven
>>>maven-embedder
>>>3.0.3
>>>
>>> 
>>> But haven't had too much luck trying to piece it all together.
>>> 
>>> Ultimately what I want to do is to be able to have a combined view of
>> the properties defined in the pom and in a profile defined in my local
>> settings.xml file.  I have found a number of classes like
>> "DefaultSettingsBuilder" and "DefaultProjectBuilder" but they all
>> require other classes which other classes, etc...
>>> 
>>>> -Original Message-
>>>> From: Jason van Zyl [mailto:ja...@maven.org]
>>>> Sent: Wednesday, August 17, 2011 3:45 PM
>>>> To: Maven Users List
>>>> Subject: Re: Maven Embedder
>>>> 
>>>> A single embedder really doesn't make any sense, or at least this is
>>>> what we have found working on Nexus, M2Eclipse, Hudson and a bunch
>> of
>>>> other tools. All of the use cases are slightly different and it is
>> just
>>>> easier to grab the individual components and piece them together as
>>>> required. We have several small embedders for all of the tools now.
>> We
>>>> could probably make another one now that might be useful but the
>> first
>>>> form of the embedder certainly wasn't which is why it was removed.
>>>> 
>>>> On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
>>>> 
>>>>> Hmm. Or is the Maven Embedder no longer supported?
>>>>> 
>>>>> http://stackoverflow.com/questions/5141788/how-to-run-maven-from-
>> java
>>>>> 
>>>>> 
>>>>> From: Thiessen, Todd (Todd)
>>>>> Sent: Wednesday, August 17, 2011 11:27 AM
>>>>> To: users@maven.apache.org
>>>>> Subject: Maven Embedder
>>>>> 
>>>>> Is there any kind of users guide for the maven embedder?  Not
>> finding
>>>> anything.
>>>>> 
>>>>> I can find the source, but having to guess as to how to use the
>>>> classes.
>>>> 
>>>> Thanks,
>>>> 
>>>> Jason
>>>> 
>>>> --
>>>> Jason van Zyl
>>>> Founder,  Apache Maven
>>>> http://twitter.com/jvanzyl
>>>> -
>>>> 
>>>> happiness is like a butterfly: the more you chase it, the more it
>> will
>>>> elude you, but if you turn your attention to other things, it will
>> come
>>>> and sit softly on your shoulder ...
>>>> 
>>>>  -- Thoreau
>>>> 
>>>> 
>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: users-h...@maven.apache.org
>>> 
>>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
> 

Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
-

the course of true love never did run smooth ...

 -- Shakespeare





RE: Maven Embedder

2011-08-18 Thread Thiessen, Todd (Todd)
Thanks for a link to those examples.

I noticed that that pom has dependencies like:


  org.apache.maven
  maven-model
  3.0.1


This artifact is also a dependency of the maven-embedder artifact. The 
statement I linked earlier regarding the maven embedder not being supported; 
what does this really mean?  Does this mean that I shouldn't be using 
maven-embedder but rather directly using the artifacts it depends on like 
maven-model?

> -Original Message-
> From: t.cserve...@gmail.com [mailto:t.cserve...@gmail.com] On Behalf Of
> Tamás Cservenák
> Sent: Thursday, August 18, 2011 7:12 AM
> To: Maven Users List
> Subject: Re: Maven Embedder
> 
> While you're use case is not quite clear to me ("combined view of
> properties defined in pom and in profile..."), you could take a peek
> at this:
> 
> https://github.com/sonatype/sisu-maven-bridge
> 
> It does offer effective pom for example...
> 
> Patches, as always, are welcome! :)
> 
> 
> Thanks,
> ~t~
> 
> On Wed, Aug 17, 2011 at 10:01 PM, Thiessen, Todd (Todd)
>  wrote:
> > I like the idea of using only the parts of the embedder that you
> need.
> >
> > Is anything published anywhere which can list which components are
> available for what tasks?
> >
> > I have been looking through the source for this artifact and its
> dependencies:
> >
> >    
> >        org.apache.maven
> >        maven-embedder
> >        3.0.3
> >    
> >
> > But haven't had too much luck trying to piece it all together.
> >
> > Ultimately what I want to do is to be able to have a combined view of
> the properties defined in the pom and in a profile defined in my local
> settings.xml file.  I have found a number of classes like
> "DefaultSettingsBuilder" and "DefaultProjectBuilder" but they all
> require other classes which other classes, etc...
> >
> >> -Original Message-
> >> From: Jason van Zyl [mailto:ja...@maven.org]
> >> Sent: Wednesday, August 17, 2011 3:45 PM
> >> To: Maven Users List
> >> Subject: Re: Maven Embedder
> >>
> >> A single embedder really doesn't make any sense, or at least this is
> >> what we have found working on Nexus, M2Eclipse, Hudson and a bunch
> of
> >> other tools. All of the use cases are slightly different and it is
> just
> >> easier to grab the individual components and piece them together as
> >> required. We have several small embedders for all of the tools now.
> We
> >> could probably make another one now that might be useful but the
> first
> >> form of the embedder certainly wasn't which is why it was removed.
> >>
> >> On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
> >>
> >> > Hmm. Or is the Maven Embedder no longer supported?
> >> >
> >> > http://stackoverflow.com/questions/5141788/how-to-run-maven-from-
> java
> >> >
> >> >
> >> > From: Thiessen, Todd (Todd)
> >> > Sent: Wednesday, August 17, 2011 11:27 AM
> >> > To: users@maven.apache.org
> >> > Subject: Maven Embedder
> >> >
> >> > Is there any kind of users guide for the maven embedder?  Not
> finding
> >> anything.
> >> >
> >> > I can find the source, but having to guess as to how to use the
> >> classes.
> >>
> >> Thanks,
> >>
> >> Jason
> >>
> >> --
> >> Jason van Zyl
> >> Founder,  Apache Maven
> >> http://twitter.com/jvanzyl
> >> -
> >>
> >> happiness is like a butterfly: the more you chase it, the more it
> will
> >> elude you, but if you turn your attention to other things, it will
> come
> >> and sit softly on your shoulder ...
> >>
> >>  -- Thoreau
> >>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org



RE: Maven Embedder

2011-08-18 Thread Thiessen, Todd (Todd)
It is basically the effective pom, but just for properties.  So if in your 
settings.xml file you have this:

  

  profileId
  
 profileProperty1Value
 profileProperty3Value
  
  
true
  

  

And in the pom you have this:

  
pomProperty1Value
pomProperty2Value
  

I should be able to get a consolidated list of properties. Ie:

 profileProperty1Value
 pomProperty2Value
 profileProperty3Value
 

> -Original Message-
> From: t.cserve...@gmail.com [mailto:t.cserve...@gmail.com] On Behalf Of
> Tamás Cservenák
> Sent: Thursday, August 18, 2011 7:12 AM
> To: Maven Users List
> Subject: Re: Maven Embedder
> 
> While you're use case is not quite clear to me ("combined view of
> properties defined in pom and in profile..."), you could take a peek
> at this:
> 
> https://github.com/sonatype/sisu-maven-bridge
> 
> It does offer effective pom for example...
> 
> Patches, as always, are welcome! :)
> 
> 
> Thanks,
> ~t~
> 
> On Wed, Aug 17, 2011 at 10:01 PM, Thiessen, Todd (Todd)
>  wrote:
> > I like the idea of using only the parts of the embedder that you
> need.
> >
> > Is anything published anywhere which can list which components are
> available for what tasks?
> >
> > I have been looking through the source for this artifact and its
> dependencies:
> >
> >    
> >        org.apache.maven
> >        maven-embedder
> >        3.0.3
> >    
> >
> > But haven't had too much luck trying to piece it all together.
> >
> > Ultimately what I want to do is to be able to have a combined view of
> the properties defined in the pom and in a profile defined in my local
> settings.xml file.  I have found a number of classes like
> "DefaultSettingsBuilder" and "DefaultProjectBuilder" but they all
> require other classes which other classes, etc...
> >
> >> -Original Message-
> >> From: Jason van Zyl [mailto:ja...@maven.org]
> >> Sent: Wednesday, August 17, 2011 3:45 PM
> >> To: Maven Users List
> >> Subject: Re: Maven Embedder
> >>
> >> A single embedder really doesn't make any sense, or at least this is
> >> what we have found working on Nexus, M2Eclipse, Hudson and a bunch
> of
> >> other tools. All of the use cases are slightly different and it is
> just
> >> easier to grab the individual components and piece them together as
> >> required. We have several small embedders for all of the tools now.
> We
> >> could probably make another one now that might be useful but the
> first
> >> form of the embedder certainly wasn't which is why it was removed.
> >>
> >> On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
> >>
> >> > Hmm. Or is the Maven Embedder no longer supported?
> >> >
> >> > http://stackoverflow.com/questions/5141788/how-to-run-maven-from-
> java
> >> >
> >> >
> >> > From: Thiessen, Todd (Todd)
> >> > Sent: Wednesday, August 17, 2011 11:27 AM
> >> > To: users@maven.apache.org
> >> > Subject: Maven Embedder
> >> >
> >> > Is there any kind of users guide for the maven embedder?  Not
> finding
> >> anything.
> >> >
> >> > I can find the source, but having to guess as to how to use the
> >> classes.
> >>
> >> Thanks,
> >>
> >> Jason
> >>
> >> --
> >> Jason van Zyl
> >> Founder,  Apache Maven
> >> http://twitter.com/jvanzyl
> >> -
> >>
> >> happiness is like a butterfly: the more you chase it, the more it
> will
> >> elude you, but if you turn your attention to other things, it will
> come
> >> and sit softly on your shoulder ...
> >>
> >>  -- Thoreau
> >>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Embedder

2011-08-18 Thread Tamás Cservenák
While you're use case is not quite clear to me ("combined view of
properties defined in pom and in profile..."), you could take a peek
at this:

https://github.com/sonatype/sisu-maven-bridge

It does offer effective pom for example...

Patches, as always, are welcome! :)


Thanks,
~t~

On Wed, Aug 17, 2011 at 10:01 PM, Thiessen, Todd (Todd)
 wrote:
> I like the idea of using only the parts of the embedder that you need.
>
> Is anything published anywhere which can list which components are available 
> for what tasks?
>
> I have been looking through the source for this artifact and its dependencies:
>
>    
>        org.apache.maven
>        maven-embedder
>        3.0.3
>    
>
> But haven't had too much luck trying to piece it all together.
>
> Ultimately what I want to do is to be able to have a combined view of the 
> properties defined in the pom and in a profile defined in my local 
> settings.xml file.  I have found a number of classes like 
> "DefaultSettingsBuilder" and "DefaultProjectBuilder" but they all require 
> other classes which other classes, etc...
>
>> -Original Message-
>> From: Jason van Zyl [mailto:ja...@maven.org]
>> Sent: Wednesday, August 17, 2011 3:45 PM
>> To: Maven Users List
>> Subject: Re: Maven Embedder
>>
>> A single embedder really doesn't make any sense, or at least this is
>> what we have found working on Nexus, M2Eclipse, Hudson and a bunch of
>> other tools. All of the use cases are slightly different and it is just
>> easier to grab the individual components and piece them together as
>> required. We have several small embedders for all of the tools now. We
>> could probably make another one now that might be useful but the first
>> form of the embedder certainly wasn't which is why it was removed.
>>
>> On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
>>
>> > Hmm. Or is the Maven Embedder no longer supported?
>> >
>> > http://stackoverflow.com/questions/5141788/how-to-run-maven-from-java
>> >
>> >
>> > From: Thiessen, Todd (Todd)
>> > Sent: Wednesday, August 17, 2011 11:27 AM
>> > To: users@maven.apache.org
>> > Subject: Maven Embedder
>> >
>> > Is there any kind of users guide for the maven embedder?  Not finding
>> anything.
>> >
>> > I can find the source, but having to guess as to how to use the
>> classes.
>>
>> Thanks,
>>
>> Jason
>>
>> --
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> -
>>
>> happiness is like a butterfly: the more you chase it, the more it will
>> elude you, but if you turn your attention to other things, it will come
>> and sit softly on your shoulder ...
>>
>>  -- Thoreau
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

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



RE: Maven Embedder

2011-08-17 Thread Thiessen, Todd (Todd)
I can volunteer some time to help make some of these components available.  I 
presume most of these components can be found in the 3.0.3 maven-embedder 
artifact?  Or is that artifact effectively deprecated and the components are 
found somewhere else?

> -Original Message-
> From: Thiessen, Todd (Todd) [mailto:tthies...@avaya.com]
> Sent: Wednesday, August 17, 2011 4:01 PM
> To: Maven Users List
> Subject: RE: Maven Embedder
> 
> I like the idea of using only the parts of the embedder that you need.
> 
> Is anything published anywhere which can list which components are
> available for what tasks?
> 
> I have been looking through the source for this artifact and its
> dependencies:
> 
> 
>   org.apache.maven
>   maven-embedder
>   3.0.3
> 
> 
> But haven't had too much luck trying to piece it all together.
> 
> Ultimately what I want to do is to be able to have a combined view of
> the properties defined in the pom and in a profile defined in my local
> settings.xml file.  I have found a number of classes like
> "DefaultSettingsBuilder" and "DefaultProjectBuilder" but they all
> require other classes which other classes, etc...
> 
> > -Original Message-
> > From: Jason van Zyl [mailto:ja...@maven.org]
> > Sent: Wednesday, August 17, 2011 3:45 PM
> > To: Maven Users List
> > Subject: Re: Maven Embedder
> >
> > A single embedder really doesn't make any sense, or at least this is
> > what we have found working on Nexus, M2Eclipse, Hudson and a bunch of
> > other tools. All of the use cases are slightly different and it is
> just
> > easier to grab the individual components and piece them together as
> > required. We have several small embedders for all of the tools now.
> We
> > could probably make another one now that might be useful but the
> first
> > form of the embedder certainly wasn't which is why it was removed.
> >
> > On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
> >
> > > Hmm. Or is the Maven Embedder no longer supported?
> > >
> > > http://stackoverflow.com/questions/5141788/how-to-run-maven-from-
> java
> > >
> > >
> > > From: Thiessen, Todd (Todd)
> > > Sent: Wednesday, August 17, 2011 11:27 AM
> > > To: users@maven.apache.org
> > > Subject: Maven Embedder
> > >
> > > Is there any kind of users guide for the maven embedder?  Not
> finding
> > anything.
> > >
> > > I can find the source, but having to guess as to how to use the
> > classes.
> >
> > Thanks,
> >
> > Jason
> >
> > --
> > Jason van Zyl
> > Founder,  Apache Maven
> > http://twitter.com/jvanzyl
> > -
> >
> > happiness is like a butterfly: the more you chase it, the more it
> will
> > elude you, but if you turn your attention to other things, it will
> come
> > and sit softly on your shoulder ...
> >
> >  -- Thoreau
> >
> >
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org


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



RE: Maven Embedder

2011-08-17 Thread Thiessen, Todd (Todd)
I like the idea of using only the parts of the embedder that you need.

Is anything published anywhere which can list which components are available 
for what tasks?

I have been looking through the source for this artifact and its dependencies:


org.apache.maven
maven-embedder
3.0.3


But haven't had too much luck trying to piece it all together.

Ultimately what I want to do is to be able to have a combined view of the 
properties defined in the pom and in a profile defined in my local settings.xml 
file.  I have found a number of classes like "DefaultSettingsBuilder" and 
"DefaultProjectBuilder" but they all require other classes which other classes, 
etc...

> -Original Message-
> From: Jason van Zyl [mailto:ja...@maven.org]
> Sent: Wednesday, August 17, 2011 3:45 PM
> To: Maven Users List
> Subject: Re: Maven Embedder
> 
> A single embedder really doesn't make any sense, or at least this is
> what we have found working on Nexus, M2Eclipse, Hudson and a bunch of
> other tools. All of the use cases are slightly different and it is just
> easier to grab the individual components and piece them together as
> required. We have several small embedders for all of the tools now. We
> could probably make another one now that might be useful but the first
> form of the embedder certainly wasn't which is why it was removed.
> 
> On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:
> 
> > Hmm. Or is the Maven Embedder no longer supported?
> >
> > http://stackoverflow.com/questions/5141788/how-to-run-maven-from-java
> >
> >
> > From: Thiessen, Todd (Todd)
> > Sent: Wednesday, August 17, 2011 11:27 AM
> > To: users@maven.apache.org
> > Subject: Maven Embedder
> >
> > Is there any kind of users guide for the maven embedder?  Not finding
> anything.
> >
> > I can find the source, but having to guess as to how to use the
> classes.
> 
> Thanks,
> 
> Jason
> 
> --
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> -
> 
> happiness is like a butterfly: the more you chase it, the more it will
> elude you, but if you turn your attention to other things, it will come
> and sit softly on your shoulder ...
> 
>  -- Thoreau
> 
> 


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



Re: Maven Embedder

2011-08-17 Thread Anders Hammar
Today, you should really use Maven 3 which is designed to be
embeddable in tools. I have no experience myself of this, but it has
been discussed a few times on this mailing list although quite some
time has passed since the last time it was brought up. You could try
searching any of the archives.
One other way is to have a look at m2eclipse code, which takes full
advantage of integrating Maven into a tool.

/Anders

PS. The Maven Embedder I believe you're asking about was based on some
old Maven 2.0 code and found impossible to maintain.

On Wed, Aug 17, 2011 at 21:35, Thiessen, Todd (Todd)
 wrote:
> Hmm. Or is the Maven Embedder no longer supported?
>
> http://stackoverflow.com/questions/5141788/how-to-run-maven-from-java
>
>
> From: Thiessen, Todd (Todd)
> Sent: Wednesday, August 17, 2011 11:27 AM
> To: users@maven.apache.org
> Subject: Maven Embedder
>
> Is there any kind of users guide for the maven embedder?  Not finding 
> anything.
>
> I can find the source, but having to guess as to how to use the classes.
>

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



Re: Maven Embedder

2011-08-17 Thread Jason van Zyl
A single embedder really doesn't make any sense, or at least this is what we 
have found working on Nexus, M2Eclipse, Hudson and a bunch of other tools. All 
of the use cases are slightly different and it is just easier to grab the 
individual components and piece them together as required. We have several 
small embedders for all of the tools now. We could probably make another one 
now that might be useful but the first form of the embedder certainly wasn't 
which is why it was removed.

On Aug 17, 2011, at 3:35 PM, Thiessen, Todd (Todd) wrote:

> Hmm. Or is the Maven Embedder no longer supported?
> 
> http://stackoverflow.com/questions/5141788/how-to-run-maven-from-java
> 
> 
> From: Thiessen, Todd (Todd)
> Sent: Wednesday, August 17, 2011 11:27 AM
> To: users@maven.apache.org
> Subject: Maven Embedder
> 
> Is there any kind of users guide for the maven embedder?  Not finding 
> anything.
> 
> I can find the source, but having to guess as to how to use the classes.

Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
-

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 





RE: Maven Embedder

2011-08-17 Thread Thiessen, Todd (Todd)
Hmm. Or is the Maven Embedder no longer supported?

http://stackoverflow.com/questions/5141788/how-to-run-maven-from-java


From: Thiessen, Todd (Todd)
Sent: Wednesday, August 17, 2011 11:27 AM
To: users@maven.apache.org
Subject: Maven Embedder

Is there any kind of users guide for the maven embedder?  Not finding anything.

I can find the source, but having to guess as to how to use the classes.


Maven Embedder

2011-08-17 Thread Thiessen, Todd (Todd)
Is there any kind of users guide for the maven embedder?  Not finding anything.

I can find the source, but having to guess as to how to use the classes.


maven embedder 3 - some documentation please...

2011-06-06 Thread deusaquilus
There are some good examples for maven embedder 2 here... but that's all
deprecated.
http://maven.apache.org/embedder.html

Could someone please change that page to show a decent example of a maven
embedder 3.0.x project? Also, if there's some documentation with a simple
embedder example, please tell me...

--
View this message in context: 
http://maven.40175.n5.nabble.com/maven-embedder-3-some-documentation-please-tp4459205p4459205.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-03-29 Thread mraible

olamy wrote:
> 
> Hello Matt.
> This doesn't exists anymore in 3.0.x.
> 
> So for the maven3 integration in Hudson/Jenkins, I have build a
> "kind"
> of embedder which you can use at least for read projects.
> It should work to read projects and resolve dependencies.
> 
> You can have a look at the unit tests here [1]
> 
> [1]
> https://github.com/jenkinsci/lib-jenkins-maven-embedder/blob/master/src/test/java/hudson/maven/TestMavenEmbedderSimpleProject.java
> 

I copied your MavenEmbedder into my project and got most of the dependencies
resolved. However, when I run it, I get the error below. I suspect this has
something to do with me trying to use the artifact-common dependency to test
artifacts.

You can see a patch of what I tried changing on the following JIRA issue.

http://issues.appfuse.org/browse/APF-1220

Any advice is greatly appreciated.

Running org.appfuse.mojo.installer.InstallArtifactsMojoTest
22:34:21,055  WARN org.sonatype.guice.bean.reflect.NamedClass - Error
injecting: org.apache.maven.profiles.DefaultMavenProfilesBuilder
java.lang.NoClassDefFoundError:
org/codehaus/plexus/util/interpolation/ValueSource
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at
com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
at
com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
at
com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628)
at
com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:835)
at
com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:769)
at
com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:254)
at
com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
at
com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:843)
at
com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:957)
at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:990)
at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:951)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
at
org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at
com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
at
com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
at
org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
at
org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
at
org.sonatype.guice.plexus.binders.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:221)
at
org.sonatype.guice.plexus.binders.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:49)
at
org.sonatype.guice.bean.inject.BeanInjector.doInjection(BeanInjector.java:105)
at
org.sonatype.guice.bean.inject.BeanInjector.injectMembers(BeanInjector.java:76)
at
com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:120)
at
com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
at
com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at
com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
at
com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
at
org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at
com.googl

RE: Maven embedder examples

2011-03-10 Thread Martin Gainty

if this is a genuine maven-plugin where is the project hosted?

Martin 
__ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.






> Date: Wed, 9 Mar 2011 23:16:12 -0800
> From: nguyenhoai...@gmail.com
> To: users@maven.apache.org
> Subject: Re: Maven embedder examples
> 
> This message is too old. Anyway I post my solution here in case someone needs
> it: 
> 
>   
>   org.apache.maven
>   maven-embedder
>   3.0-alpha-2
>   test
>   
> 
> The 3.0-alpha-2 version works for me :)
> 
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Maven-embedder-examples-tp89849p3422868.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
  

Re: Maven embedder examples

2011-03-10 Thread VietnamCoder
This message is too old. Anyway I post my solution here in case someone needs
it: 


org.apache.maven
maven-embedder
3.0-alpha-2
test


The 3.0-alpha-2 version works for me :)

--
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-embedder-examples-tp89849p3422868.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-03-07 Thread mraible
Any recommendations for developing an "embedded Maven" that will work for
both 2.x and 3.x users? My current setup works for 2.x users, but if I
upgrade to a new way for 3.x, I'm afraid it'll break 2.x support.

--
View this message in context: 
http://maven.40175.n5.nabble.com/Upgrading-maven-embedder-from-2-0-4-to-3-0-2-tp3379984p3413200.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-03-04 Thread Jason van Zyl

On Mar 4, 2011, at 2:40 AM, Anders Hammar wrote:

> "Easier" in that post isn't referring to easier to code as in fewer lines of
> code, but rather making it possible to embed in an extensible way.
> Maven 2.x was a command line tool, where Maven 3.0 has a modular design so
> that it can be embedded in tools like m2eclipse, for example. This was
> simply just not possible (in a good way) with Maven 2.x. As I understand it,
> maven-embedder stopped at 2.0.4 for Maven 2 because they ran into too many
> issues trying to get it to work with the old Maven 2 code base.
> 

Correct.

> /Anders
> 
> On Fri, Mar 4, 2011 at 06:13, mraible  wrote:
> 
>> This seems somewhat complicated - isn't there an easier way? Of the top 10
>> reasons to use Maven, #4 is it's easier to embed.
>> 
>> http://www.sonatype.com/people/2011/02/top-ten-reasons-to-move-to-maven-3/
>> 
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/Upgrading-maven-embedder-from-2-0-4-to-3-0-2-tp3379984p3408943.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>> 
>> 

Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
-

A man enjoys his work when he understands the whole and when he
is responsible for the quality of the whole

 -- Christopher Alexander, A Pattern Language





Re: Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-03-03 Thread Anders Hammar
"Easier" in that post isn't referring to easier to code as in fewer lines of
code, but rather making it possible to embed in an extensible way.
Maven 2.x was a command line tool, where Maven 3.0 has a modular design so
that it can be embedded in tools like m2eclipse, for example. This was
simply just not possible (in a good way) with Maven 2.x. As I understand it,
maven-embedder stopped at 2.0.4 for Maven 2 because they ran into too many
issues trying to get it to work with the old Maven 2 code base.

/Anders

On Fri, Mar 4, 2011 at 06:13, mraible  wrote:

> This seems somewhat complicated - isn't there an easier way? Of the top 10
> reasons to use Maven, #4 is it's easier to embed.
>
> http://www.sonatype.com/people/2011/02/top-ten-reasons-to-move-to-maven-3/
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Upgrading-maven-embedder-from-2-0-4-to-3-0-2-tp3379984p3408943.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-03-03 Thread mraible
This seems somewhat complicated - isn't there an easier way? Of the top 10
reasons to use Maven, #4 is it's easier to embed.

http://www.sonatype.com/people/2011/02/top-ten-reasons-to-move-to-maven-3/

--
View this message in context: 
http://maven.40175.n5.nabble.com/Upgrading-maven-embedder-from-2-0-4-to-3-0-2-tp3379984p3408943.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-02-11 Thread Olivier Lamy
Hello Matt.
This doesn't exists anymore in 3.0.x.

So for the maven3 integration in Hudson/Jenkins, I have build a "kind"
of embedder which you can use at least for read projects.
It should work to read projects and resolve dependencies.

You can have a look at the unit tests here [1]

HTH,
-- 
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy

[1] 
https://github.com/jenkinsci/lib-jenkins-maven-embedder/blob/master/src/test/java/hudson/maven/TestMavenEmbedderSimpleProject.java

2011/2/10 mraible :
>
> I'm trying to upgrade the dependencies of the appfuse-maven-plugin to use the
> latest Maven dependencies to solve an issue with using Maven 3.
>
> http://issues.appfuse.org/browse/APF-1220
>
> However, when I upgrade to maven-embedder 3.0.2, there's a couple classes
> missing: MavenEmbedder and MavenEmbedderConsoleLogger. I'm using these as
> indicated below.
>
>    private MavenProject createProjectFromPom(File pom) {
>        MavenEmbedder maven = new MavenEmbedder();
>        maven.setOffline(true);
>
> maven.setClassLoader(Thread.currentThread().getContextClassLoader());
>        maven.setLogger(new MavenEmbedderConsoleLogger());
>
>        MavenProject p = null;
>
>        try {
>            maven.setAlignWithUserInstallation(true);
>            maven.start();
>            p = maven.readProjectWithDependencies(pom);
>            maven.stop();
>        } catch (Exception e) {
>            e.printStackTrace();
>        }
>
>        return p;
>    }
>
> Is it possible to do something like this with 3.0.2 and will it help me
> solve this error?
>
> A required class was missing while executing
> org.appfuse.plugins:appfuse-maven-plugin:2.1.0-SNAPSHOT:full-source:
> org/codehaus/plexus/embed/Embedder
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Upgrading-maven-embedder-from-2-0-4-to-3-0-2-tp3379984p3379984.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

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



Upgrading maven-embedder from 2.0.4 to 3.0.2

2011-02-10 Thread mraible

I'm trying to upgrade the dependencies of the appfuse-maven-plugin to use the
latest Maven dependencies to solve an issue with using Maven 3.

http://issues.appfuse.org/browse/APF-1220

However, when I upgrade to maven-embedder 3.0.2, there's a couple classes
missing: MavenEmbedder and MavenEmbedderConsoleLogger. I'm using these as
indicated below.

private MavenProject createProjectFromPom(File pom) {
MavenEmbedder maven = new MavenEmbedder();
maven.setOffline(true);
   
maven.setClassLoader(Thread.currentThread().getContextClassLoader());
maven.setLogger(new MavenEmbedderConsoleLogger());

MavenProject p = null;

try {
maven.setAlignWithUserInstallation(true);
maven.start();
p = maven.readProjectWithDependencies(pom);
maven.stop();
} catch (Exception e) {
e.printStackTrace();
}

return p;
}

Is it possible to do something like this with 3.0.2 and will it help me
solve this error?

A required class was missing while executing
org.appfuse.plugins:appfuse-maven-plugin:2.1.0-SNAPSHOT:full-source:
org/codehaus/plexus/embed/Embedder 
-- 
View this message in context: 
http://maven.40175.n5.nabble.com/Upgrading-maven-embedder-from-2-0-4-to-3-0-2-tp3379984p3379984.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-11 Thread Xavier SEIGNARD
Ok thanks,
But even if I look in the maven-versions-plugin I can't find out how
to get a list of versions of a given artifact programatically from a
given grouId, artifactId, local repo and remote repos.

Do you have a code snippet or a link to a class doing it?

Regards,

Xavier

2010/3/10, Jason van Zyl :
> The embedder doesn't currently exist anymore. I'm remaking it so it's not
> there to use. If the versions plugin doesn't do what you need internally it
> finds a list of the versions so you can borrow it's code which will work in
> maven 2 or maven 3. We've preserved the use of the old apis. The embedder is
> changing and not stable right now.
>
> On Mar 10, 2010, at 8:58 AM, xavier.seign...@gmail.com wrote:
>
>> Thanks for the tips!
>> But, I don't see how can I use the maven-version-plguin to get the list of
>> all versions available of a given artifact.
>> Can you indacate me how to do it?
>>
>> And I don't wan't to make my usage of Maven embedder dependent to Nexus
>> (which is BTW a great tool).
>>
>> Thanks for your answers.
>>
>> Xavier
>>
>> Le , Jason van Zyl  a écrit :
>>> I suggest using the maven-versions-plugin:
>>
>>
>>
>>> http://mojo.codehaus.org/versions-maven-plugin/index.html
>>
>>
>>
>>> On Mar 10, 2010, at 6:39 AM, xavier.seign...@gmail.com wrote:
>>
>>
>>
>>> > Hello,
>>
>>> > I would like to know how to retrieve list of available versions of a
>>> > given plugin with the maven embedder.
>>
>>> >
>>
>>> > In input I only have a groupId, an artifactId, a local repo and a list
>>> > of remote repos.
>>
>>> >
>>
>>> > In output I would like to have a list containing all the available
>>> > versions of the given artifact from the local repo or from the remote
>>> > repos.
>>
>>> >
>>
>>> > Any idea?
>>
>>> >
>>
>>> > Regards,
>>
>>> >
>>
>>> > Xavier
>>
>>
>>
>>> Thanks,
>>
>>
>>
>>> Jason
>>
>>
>>
>>> --
>>
>>> Jason van Zyl
>>
>>> Founder, Apache Maven
>>
>>> http://twitter.com/jvanzyl
>>
>>> --
>>
>>
>>
>
> Thanks,
>
> Jason
>
> --
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> --
>
>

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



Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-10 Thread Jason van Zyl
The embedder doesn't currently exist anymore. I'm remaking it so it's not there 
to use. If the versions plugin doesn't do what you need internally it finds a 
list of the versions so you can borrow it's code which will work in maven 2 or 
maven 3. We've preserved the use of the old apis. The embedder is changing and 
not stable right now.

On Mar 10, 2010, at 8:58 AM, xavier.seign...@gmail.com wrote:

> Thanks for the tips!
> But, I don't see how can I use the maven-version-plguin to get the list of 
> all versions available of a given artifact.
> Can you indacate me how to do it?
> 
> And I don't wan't to make my usage of Maven embedder dependent to Nexus 
> (which is BTW a great tool).
> 
> Thanks for your answers.
> 
> Xavier
> 
> Le , Jason van Zyl  a écrit :
>> I suggest using the maven-versions-plugin:
> 
> 
> 
>> http://mojo.codehaus.org/versions-maven-plugin/index.html
> 
> 
> 
>> On Mar 10, 2010, at 6:39 AM, xavier.seign...@gmail.com wrote:
> 
> 
> 
>> > Hello,
> 
>> > I would like to know how to retrieve list of available versions of a given 
>> > plugin with the maven embedder.
> 
>> >
> 
>> > In input I only have a groupId, an artifactId, a local repo and a list of 
>> > remote repos.
> 
>> >
> 
>> > In output I would like to have a list containing all the available 
>> > versions of the given artifact from the local repo or from the remote 
>> > repos.
> 
>> >
> 
>> > Any idea?
> 
>> >
> 
>> > Regards,
> 
>> >
> 
>> > Xavier
> 
> 
> 
>> Thanks,
> 
> 
> 
>> Jason
> 
> 
> 
>> --
> 
>> Jason van Zyl
> 
>> Founder, Apache Maven
> 
>> http://twitter.com/jvanzyl
> 
>> --
> 
> 
> 

Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--



Re: Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-10 Thread xavier . seignard

Thanks for the tips!
But, I don't see how can I use the maven-version-plguin to get the list of  
all versions available of a given artifact.

Can you indacate me how to do it?

And I don't wan't to make my usage of Maven embedder dependent to Nexus  
(which is BTW a great tool).


Thanks for your answers.

Xavier

Le , Jason van Zyl  a écrit :

I suggest using the maven-versions-plugin:





http://mojo.codehaus.org/versions-maven-plugin/index.html





On Mar 10, 2010, at 6:39 AM, xavier.seign...@gmail.com wrote:





> Hello,


> I would like to know how to retrieve list of available versions of a  
given plugin with the maven embedder.



>


> In input I only have a groupId, an artifactId, a local repo and a list  
of remote repos.



>


> In output I would like to have a list containing all the available  
versions of the given artifact from the local repo or from the remote  
repos.



>



> Any idea?



>



> Regards,



>



> Xavier





Thanks,





Jason





--



Jason van Zyl



Founder, Apache Maven



http://twitter.com/jvanzyl



--






Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-10 Thread lukewpatterson


xavier.seignard wrote:
> 
> I would like to know how to retrieve list of available versions of a given  
> plugin with the maven embedder.
> 
> In input I only have a groupId, an artifactId, a local repo and a list of  
> remote repos.
> 
> In output I would like to have a list containing all the available
> versions  
> of the given artifact from the local repo or from the remote repos.
> 

Can't tell if you're asking about programmatic access.  If so, here is some
pseudo-code that will get you close enough:


org.codehaus.groovy.maven
gmaven-plugin
1.0


find-versions
initialize

execute



projectArtifact = project.artifact
localRepository = 
session.localRepository
remoteRepositories = 
project.remoteArtifactRepositories
artifactMetadataSource =
session.lookup('org.apache.maven.artifact.metadata.ArtifactMetadataSource')
versions =
artifactMetadataSource.retrieveAvailableVersions(projectArtifact,
localRepository, remoteRepositories)
for(version in versions){
log.info(' found version: ' + 
version)
}



    


-- 
View this message in context: 
http://old.nabble.com/-Maven-embedder--How-to-retrieve-the-list-of-available-versions-of-a--given-plugin--tp27848494p27849878.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-10 Thread Jason van Zyl
I suggest using the maven-versions-plugin:

http://mojo.codehaus.org/versions-maven-plugin/index.html

On Mar 10, 2010, at 6:39 AM, xavier.seign...@gmail.com wrote:

> Hello,
> I would like to know how to retrieve list of available versions of a given 
> plugin with the maven embedder.
> 
> In input I only have a groupId, an artifactId, a local repo and a list of 
> remote repos.
> 
> In output I would like to have a list containing all the available versions 
> of the given artifact from the local repo or from the remote repos.
> 
> Any idea?
> 
> Regards,
> 
> Xavier

Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--



Re: [Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-10 Thread Ron Wheeler
If you have Nexus installed, you can just go to the index, work your way 
down to the artifact and see all the versions that are available.


Ron

xavier.seign...@gmail.com wrote:

Hello,
I would like to know how to retrieve list of available versions of a 
given plugin with the maven embedder.


In input I only have a groupId, an artifactId, a local repo and a list 
of remote repos.


In output I would like to have a list containing all the available 
versions of the given artifact from the local repo or from the remote 
repos.


Any idea?

Regards,

Xavier




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



[Maven embedder] How to retrieve the list of available versions of a given plugin?

2010-03-10 Thread xavier . seignard

Hello,
I would like to know how to retrieve list of available versions of a given  
plugin with the maven embedder.


In input I only have a groupId, an artifactId, a local repo and a list of  
remote repos.


In output I would like to have a list containing all the available versions  
of the given artifact from the local repo or from the remote repos.


Any idea?

Regards,

Xavier


Re: Maven Embedder thread safety

2009-11-18 Thread Anders Hammar
Fabien,

Please understand that you're cutting edge here and not very many people
have this deep insight in Maven 3. Thus, getting an answer could take more
than one day, if you get one at all.
Also, the maven developer list might be more appropriate for questions like
this.

/Anders

On Wed, Nov 18, 2009 at 14:43, Fabien Coppens wrote:

> Hi folks.
> Any chance I can get an answer to those questions below ?
> Thanks.
> Fabien
>
>  Original Message ----
> Subject: Maven Embedder thread safety
> Date: Tue, 17 Nov 2009 14:45:55 +0100
> From: Fabien Coppens 
> Reply-To: Maven Users List 
> To: users@maven.apache.org
>
>
>
> Hi all.
>
> I'm using Maven Embedder 3.0-alpha-2 to execute a dependency:resolve goal
> on a
> large number of POM files (several thousand), using a Java batch runtime.
> For
> performance reasons, I use a thread pool (ThreadPoolExecutor) to
> parallelize the
> calls to the embedder's execute method.
> However, after a quick look at the code, it seems that the execute method
> is not
> thread safe, is that correct ?
>
> Secondary question : I downloaded both maven-embedder-3.0-alpha-3.jar and
> maven-embedder-3.0-alpha-4.jar, and in both jars the
> org.apache.maven.embedder
> API is missing. Any reasons why ?
>
> Fabien
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Maven Embedder thread safety

2009-11-18 Thread Fabien Coppens
Hi folks.
Any chance I can get an answer to those questions below ?
Thanks.
Fabien

 Original Message 
Subject: Maven Embedder thread safety
Date: Tue, 17 Nov 2009 14:45:55 +0100
From: Fabien Coppens 
Reply-To: Maven Users List 
To: users@maven.apache.org



Hi all.

I'm using Maven Embedder 3.0-alpha-2 to execute a dependency:resolve goal on a
large number of POM files (several thousand), using a Java batch runtime. For
performance reasons, I use a thread pool (ThreadPoolExecutor) to parallelize the
calls to the embedder's execute method.
However, after a quick look at the code, it seems that the execute method is not
thread safe, is that correct ?

Secondary question : I downloaded both maven-embedder-3.0-alpha-3.jar and
maven-embedder-3.0-alpha-4.jar, and in both jars the org.apache.maven.embedder
API is missing. Any reasons why ?

Fabien


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



Maven Embedder thread safety

2009-11-17 Thread Fabien Coppens
Hi all.

I'm using Maven Embedder 3.0-alpha-2 to execute a dependency:resolve goal on a
large number of POM files (several thousand), using a Java batch runtime. For
performance reasons, I use a thread pool (ThreadPoolExecutor) to parallelize the
calls to the embedder's execute method.
However, after a quick look at the code, it seems that the execute method is not
thread safe, is that correct ?

Secondary question : I downloaded both maven-embedder-3.0-alpha-3.jar and
maven-embedder-3.0-alpha-4.jar, and in both jars the org.apache.maven.embedder
API is missing. Any reasons why ?

Fabien

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



Re: Standalone Maven Embedder

2009-10-19 Thread Espen Wiborg
dreedyman  writes:
> Thanks for the followup. I've taken a look at m2eclipse, and I frankly
> dont see any examples of how to use embedding in a standalone
> way. Perhaps you can point me to specific references?
>
> The fundamental issue here seems to be bootstrapping the maven
> environment via the plexus container. It seems that we are either
> bound to running in a maven context, or running in Eclipse. The
> obvious requirement is running *standalone*.

You may find some help in the code I've written for my Emacs
integration; check http://github.com/espenhw/malabar-mode (and
especially
http://github.com/espenhw/malabar-mode/blob/master/src/main/groovy/org/grumblesmurf/malabar/MvnServer.groovy)
for how I do it.

I've sto.. er, "borrowed" a lot of code from 
http://svn.eu.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?view=markup

which seems to be the currently-canonical way of bootstrapping Maven.

-- 
Espen Wiborg  - Veritas vos liberabit
"Memory is like an orgasm. It's a lot better if you don't have to fake it."
  -- Seymour Cray, on virtual memory

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



Re: Standalone Maven Embedder

2009-10-16 Thread Jason van Zyl


On 2009-10-16, at 5:59 PM, dreedyman wrote:



Jason,

Thanks for the followup. I've taken a look at m2eclipse, and I  
frankly dont
see any examples of how to use embedding in a standalone way.  
Perhaps you

can point me to specific references?

The fundamental issue here seems to be bootstrapping the maven  
environment
via the plexus container. It seems that we are either bound to  
running in a
maven context, or running in Eclipse. The obvious requirement is  
running

*standalone*.

I'm being careful here to avoid a rant, but I must say that while  
I'm glad
that "it will be supported as a whole for the community", right now  
using

this project from an API perspective is not what I expected.



Let me set your expectations then.

The number one priority for 3.0 is backward compatibility and  
stability. It has been no small task and we don't have infinite time.  
Settling on a set of APIs for embedding and documenting them will take  
time. It's going to be a non-traditional approach in Maven in that  
there is going to be documentation when they are published. We have  
ripped them apart internally and we are still changing them. We are  
not prepared to answer any questions about them because we are going  
to work toward solidifying a first version and writing documentation  
and then ask for feedback. If you expect us to document everything as  
we go along and provide perfectly working example then you expected  
wrong. It's an OSS project and it moves at the speed it moves at.


What we care about is making sure all our ITs run correctly and that's  
all we care about right now. Everything else is secondary at this point.




Dennis


jvanzyl wrote:


That it won't be supported until the 3.0 betas. The APIs are still
changing and official will arrive with documentation. Until then  
there

are plenty of examples in m2eclipse. It will be supported as a whole
for the whole community when it's ready.

There is no ETA for 3.0 yet.

On 2009-10-16, at 9:06 AM, dreedyman wrote:



Wow, I cant tell you how disappointed I am. Not just that the Maven
team will
not be supporting embedding in the 3.0 betas, but the brush off of
"go read
the source code".

So when is the delivery plan for 3.0 release planned?


jvanzyl wrote:


As I've stated on the dev list the embedder, or more accurately,
embedding will not be supported in the Maven 3.0 betas. Reading the
source code, or looking at M2Eclipse are your options for now.



--
View this message in context:
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25926966.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--


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





--
View this message in context: 
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25933947.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--


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



Re: Standalone Maven Embedder

2009-10-16 Thread dreedyman

Jason,

Thanks for the followup. I've taken a look at m2eclipse, and I frankly dont
see any examples of how to use embedding in a standalone way. Perhaps you
can point me to specific references?

The fundamental issue here seems to be bootstrapping the maven environment
via the plexus container. It seems that we are either bound to running in a
maven context, or running in Eclipse. The obvious requirement is running
*standalone*. 

I'm being careful here to avoid a rant, but I must say that while I'm glad
that "it will be supported as a whole for the community", right now using
this project from an API perspective is not what I expected.

Dennis


jvanzyl wrote:
> 
> That it won't be supported until the 3.0 betas. The APIs are still  
> changing and official will arrive with documentation. Until then there  
> are plenty of examples in m2eclipse. It will be supported as a whole  
> for the whole community when it's ready.
> 
> There is no ETA for 3.0 yet.
> 
> On 2009-10-16, at 9:06 AM, dreedyman wrote:
> 
>>
>> Wow, I cant tell you how disappointed I am. Not just that the Maven  
>> team will
>> not be supporting embedding in the 3.0 betas, but the brush off of  
>> "go read
>> the source code".
>>
>> So when is the delivery plan for 3.0 release planned?
>>
>>
>> jvanzyl wrote:
>>>
>>> As I've stated on the dev list the embedder, or more accurately,
>>> embedding will not be supported in the Maven 3.0 betas. Reading the
>>> source code, or looking at M2Eclipse are your options for now.
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25926966.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
> 
> Thanks,
> 
> Jason
> 
> --
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> --
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25933947.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Standalone Maven Embedder

2009-10-16 Thread Jason van Zyl
That it won't be supported until the 3.0 betas. The APIs are still  
changing and official will arrive with documentation. Until then there  
are plenty of examples in m2eclipse. It will be supported as a whole  
for the whole community when it's ready.


There is no ETA for 3.0 yet.

On 2009-10-16, at 9:06 AM, dreedyman wrote:



Wow, I cant tell you how disappointed I am. Not just that the Maven  
team will
not be supporting embedding in the 3.0 betas, but the brush off of  
"go read

the source code".

So when is the delivery plan for 3.0 release planned?


jvanzyl wrote:


As I've stated on the dev list the embedder, or more accurately,
embedding will not be supported in the Maven 3.0 betas. Reading the
source code, or looking at M2Eclipse are your options for now.



--
View this message in context: 
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25926966.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--


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



Re: Standalone Maven Embedder

2009-10-16 Thread dreedyman

Wow, I cant tell you how disappointed I am. Not just that the Maven team will
not be supporting embedding in the 3.0 betas, but the brush off of "go read
the source code".

So when is the delivery plan for 3.0 release planned?


jvanzyl wrote:
> 
> As I've stated on the dev list the embedder, or more accurately,  
> embedding will not be supported in the Maven 3.0 betas. Reading the  
> source code, or looking at M2Eclipse are your options for now.
> 

-- 
View this message in context: 
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25926966.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Standalone Maven Embedder

2009-10-16 Thread Jason van Zyl
As I've stated on the dev list the embedder, or more accurately,  
embedding will not be supported in the Maven 3.0 betas. Reading the  
source code, or looking at M2Eclipse are your options for now.


On 2009-10-16, at 7:54 AM, dreedyman wrote:



Hi,

I am trying to use the maven-embedder outside of my Maven project  
and have

not been successful. I'm hoping someone can lend some assistance.

The code tries to get the PlexusContainer from the embedder in order  
to
lookup the ArtifactResolver, ArtifactFactory, ArtifactMetadataSource  
and

MavenProjectBuilder components.

This all works fine when testing the code from my project, but when  
trying

to use the jar (created by shade)  standalone it fails as follows:

org.apache.maven.embedder.MavenEmbedderException: Cannot lookup  
required

component.
	at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java: 
669)
	at org.apache.maven.embedder.MavenEmbedder. 
(MavenEmbedder.java:176)

at
org.rioproject.resolver.maven.MavenResolver.getClassPathFor 
(MavenResolver.java:92)
	at org.rioproject.resolver.maven.MavenResolver.main 
(MavenResolver.java:55)

Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupException 
:

Component descriptor cannot be found in the component repository
 role: org.apache.maven.Maven
 roleHint: default
classRealm: none specified
at
org.codehaus.plexus.DefaultComponentRegistry.getComponentManager 
(DefaultComponentRegistry.java:367)

at
org.codehaus.plexus.DefaultComponentRegistry.getComponent 
(DefaultComponentRegistry.java:322)

at
org.codehaus.plexus.DefaultComponentRegistry.lookup 
(DefaultComponentRegistry.java:163)

at
org.codehaus.plexus.DefaultPlexusContainer.lookup 
(DefaultPlexusContainer.java:355)
	at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java: 
641)

... 3 more

Why does this fail? Are there configuration files missing? Something  
else?


Thanks

Dennis
--
View this message in context: 
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25925809.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--


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



Standalone Maven Embedder

2009-10-16 Thread dreedyman

Hi,

I am trying to use the maven-embedder outside of my Maven project and have
not been successful. I'm hoping someone can lend some assistance.

The code tries to get the PlexusContainer from the embedder in order to
lookup the ArtifactResolver, ArtifactFactory, ArtifactMetadataSource and
MavenProjectBuilder components.

This all works fine when testing the code from my project, but when trying
to use the jar (created by shade)  standalone it fails as follows:

org.apache.maven.embedder.MavenEmbedderException: Cannot lookup required
component.
at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:669)
at 
org.apache.maven.embedder.MavenEmbedder.(MavenEmbedder.java:176)
at
org.rioproject.resolver.maven.MavenResolver.getClassPathFor(MavenResolver.java:92)
at 
org.rioproject.resolver.maven.MavenResolver.main(MavenResolver.java:55)
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Component descriptor cannot be found in the component repository
  role: org.apache.maven.Maven
  roleHint: default
classRealm: none specified
at
org.codehaus.plexus.DefaultComponentRegistry.getComponentManager(DefaultComponentRegistry.java:367)
at
org.codehaus.plexus.DefaultComponentRegistry.getComponent(DefaultComponentRegistry.java:322)
at
org.codehaus.plexus.DefaultComponentRegistry.lookup(DefaultComponentRegistry.java:163)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:355)
at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:641)
... 3 more

Why does this fail? Are there configuration files missing? Something else?

Thanks

Dennis
-- 
View this message in context: 
http://www.nabble.com/Standalone-Maven-Embedder-tp25925809p25925809.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Problem with Maven Embedder 3.0 : protocol not found error

2009-09-21 Thread Brett Porter
You need to add wagon-http-lightweight to the classpath along with the  
embedder. However, I don't think that will guarantee that this works -  
the last 3.0 embedder release is probably not stable enough.


You're better off directly using the maven-core library and  
dependencies from 2.2.1 at this stage.


- Brett

On 21/09/2009, at 10:08 PM, Fabien Coppens wrote:


Hi all.
I am trying to use Maven Embedder 3.0-alpha-2 (latest version to be  
found on the
central repository), and am running into a problem when running a  
build on a
specified POM (see code below) : the POM in question references  
artefacts which
are on our central Archiva repository, accessible by simple http,  
but the
embedder is giving me the following errors, as if it couldn't  
recognize the

protocol :

[WARNING] repository metadata for: 'snapshot com.acme.Parent:1.2- 
SNAPSHOT' could

not be retrieved from repository:
http://repo-maven-dsi/archiva/repository/releases due to an error:  
Unsupported

Protocol: '': Cannot find wagon which supports the requested protocol:

As you can see, the console reads Unsupported Protocol: ''
When I tell the embedder to build a project whose POM is available  
on my local

file system, everything works fine.

Here is the code I'm using :

package com.acme.dependencyanalyzer;

import java.io.File;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.embedder.Configuration;
import org.apache.maven.embedder.ConfigurationValidationResult;
import org.apache.maven.embedder.DefaultConfiguration;
import org.apache.maven.embedder.MavenEmbedder;
import org.apache.maven.embedder.MavenEmbedderException;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.model.Dependency;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.codehaus.plexus.PlexusContainer;

public class ArtefactManager {


private static String pomDir =
"c:devhome\\snapshots\\22.0\\VscFwk_1.7_Dev\\dev2_stg\\VscFwk";
//private static String pomDir =
"c:devhome\\workspaces\\Fabien_Workspace_Europa\\maven-dependency-plugin-2.1 
";



private static String settingsDir = "c:Documents and
Settings\\fabien_coppens\\.m2";

/**
 * @param args
 */
public static void main(String[] args) {

File user = new File(settingsDir, "settings.xml");
File baseDirectory = new File(pomDir);

System.out.println("settings file "+user.toString());
System.out.println("project dir "+baseDirectory.toString());

Configuration configuration = new DefaultConfiguration()
   .setUserSettingsFile(user)
   .setClassLoader(Thread.currentThread().getContextClassLoader 
());


ConfigurationValidationResult validationResult =
MavenEmbedder.validateConfiguration(configuration);

if (validationResult.isValid())
   {
try {
	MavenEmbedder embedder = new MavenEmbedder 
(configuration);


/*
	MavenExecutionRequest request = new  
DefaultMavenExecutionRequest()

.setBaseDirectory(baseDirectory)
	.setGoals(Arrays.asList(new String[]{"clean",  
"install"}));

*/

	MavenExecutionRequest request = defineRequest 
(baseDirectory);


MavenExecutionResult result = embedder.execute(request);

if (null == result) {
System.out.println("result is null !!");
}

if (result.hasExceptions())
{
	System.out.println("Exceptions in Maven execute  
result :

"+((Exception)result.getExceptions().get(0)).getMessage());
}

//

	// You may want to inspect the project after the  
execution.

//


MavenProject project = result.getProject();


if (null == project) {
System.out.println("project is null !!");
}

// Do something with the project

String groupId = project.getGroupId();

String artifactId = project.getArtifactId();

String version = project.getVersion();

  

Problem with Maven Embedder 3.0 : protocol not found error

2009-09-21 Thread Fabien Coppens
Hi all.
I am trying to use Maven Embedder 3.0-alpha-2 (latest version to be found on the
central repository), and am running into a problem when running a build on a
specified POM (see code below) : the POM in question references artefacts which
are on our central Archiva repository, accessible by simple http, but the
embedder is giving me the following errors, as if it couldn't recognize the
protocol :

[WARNING] repository metadata for: 'snapshot com.acme.Parent:1.2-SNAPSHOT' could
not be retrieved from repository:
http://repo-maven-dsi/archiva/repository/releases due to an error: Unsupported
Protocol: '': Cannot find wagon which supports the requested protocol:

As you can see, the console reads Unsupported Protocol: ''
When I tell the embedder to build a project whose POM is available on my local
file system, everything works fine.

Here is the code I'm using :

package com.acme.dependencyanalyzer;

import java.io.File;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.embedder.Configuration;
import org.apache.maven.embedder.ConfigurationValidationResult;
import org.apache.maven.embedder.DefaultConfiguration;
import org.apache.maven.embedder.MavenEmbedder;
import org.apache.maven.embedder.MavenEmbedderException;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.model.Dependency;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.codehaus.plexus.PlexusContainer;

public class ArtefactManager {


private static String pomDir =
"c:devhome\\snapshots\\22.0\\VscFwk_1.7_Dev\\dev2_stg\\VscFwk";
//private static String pomDir =
"c:devhome\\workspaces\\Fabien_Workspace_Europa\\maven-dependency-plugin-2.1";


private static String settingsDir = "c:Documents and
Settings\\fabien_coppens\\.m2";

/**
 * @param args
 */
public static void main(String[] args) {

File user = new File(settingsDir, "settings.xml");
File baseDirectory = new File(pomDir);

System.out.println("settings file "+user.toString());
System.out.println("project dir "+baseDirectory.toString());

Configuration configuration = new DefaultConfiguration()
.setUserSettingsFile(user)
.setClassLoader(Thread.currentThread().getContextClassLoader());

ConfigurationValidationResult validationResult =
MavenEmbedder.validateConfiguration(configuration);

if (validationResult.isValid())
{
try {
MavenEmbedder embedder = new MavenEmbedder(configuration);

/*
MavenExecutionRequest request = new 
DefaultMavenExecutionRequest()
.setBaseDirectory(baseDirectory)
.setGoals(Arrays.asList(new String[]{"clean", 
"install"}));
*/

MavenExecutionRequest request = 
defineRequest(baseDirectory);

MavenExecutionResult result = embedder.execute(request);

if (null == result) {
System.out.println("result is null !!");
}

if (result.hasExceptions())
{
System.out.println("Exceptions in Maven execute result :
"+((Exception)result.getExceptions().get(0)).getMessage());
}

//

// You may want to inspect the project after the execution.
//


MavenProject project = result.getProject();


if (null == project) {
System.out.println("project is null !!");
}

// Do something with the project

String groupId = project.getGroupId();

String artifactId = project.getArtifactId();

String version = project.getVersion();

String name = project.getName();

List dependencies = project.getDependencies();

if (null != dependencies) {
System.out.println("Number of project dependencies :
"+dependencies.size());
for (Iterator i = dependencies.iterator(); 
i.hasNext();) {
   

updating dependencyManagement section in pom.xml using Maven Embedder

2009-04-13 Thread Sankaran, Nambi
Hi
 
I need to change the versions of dependencies in dependencyManagement in
my super pom for each new release.
So, I am doing that using MavenEmbedder.
when the pom.xml is saved back to the disk, the maven expressions are
replaced by actual values based on the project.
 
 
MavenEmbedder embedder = new MavenEmbedder(configuration);

MavenEmbedderLogger logger = new MavenEmbedderConsoleLogger();

embedder.setLogger(logger);



MavenProject project = embedder.readProject( new File(pomFilePath) );



// set the version

project.setVersion(version);



// get the distributionManagement Section

DistributionManagement distributionMgmt=
project.getDistributionManagement();



// update the URL for distributionMgmt

DeploymentRepository repository = new DeploymentRepository();

repository.setUrl(repositoryUrl );

distributionMgmt.setRepository(repository);



 

// write the pom file

BufferedWriter writer = new BufferedWriter(new FileWriter( pomFilePath
));

project.writeModel(writer);

 
 
What is the best way to update dependencyManagement section using maven
embedder?
 
Thanks
Nambi
 


Re: Maven Embedder and phase bindings

2009-04-03 Thread Jason van Zyl


On 3-Apr-09, at 12:24 PM, Ford, Mark wrote:

I am attempting to execute a clean and install for a project through  
the Maven Embedder (3.0-alpha-2). The build runs without any error  
but there are a number of mojo's that are never executed. For  
example: resources, compile, jar, etc. I only see the output for  
clean and install but nothing in between. If I run mvn from the  
command line then everything works as expected. The code that is not  
working is executing from a junit test from within eclipse.


I spent a fair amount of time debugging through the source and it  
appears that the bindings for these mojos are never making it into  
the phases. If I explicitly include mojos like resources:resources  
or compiler:compile in the MavenExecutionRequest that I pass to  
MavenEmbedder then they will execute. My assumption is that there is  
something failing during the discovery of plugins such that these  
default bindings aren't being attached to the lifecycle.




That all works according to the integration tests.


Any insight here would be appreciated.



Can't help you without a full working test project so that I can  
reproduce the problem.


Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
--

Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.

 -- Eric Hoffer, Reflections on the Human Condition


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



Maven Embedder and phase bindings

2009-04-03 Thread Ford, Mark
I am attempting to execute a clean and install for a project through the Maven 
Embedder (3.0-alpha-2). The build runs without any error but there are a number 
of mojo's that are never executed. For example: resources, compile, jar, etc. I 
only see the output for clean and install but nothing in between. If I run mvn 
from the command line then everything works as expected. The code that is not 
working is executing from a junit test from within eclipse.

I spent a fair amount of time debugging through the source and it appears that 
the bindings for these mojos are never making it into the phases. If I 
explicitly include mojos like resources:resources or compiler:compile in the 
MavenExecutionRequest that I pass to MavenEmbedder then they will execute. My 
assumption is that there is something failing during the discovery of plugins 
such that these default bindings aren't being attached to the lifecycle.

Any insight here would be appreciated.


Re: Maven Embedder - Jar in official repo is too old

2009-01-23 Thread Jim Shingler

The repository below requires a userid and password, . . .  do you have
public repository, . . .  I have a need for maven embedder too.



Jason van Zyl-2 wrote:
> 
> Take it from the CI system, there is no official release.
> 
> http://ci.sonatype.org/view/Maven%203.0.x/job/maven-3.0.x-bootstrap/
> 
> On 4-Sep-08, at 9:00 AM, Kem Elbrader wrote:
> 
>> I'm also interested in using maven embedder and don't know which
>> version to use and where to find it. I had been using 2.1-SNAPSHOT
>> from the snapshot repo but it seems to no longer be available.
>>
>> On Wed, Sep 3, 2008 at 1:12 PM, Shalin Shekhar Mangar
>>  wrote:
>>> Hello,
>>>
>>> I'm trying to embed Maven in my application. I've looked at the Maven
>>> embedded mini-guide at
>>> http://maven.apache.org/guides/mini/guide-embedding-m2.html
>>>
>>> The latest version of maven-embedded at the main repository is  
>>> 2.0.4 (
>>> http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/ ).  
>>> However,
>>> that version seems to be very old and many of the classes and  
>>> methods used
>>> in the example snippet on the guide page do not exist in that  
>>> version.
>>>
>>> Where can I find the most recent stable release 2.0.9 version for
>>> maven-embedded? Is it not hosted on any repository?
>>>
>>> --
>>> Regards,
>>> Shalin Shekhar Mangar.
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
> 
> Thanks,
> 
> Jason
> 
> --
> Jason van Zyl
> Founder,  Apache Maven
> jason at sonatype dot com
> --
> 
> Our achievements speak for themselves. What we have to keep track
> of are our failures, discouragements and doubts. We tend to forget
> the past difficulties, the many false starts, and the painful
> groping. We see our past achievements as the end result of a
> clean forward thrust, and our present difficulties as
> signs of decline and decay.
> 
>   -- Eric Hoffer, Reflections on the Human Condition
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Maven-Embedder---Jar-in-official-repo-is-too-old-tp837106p2204756.html
Sent from the maven users mailing list archive at Nabble.com.


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



Is there an actual version of the maven-embedder for 2.0.x?

2008-11-12 Thread Marco Huber

Hi all,

I am looking for an actual version of the maven-embedder for the 2.0.x tree.
In the central repository there is only a maven-embedder for 2.0.4.  
But this version seems to be a big buggy. After searching the internet  
the error occures are the same that occured in maven 2.0.4 version. So  
I want to use a newer one.


I would build it by myself, but if I look in the source repository I  
can only find the maven-embedder project for the 3.x trunk. But I  
don't want to use a development version, if it is not necessary.


Is there a way to get an actual version of the maven-embedder?

Thank your for your help.
Marco




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



Re: Maven Embedder - Jar in official repo is too old

2008-09-04 Thread Jason van Zyl

Take it from the CI system, there is no official release.

http://ci.sonatype.org/view/Maven%203.0.x/job/maven-3.0.x-bootstrap/

On 4-Sep-08, at 9:00 AM, Kem Elbrader wrote:


I'm also interested in using maven embedder and don't know which
version to use and where to find it. I had been using 2.1-SNAPSHOT
from the snapshot repo but it seems to no longer be available.

On Wed, Sep 3, 2008 at 1:12 PM, Shalin Shekhar Mangar
<[EMAIL PROTECTED]> wrote:

Hello,

I'm trying to embed Maven in my application. I've looked at the Maven
embedded mini-guide at
http://maven.apache.org/guides/mini/guide-embedding-m2.html

The latest version of maven-embedded at the main repository is  
2.0.4 (
http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/ ).  
However,
that version seems to be very old and many of the classes and  
methods used
in the example snippet on the guide page do not exist in that  
version.


Where can I find the most recent stable release 2.0.9 version for
maven-embedded? Is it not hosted on any repository?

--
Regards,
Shalin Shekhar Mangar.



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



Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
--

Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.

 -- Eric Hoffer, Reflections on the Human Condition


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



Re: Maven Embedder - Jar in official repo is too old

2008-09-04 Thread Kem Elbrader
I'm also interested in using maven embedder and don't know which
version to use and where to find it. I had been using 2.1-SNAPSHOT
from the snapshot repo but it seems to no longer be available.

On Wed, Sep 3, 2008 at 1:12 PM, Shalin Shekhar Mangar
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm trying to embed Maven in my application. I've looked at the Maven
> embedded mini-guide at
> http://maven.apache.org/guides/mini/guide-embedding-m2.html
>
> The latest version of maven-embedded at the main repository is 2.0.4 (
> http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/ ). However,
> that version seems to be very old and many of the classes and methods used
> in the example snippet on the guide page do not exist in that version.
>
> Where can I find the most recent stable release 2.0.9 version for
> maven-embedded? Is it not hosted on any repository?
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

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



Maven Embedder - Jar in official repo is too old

2008-09-03 Thread Shalin Shekhar Mangar
Hello,

I'm trying to embed Maven in my application. I've looked at the Maven
embedded mini-guide at
http://maven.apache.org/guides/mini/guide-embedding-m2.html

The latest version of maven-embedded at the main repository is 2.0.4 (
http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/ ). However,
that version seems to be very old and many of the classes and methods used
in the example snippet on the guide page do not exist in that version.

Where can I find the most recent stable release 2.0.9 version for
maven-embedded? Is it not hosted on any repository?

-- 
Regards,
Shalin Shekhar Mangar.


Re: Maven Embedder 2.1-SNAPSHOT

2008-08-12 Thread Kem Elbrader
Yeah, that'd be great. Development on one of our projects has been put
on hold after we purged our local repositories and our instance of
nexus. After the snapshots were removed from
http://people.apache.org/repo/m2-snapshot-repository we were lost :)

On Tue, Aug 12, 2008 at 11:26 AM, Jason van Zyl <[EMAIL PROTECTED]> wrote:
> Go to the Hudson job, for example here:
>
> http://ci.sonatype.org/view/Maven%203.0.x/job/maven-3.0.x-bootstrap/
>
> And then navigate into the workspace:
>
> http://ci.sonatype.org/view/Maven%203.0.x/job/maven-3.0.x-bootstrap/ws/trunk/maven-embedder/target/
>
> I can publish these to Nexus where you can consume them if you want them.
>
> On 11-Aug-08, at 9:34 AM, Kem Elbrader wrote:
>
>> What happened to the maven embedder 2.1 snapshot?
>>
>> http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
>> Is it going to be deployed again?
>> Is there another repository that has it deployed?
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
> Thanks,
>
> Jason
>
> --
> Jason van Zyl
> Founder,  Apache Maven
> jason at sonatype dot com
> --
>
> Our achievements speak for themselves. What we have to keep track
> of are our failures, discouragements and doubts. We tend to forget
> the past difficulties, the many false starts, and the painful
> groping. We see our past achievements as the end result of a
> clean forward thrust, and our present difficulties as
> signs of decline and decay.
>
>  -- Eric Hoffer, Reflections on the Human Condition
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Maven Embedder 2.1-SNAPSHOT

2008-08-12 Thread Jason van Zyl

Go to the Hudson job, for example here:

http://ci.sonatype.org/view/Maven%203.0.x/job/maven-3.0.x-bootstrap/

And then navigate into the workspace:

http://ci.sonatype.org/view/Maven%203.0.x/job/maven-3.0.x-bootstrap/ws/trunk/maven-embedder/target/

I can publish these to Nexus where you can consume them if you want  
them.


On 11-Aug-08, at 9:34 AM, Kem Elbrader wrote:


What happened to the maven embedder 2.1 snapshot?
http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
Is it going to be deployed again?
Is there another repository that has it deployed?

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



Thanks,

Jason

--
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
--

Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.

 -- Eric Hoffer, Reflections on the Human Condition


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



Re: Maven Embedder 2.1-SNAPSHOT

2008-08-11 Thread Kem Elbrader
Great, thanks.

On Mon, Aug 11, 2008 at 11:01 AM, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 11, 2008 at 9:34 AM, Kem Elbrader
> <[EMAIL PROTECTED]> wrote:
>> What happened to the maven embedder 2.1 snapshot?
>> http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
>> Is it going to be deployed again?
>> Is there another repository that has it deployed?
>
> Since this is about unreleased (snapshot) code, the development list
> would be a better place to ask.  You can find subscription and archive
> info here:  http://maven.apache.org/mail-lists.html
>
> (Old snapshots were removed recently to free up disk space.  And if
> you're using 2.1 snapshots you'll be interested in the "Versioning
> Maven" discussion currently going on.)
>
> --
> Wendy
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Maven Embedder 2.1-SNAPSHOT

2008-08-11 Thread Wendy Smoak
On Mon, Aug 11, 2008 at 9:34 AM, Kem Elbrader
<[EMAIL PROTECTED]> wrote:
> What happened to the maven embedder 2.1 snapshot?
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
> Is it going to be deployed again?
> Is there another repository that has it deployed?

Since this is about unreleased (snapshot) code, the development list
would be a better place to ask.  You can find subscription and archive
info here:  http://maven.apache.org/mail-lists.html

(Old snapshots were removed recently to free up disk space.  And if
you're using 2.1 snapshots you'll be interested in the "Versioning
Maven" discussion currently going on.)

-- 
Wendy

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



Maven Embedder 2.1-SNAPSHOT

2008-08-11 Thread Kem Elbrader
What happened to the maven embedder 2.1 snapshot?
http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
Is it going to be deployed again?
Is there another repository that has it deployed?

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



maven embedder provided properties?

2008-08-04 Thread Lachlan Deck

Hi there,

just wondering if there's any properties made available to the maven  
embedder when inside eclipse?


I'm wondering as I'd like to have a profile that's activated if  
detected that it's running within eclipse.
Just trying to save having to define the profile within the gui for  
each project :-)


Thanks

with regards,
--

Lachlan Deck




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



Re: Documentation and/or examples for Maven Embedder

2008-04-10 Thread Henrique Prange

Hi Bill,

The newest version of the embedder was not released yet.

Look here [1]. I think you can find a way to solve your problems without 
having to make use of the Maven embedder.


[1]http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook

Cheers,

Henrique

Bill Rye wrote:

I'm looking for something beyond
http://maven.apache.org/guides/mini/guide-embedding-m2.html
as I want to do things like read pom.xml (done), add a jar to the
repository, and get the URL for the
location of a jar in the local repository given the artifact.

Thanks,
Bill



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



Documentation and/or examples for Maven Embedder

2008-04-10 Thread Bill Rye
I'm looking for something beyond
http://maven.apache.org/guides/mini/guide-embedding-m2.html
as I want to do things like read pom.xml (done), add a jar to the
repository, and get the URL for the
location of a jar in the local repository given the artifact.

Thanks,
Bill


How to get DependencyTreeBuilder in maven-embedder?

2008-03-13 Thread Peter Niederwieser

Hi,

I'm using maven-embedder (2.1) to analyze dependencies in our POMs.
MavenEmbedder.readProjectWithDependencies() doesn't give me all the
information I'm looking for.
org.apache.maven.shared.dependency.tree.DependencyTreeBuilder looks like a
better fit for my needs. But, how can I construct/retrieve a
DependencyTreeBuilder in maven-embedder?
-- 
View this message in context: 
http://www.nabble.com/How-to-get-DependencyTreeBuilder-in-maven-embedder--tp16025222s177p16025222.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Where did the maven-embedder go?

2008-01-04 Thread Graham Leggett

Tom Huybrechts wrote:


You can find snapshots here:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
Use the ueber jar, that includes all the dependencies.

I think you can still use new DefaultArtifactRepository() with the embedder,
as mentioned in the mojo developer cookbook.


Let me take a look, thanks for pointing me in the right direction.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Where did the maven-embedder go?

2008-01-04 Thread Tom Huybrechts
You can find snapshots here:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/maven-embedder/2.1-SNAPSHOT/
Use the ueber jar, that includes all the dependencies.

I think you can still use new DefaultArtifactRepository() with the embedder,
as mentioned in the mojo developer cookbook.

On Jan 4, 2008 9:49 PM, Nick Stolwijk <[EMAIL PROTECTED]> wrote:

> I don't think it is in the maven repo yet, as Maven 2.1 is not released
> yet. The trunk version is here:
> https://svn.apache.org/repos/asf/maven/components/trunk/maven-embedder/
>
> Hth,
>
> Nick Stolwijk
>
> Graham Leggett wrote:
> > Nick Stolwijk wrote:
> >
> >> It seems it got deleted between 2.0.5 and 2.0.6 with the following
> >> checkins:
> >>
> >> r521488 | jvanzyl | 2007-03-22 22:56:42 +0100 (Thu, 22 Mar 2007) | 3
> >> lines
> >> Changed paths:
> >>   D /maven/components/branches/maven-2.0.x/maven-embedder
> >>
> >> o i looked at trying to back port and it's not worth it the trunk
> >> version is light years ahead and
> >>  the alpha 2.1 will be out shortly.
> >
> > Anyone know where I might find "the trunk version" in svn, or even
> > better, in the maven repo?
> >
> > Regards,
> > Graham
> > --
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Where did the maven-embedder go?

2008-01-04 Thread Nick Stolwijk
I don't think it is in the maven repo yet, as Maven 2.1 is not released 
yet. The trunk version is here: 
https://svn.apache.org/repos/asf/maven/components/trunk/maven-embedder/


Hth,

Nick Stolwijk

Graham Leggett wrote:

Nick Stolwijk wrote:

It seems it got deleted between 2.0.5 and 2.0.6 with the following 
checkins:


r521488 | jvanzyl | 2007-03-22 22:56:42 +0100 (Thu, 22 Mar 2007) | 3 
lines

Changed paths:
  D /maven/components/branches/maven-2.0.x/maven-embedder

o i looked at trying to back port and it's not worth it the trunk 
version is light years ahead and

 the alpha 2.1 will be out shortly.


Anyone know where I might find "the trunk version" in svn, or even 
better, in the maven repo?


Regards,
Graham
--


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



Re: Where did the maven-embedder go?

2008-01-04 Thread Graham Leggett

Nick Stolwijk wrote:

It seems it got deleted between 2.0.5 and 2.0.6 with the following 
checkins:


r521488 | jvanzyl | 2007-03-22 22:56:42 +0100 (Thu, 22 Mar 2007) | 3 lines
Changed paths:
  D /maven/components/branches/maven-2.0.x/maven-embedder

o i looked at trying to back port and it's not worth it the trunk 
version is light years ahead and

 the alpha 2.1 will be out shortly.


Anyone know where I might find "the trunk version" in svn, or even 
better, in the maven repo?


Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Where did the maven-embedder go?

2008-01-04 Thread Graham Leggett

Tom Huybrechts wrote:


[1] I am trying to use the maven-artifact API to download artifacts from
my maven repository. Trouble is, I cannot find the formal way to create
ArtifactRepository objects.



http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook

- create a DefaultArtifactRepository object
- or have it injected in a plugin field


This looks like info that you would need if you were writing a plugin to 
be embedded within maven, meanwhile I am trying to get maven-artifact 
embedded in an external application.


The docs here are pretty much exactly what I need:

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

Trouble is, none of the code listed in this guide exists any more, and 
Google finds no discussion about where it went.


Anyone know?

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Where did the maven-embedder go?

2008-01-04 Thread Nick Stolwijk

It seems it got deleted between 2.0.5 and 2.0.6 with the following checkins:

r521488 | jvanzyl | 2007-03-22 22:56:42 +0100 (Thu, 22 Mar 2007) | 3 lines
Changed paths:
  D /maven/components/branches/maven-2.0.x/maven-embedder

o i looked at trying to back port and it's not worth it the trunk 
version is light years ahead and

 the alpha 2.1 will be out shortly.


r521489 | jvanzyl | 2007-03-22 22:56:55 +0100 (Thu, 22 Mar 2007) | 2 lines
Changed paths:
  D /maven/components/branches/maven-2.0.x/maven-embedder-it

o ditto

I don't know why, though.

Hth,

Nick Stolwijk


Graham Leggett wrote:

Hi all,

I have been looking for details on how to embed maven functionality in 
an application[1], and so far the maven-embedder seems to be what I 
need, described here:


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

The guide makes no mention of what jars are needed to make the 
embedder work, and the example code chopped off the imports, so no 
hints there.


Looking in the maven repo itself, I find 4 different versions of 
maven-embedder, here:


http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/

The most recent version is from maven v2.0.4. Has the maven-embedder 
been abandoned since then?


Anyone know where it is?

[1] I am trying to use the maven-artifact API to download artifacts 
from my maven repository. Trouble is, I cannot find the formal way to 
create ArtifactRepository objects.


Regards,
Graham
--


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



Re: Where did the maven-embedder go?

2008-01-04 Thread Tom Huybrechts
>
>
> [1] I am trying to use the maven-artifact API to download artifacts from
> my maven repository. Trouble is, I cannot find the formal way to create
> ArtifactRepository objects.
>

http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook

- create a DefaultArtifactRepository object
- or have it injected in a plugin field

Tom

>
> Regards,
> Graham
> --
>


Where did the maven-embedder go?

2008-01-04 Thread Graham Leggett

Hi all,

I have been looking for details on how to embed maven functionality in 
an application[1], and so far the maven-embedder seems to be what I 
need, described here:


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

The guide makes no mention of what jars are needed to make the embedder 
work, and the example code chopped off the imports, so no hints there.


Looking in the maven repo itself, I find 4 different versions of 
maven-embedder, here:


http://repo1.maven.org/maven2/org/apache/maven/maven-embedder/

The most recent version is from maven v2.0.4. Has the maven-embedder 
been abandoned since then?


Anyone know where it is?

[1] I am trying to use the maven-artifact API to download artifacts from 
my maven repository. Trouble is, I cannot find the formal way to create 
ArtifactRepository objects.


Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


maven embedder: build up model with transitive dependencies

2007-12-22 Thread aldana

hi,

i am using maven embedder access maven from outside application. for testing
purposes i want to build a model-instance with transitive dependencies, but
am unsure how to do this. first i thought that 

MavenProject mp=new MavenProject();
mp.setDependencies(...);

would do this. but after having a look at source code it follows
MavenProject.setDependencies(List) and type Dependency is not
implemented as CompositePattern, so transitive dependency cannot be
expressed through setDependencies. maybe transitive dependencies do get
build up through MavenProject.setArtifacts(List)? though Artifact
does not look as a Composite to me either...


so how do i build a MavenProject instance with transitive dependency
(example dependency a->b->c)? some code snippets (similar to above) would be
cool.

thanks.

-- 
View this message in context: 
http://www.nabble.com/maven-embedder%3A-build-up-model-with-transitive-dependencies-tp14469529s177p14469529.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



[MAVEN EMBEDDER]

2007-11-28 Thread João Kreuzberg
Hello guys,

I'm having a hard time trying to run goals with maven embedder.

Tried the exact code from this site
http://maven.apache.org/guides/mini/guide-embedding-m2.html

but didn't work.

Here is the code I tried.


---
File projectDirectory = new File( "E:/workspace/runtime-EclipseApplication",
"test" );

File user = new File( "d:/dev/tools/maven-2.0.7/conf/settings.xml"
);

Configuration configuration = new DefaultConfiguration()
.setUserSettingsFile( user )
.setClassLoader( Thread.currentThread().getContextClassLoader()
);

ConfigurationValidationResult validationResult =
MavenEmbedder.validateConfiguration( configuration );

if ( validationResult.isValid() )
{
MavenEmbedder embedder = new MavenEmbedder( configuration
);

MavenExecutionRequest request = new
DefaultMavenExecutionRequest()
.setBaseDirectory( projectDirectory )
.setGoals( Arrays.asList( new String[]{"clean", "compile"}))
.setShowErrors(true);


MavenExecutionResult result = embedder.execute( request );

//

// You may want to inspect the project after the execution.
//


MavenProject project = result.getMavenProject();

// Do something with the project

String groupId = project.getGroupId();

String artifactId = project.getArtifactId();

String version = project.getVersion();

String name = project.getName();

String environment = project.getProperties().getProperty(
"environment" );

System.out.println( "You are working in the '" + environment +
"' environment!" );
}

---


Am I missing something?



Here is the error

---

[INFO] Scanning for projects...
[INFO]

[INFO] Building Project com.test
[INFO]task-segment: [compile]
[INFO]

[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] null
[INFO]

[INFO] Trace
org.apache.maven.BuildFailureException
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:308)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:124)
at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java
:906)
at com.test.maven.TestProjectFactory.main(TestProjectFactory.java:471)
Caused by: java.lang.NullPointerException
at
org.apache.maven.profiles.activation.JdkPrefixProfileActivator.isActive(
JdkPrefixProfileActivator.java:51)
at org.apache.maven.profiles.DefaultProfileManager.isActive(
DefaultProfileManager.java:263)
at org.apache.maven.profiles.DefaultProfileManager.getActiveProfiles(
DefaultProfileManager.java:210)
at
org.apache.maven.project.build.profile.DefaultProfileAdvisor.getArtifactRepositoriesFromActiveProfiles
(DefaultProfileAdvisor.java:157)
at
org.apache.maven.project.build.model.DefaultModelLineageBuilder.loadActiveProfileRepositories
(DefaultModelLineageBuilder.java:283)
at
org.apache.maven.project.build.model.DefaultModelLineageBuilder.updateRepositorySet
(DefaultModelLineageBuilder.java:239)
at
org.apache.maven.project.build.model.DefaultModelLineageBuilder.resumeBuildingModelLineage
(DefaultModelLineageBuilder.java:155)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(
DefaultMavenProjectBuilder.java:1053)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(
DefaultMavenProjectBuilder.java:719)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(
DefaultMavenProjectBuilder.java:236)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(
MavenMetadataSource.java:115)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(
DefaultArtifactCollector.java:344)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(
DefaultArtifactCollector.java:372)
a

[CREATE:ARCHETYPE - MAVEN EMBEDDER BUG]

2007-08-09 Thread João Kreuzberg
Hi

I actually don't have a pom.xml yet, cause I'm running archetype:create for
creating the new project and  the pom.xml

Embedder doesn't care about user.dir or basedir parameters.

You guys think that is a bug?

Regards,

João Kreuzberg

On 8/9/07, Brett Porter <[EMAIL PROTECTED]> wrote:
>
> I think that the embedder might re-set user.dir to the location of the
> POM (though you seem to be setting that yourself to the same location,
> so I'm not sure why that would be a problem...)
>
> Not sure that helps, just a thought.
>
> - Brett
>
> On 09/08/07, Maria Odea Ching <[EMAIL PROTECTED]> wrote:
> > Hi Joao,
> >
> > I'm not sure what the problem is.. the configuration below seems to be
> > correct.
> >
> > -Deng
> >
> > João Kreuzberg wrote:
> > > Maria,
> > >
> > > I tried the user.dir within the command line and it works just fine.
> > >
> > > When I try to execute it using maven-embedder
> > >
> > > it just ignores the base directory.
> > >
> > > Here is how I'm using it:
> > >
> > > MavenExecutionRequest executionRequest = new
> > > DefaultMavenExecutionRequest();
> > >
> > > executionRequest.setGoals(Arrays
> > > .asList(new String[] { "archetype:create" }));
> > >
> > > Properties params = new Properties();
> > >
> > > params.put("groupId", groupId);
> > > params.put("artifactId", artifactId);
> > > params.put("version", version == null ? "1.0" : version);
> > > params.put("archetypeGroupId", archetypeGroupId);
> > > params.put("archetypeArtifactId", archetypeArtifactId);
> > > params.put("archetypeVersion", archetypeVersion);
> > > params.put("remoteRepositories", remoteRepo);
> > > params.put("user.dir", validProjectLocation);
> > >
> > > executionRequest.setProperties(params);
> > >
> > > executionRequest.setBaseDirectory(new
> File(validProjectLocation));
> > >
> > > MavenExecutionResult result = this.getEmbedder
> > > ().execute(executionRequest);
> > >
> > >
> > > in this case, validProjectLocation  is E:\myproject
> > >
> > > but this is what I get on the console
> > >
> > > [INFO] Parameter: groupId, Value: com.myproject
> > > [INFO] Parameter: packageName, Value: com.myproject
> > > [INFO] Parameter: basedir, Value: C:\dev\eclipse
> > > [INFO] Parameter: package, Value: com.myproject
> > > [INFO] Parameter: version, Value: 1.0
> > > [INFO] Parameter: artifactId, Value: myproject
> > > [INFO] * End of debug info from resources from
> generated
> > > POM ***
> > >
> > > It's ignoring the user.dir parameter
> > >
> > > I also tried basedir instead, but does not work
> > >
> > > Am I missing something?
> > >
> > > Best Regards,
> > >
> > > João Kreuzberg
> > >
> > > On 8/7/07, João Kreuzberg <[EMAIL PROTECTED]> wrote:
> > >
> > >> YES,
> > >>
> > >> that works :)
> > >>
> > >> Thanks so much,
> > >>
> > >> Best regards,
> > >>
> > >> João Kreuzberg
> > >>
> > >> On 8/7/07, Maria Odea Ching < [EMAIL PROTECTED]> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> You've got the wrong parameter name.. it should be user.dir instead
> of
> > >>> basedir.
> > >>>
> > >>> HTH,
> > >>> Deng
> > >>>
> > >>> João Kreuzberg wrote:
> > >>>
> > >>>> Hello guys,
> > >>>>
> > >>>> I'm having a problem with create:archetype
> > >>>>
> > >>>> on the site is says it has a -Dbasedir parameter
> > >>>> but it doesn't seems to work
> > >>>> I tried mvn archetype:create -DgroupId=joao -DartifactId=joao
> > >>>>
> > >>> -Dbasedir=C:\
> > >>>
> > >>>> but it does not create the project on the specified dir
> > >>>> it creates on the current dir
> > >>>> any thoughts?
> > >>>>
> > >>>> Best regards,
> > >>>>
> > >>>>
> > >>>>
> > >>>
> -
> > >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>
> > >>>
> > >>>
> > >> --
> > >> João Kreuzberg
> > >>
> > >
> > >
> > >
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Brett Porter
> Blog: http://www.devzuz.org/blogs/bporter/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
João Kreuzberg


Re: [CREATE:ARCHETYPE - MAVEN EMBEDDER]

2007-08-08 Thread Brett Porter
I think that the embedder might re-set user.dir to the location of the
POM (though you seem to be setting that yourself to the same location,
so I'm not sure why that would be a problem...)

Not sure that helps, just a thought.

- Brett

On 09/08/07, Maria Odea Ching <[EMAIL PROTECTED]> wrote:
> Hi Joao,
>
> I'm not sure what the problem is.. the configuration below seems to be
> correct.
>
> -Deng
>
> João Kreuzberg wrote:
> > Maria,
> >
> > I tried the user.dir within the command line and it works just fine.
> >
> > When I try to execute it using maven-embedder
> >
> > it just ignores the base directory.
> >
> > Here is how I'm using it:
> >
> > MavenExecutionRequest executionRequest = new
> > DefaultMavenExecutionRequest();
> >
> > executionRequest.setGoals(Arrays
> > .asList(new String[] { "archetype:create" }));
> >
> > Properties params = new Properties();
> >
> > params.put("groupId", groupId);
> > params.put("artifactId", artifactId);
> > params.put("version", version == null ? "1.0" : version);
> > params.put("archetypeGroupId", archetypeGroupId);
> > params.put("archetypeArtifactId", archetypeArtifactId);
> > params.put("archetypeVersion", archetypeVersion);
> > params.put("remoteRepositories", remoteRepo);
> > params.put("user.dir", validProjectLocation);
> >
> > executionRequest.setProperties(params);
> >
> > executionRequest.setBaseDirectory(new File(validProjectLocation));
> >
> > MavenExecutionResult result = this.getEmbedder
> > ().execute(executionRequest);
> >
> >
> > in this case, validProjectLocation  is E:\myproject
> >
> > but this is what I get on the console
> >
> > [INFO] Parameter: groupId, Value: com.myproject
> > [INFO] Parameter: packageName, Value: com.myproject
> > [INFO] Parameter: basedir, Value: C:\dev\eclipse
> > [INFO] Parameter: package, Value: com.myproject
> > [INFO] Parameter: version, Value: 1.0
> > [INFO] Parameter: artifactId, Value: myproject
> > [INFO] * End of debug info from resources from generated
> > POM ***
> >
> > It's ignoring the user.dir parameter
> >
> > I also tried basedir instead, but does not work
> >
> > Am I missing something?
> >
> > Best Regards,
> >
> > João Kreuzberg
> >
> > On 8/7/07, João Kreuzberg <[EMAIL PROTECTED]> wrote:
> >
> >> YES,
> >>
> >> that works :)
> >>
> >> Thanks so much,
> >>
> >> Best regards,
> >>
> >> João Kreuzberg
> >>
> >> On 8/7/07, Maria Odea Ching < [EMAIL PROTECTED]> wrote:
> >>
> >>> Hi,
> >>>
> >>> You've got the wrong parameter name.. it should be user.dir instead of
> >>> basedir.
> >>>
> >>> HTH,
> >>> Deng
> >>>
> >>> João Kreuzberg wrote:
> >>>
> >>>> Hello guys,
> >>>>
> >>>> I'm having a problem with create:archetype
> >>>>
> >>>> on the site is says it has a -Dbasedir parameter
> >>>> but it doesn't seems to work
> >>>> I tried mvn archetype:create -DgroupId=joao -DartifactId=joao
> >>>>
> >>> -Dbasedir=C:\
> >>>
> >>>> but it does not create the project on the specified dir
> >>>> it creates on the current dir
> >>>> any thoughts?
> >>>>
> >>>> Best regards,
> >>>>
> >>>>
> >>>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >> --
> >> João Kreuzberg
> >>
> >
> >
> >
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Brett Porter
Blog: http://www.devzuz.org/blogs/bporter/

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



Re: [CREATE:ARCHETYPE - MAVEN EMBEDDER]

2007-08-08 Thread Maria Odea Ching

Hi Joao,

I'm not sure what the problem is.. the configuration below seems to be 
correct.


-Deng

João Kreuzberg wrote:

Maria,

I tried the user.dir within the command line and it works just fine.

When I try to execute it using maven-embedder

it just ignores the base directory.

Here is how I'm using it:

MavenExecutionRequest executionRequest = new
DefaultMavenExecutionRequest();

executionRequest.setGoals(Arrays
.asList(new String[] { "archetype:create" }));

Properties params = new Properties();

params.put("groupId", groupId);
params.put("artifactId", artifactId);
params.put("version", version == null ? "1.0" : version);
params.put("archetypeGroupId", archetypeGroupId);
params.put("archetypeArtifactId", archetypeArtifactId);
params.put("archetypeVersion", archetypeVersion);
params.put("remoteRepositories", remoteRepo);
params.put("user.dir", validProjectLocation);

executionRequest.setProperties(params);

executionRequest.setBaseDirectory(new File(validProjectLocation));

MavenExecutionResult result = this.getEmbedder
().execute(executionRequest);


in this case, validProjectLocation  is E:\myproject

but this is what I get on the console

[INFO] Parameter: groupId, Value: com.myproject
[INFO] Parameter: packageName, Value: com.myproject
[INFO] Parameter: basedir, Value: C:\dev\eclipse
[INFO] Parameter: package, Value: com.myproject
[INFO] Parameter: version, Value: 1.0
[INFO] Parameter: artifactId, Value: myproject
[INFO] * End of debug info from resources from generated
POM ***

It's ignoring the user.dir parameter

I also tried basedir instead, but does not work

Am I missing something?

Best Regards,

João Kreuzberg

On 8/7/07, João Kreuzberg <[EMAIL PROTECTED]> wrote:
  

YES,

that works :)

Thanks so much,

Best regards,

João Kreuzberg

On 8/7/07, Maria Odea Ching < [EMAIL PROTECTED]> wrote:


Hi,

You've got the wrong parameter name.. it should be user.dir instead of
basedir.

HTH,
Deng

João Kreuzberg wrote:
  

Hello guys,

I'm having a problem with create:archetype

on the site is says it has a -Dbasedir parameter
but it doesn't seems to work
I tried mvn archetype:create -DgroupId=joao -DartifactId=joao


-Dbasedir=C:\
  

but it does not create the project on the specified dir
it creates on the current dir
any thoughts?

Best regards,




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


  

--
João Kreuzberg






  



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



[CREATE:ARCHETYPE - MAVEN EMBEDDER]

2007-08-07 Thread João Kreuzberg
Maria,

I tried the user.dir within the command line and it works just fine.

When I try to execute it using maven-embedder

it just ignores the base directory.

Here is how I'm using it:

MavenExecutionRequest executionRequest = new
DefaultMavenExecutionRequest();

executionRequest.setGoals(Arrays
.asList(new String[] { "archetype:create" }));

Properties params = new Properties();

params.put("groupId", groupId);
params.put("artifactId", artifactId);
params.put("version", version == null ? "1.0" : version);
params.put("archetypeGroupId", archetypeGroupId);
params.put("archetypeArtifactId", archetypeArtifactId);
params.put("archetypeVersion", archetypeVersion);
params.put("remoteRepositories", remoteRepo);
params.put("user.dir", validProjectLocation);

executionRequest.setProperties(params);

executionRequest.setBaseDirectory(new File(validProjectLocation));

MavenExecutionResult result = this.getEmbedder
().execute(executionRequest);


in this case, validProjectLocation  is E:\myproject

but this is what I get on the console

[INFO] Parameter: groupId, Value: com.myproject
[INFO] Parameter: packageName, Value: com.myproject
[INFO] Parameter: basedir, Value: C:\dev\eclipse
[INFO] Parameter: package, Value: com.myproject
[INFO] Parameter: version, Value: 1.0
[INFO] Parameter: artifactId, Value: myproject
[INFO] * End of debug info from resources from generated
POM ***

It's ignoring the user.dir parameter

I also tried basedir instead, but does not work

Am I missing something?

Best Regards,

João Kreuzberg

On 8/7/07, João Kreuzberg <[EMAIL PROTECTED]> wrote:
>
> YES,
>
> that works :)
>
> Thanks so much,
>
> Best regards,
>
> João Kreuzberg
>
> On 8/7/07, Maria Odea Ching < [EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > You've got the wrong parameter name.. it should be user.dir instead of
> > basedir.
> >
> > HTH,
> > Deng
> >
> > João Kreuzberg wrote:
> > > Hello guys,
> > >
> > > I'm having a problem with create:archetype
> > >
> > > on the site is says it has a -Dbasedir parameter
> > > but it doesn't seems to work
> > > I tried mvn archetype:create -DgroupId=joao -DartifactId=joao
> > -Dbasedir=C:\
> > > but it does not create the project on the specified dir
> > > it creates on the current dir
> > > any thoughts?
> > >
> > > Best regards,
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> João Kreuzberg




-- 
João Kreuzberg


Re: Maven embedder simple example

2007-07-17 Thread guilherme_silveira

great, thanks for the reply. answers all my questions

regards

guilherme
-- 
View this message in context: 
http://www.nabble.com/Maven-embedder-simple-example-tf4099532s177.html#a11659633
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Maven embedder simple example

2007-07-17 Thread Jason van Zyl


On 17 Jul 07, at 2:14 PM 17 Jul 07, guilherme_silveira wrote:



Hello there,

I have searched both users and dev mailing list archive but could  
not find a

simple example appart from

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

The problem here is that Configuration, DefaultConfiguration and
DefaultMavenExecutionRequest cannot be found if my pom only includes
maven-core, maven-embedder and maven-project. The example above  
does not
mention which dependencies should be included for such types (I  
have tried a

few, 'fishing eye' some of them around)

The found api itself does not contain some of the methods mentioned  
in such

example. Deprecated tutorial maybe?

Can anyone please point me where to find such dependencies?



This only works from trunk, and you need to build it yourself. All  
IDE integration uses it but it's not for the faint of heart. The  
first publicly usable version will be released with 2.1-alpha-1. And  
no, I don't know exactly when we will release that.



Regards

Guilherme
--
View this message in context: http://www.nabble.com/Maven-embedder- 
simple-example-tf4099532s177.html#a11657913

Sent from the Maven - Users mailing list archive at Nabble.com.


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




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



Maven embedder simple example

2007-07-17 Thread guilherme_silveira

Hello there,

I have searched both users and dev mailing list archive but could not find a
simple example appart from 

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

The problem here is that Configuration, DefaultConfiguration and
DefaultMavenExecutionRequest cannot be found if my pom only includes
maven-core, maven-embedder and maven-project. The example above does not
mention which dependencies should be included for such types (I have tried a
few, 'fishing eye' some of them around)

The found api itself does not contain some of the methods mentioned in such
example. Deprecated tutorial maybe?

Can anyone please point me where to find such dependencies?

Regards

Guilherme
-- 
View this message in context: 
http://www.nabble.com/Maven-embedder-simple-example-tf4099532s177.html#a11657913
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Maven embedder examples

2007-06-28 Thread Ravi Luthra

I want to use the Maven Embedder but I am having trouble with the online
example.

The dependencies I have on my project are:

   
   org.apache.maven
   maven-core
   2.0.7
   
   
   org.apache.maven
   maven-project
   2.0.7
   
   
   org.apache.maven
   maven-embedder
   2.0.4
   

The example code seems to have classes that no longer exist I think. I don't
know exactly what dependencies are supposed to be used for that example
anyway, they are not documented.

Any help?


Using maven embedder to force dependency updates

2007-06-27 Thread Joseph Ancell

I'm search all around the message boards for this and couldn't find it. 

Pretty much I'm trying to use the maven embedder to run "mvn eclipse:eclipse
-U".  How do you add the -U to the end?  I'm not seeing any API for this or
don't know how to add it as a property to of the MavenExecutionRequest?  Can
anyone help me out.  Thanks.
-- 
View this message in context: 
http://www.nabble.com/Using-maven-embedder-to-force-dependency-updates-tf3990901s177.html#a11332616
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Maven Embedder Example?

2007-05-07 Thread mraible

I figured out how to generate an archetype programmatically (see code below).
Now I'm trying to execute goals w/in that project using MavenEmbedder. It
seems to *almost* works, except that a plugin with
"true" is failing. Does the MavenEmbedder not
support plugins with extensions?

Thanks,

Matt

protected void createTestProject(String archetypeArtifactId, String
archetypeVersion) throws Exception {
MavenProject project = getMavenProject();
FileUtils.deleteDirectory(getTestFile("target/" +
project.getArtifactId()));

Map parameters = new HashMap();

parameters.put("groupId", project.getGroupId());
parameters.put("artifactId", project.getArtifactId());
parameters.put("version", "1.0-SNAPSHOT");
parameters.put("basedir", getTestFile("target").getAbsolutePath());

Archetype archetype = (Archetype) lookup(Archetype.ROLE);

ArtifactRepositoryLayout layout =
(ArtifactRepositoryLayout)
container.lookup(ArtifactRepositoryLayout.ROLE, "default");

String mavenRepoLocal = project.getRepositories().get(0).toString();

ArtifactRepository localRepository = new
DefaultArtifactRepository("local", mavenRepoLocal, layout);

List remoteRepositories = new
ArrayList();
String mavenRepoRemote = "http://static.appfuse.org/repository";;
ArtifactRepository remoteRepository = new
DefaultArtifactRepository("remote", mavenRepoRemote, layout);

remoteRepositories.add(remoteRepository);

String archetypeGroupId = "org.appfuse";
archetype.createArchetype(archetypeGroupId, archetypeArtifactId,
archetypeVersion, localRepository,
remoteRepositories, parameters);
}


mraible wrote:
> 
> Does anyone have a Maven Embedder example that runs archetype:create?  I'd
> like to create an archetype, run a plugin and verify that files are
> created in the new project.  I could run the archetype creation and plugin
> with Ant, but that doesn't seem to be a very good way to test the code
> generation plugin I'm writing.
> 
> Thanks,
> 
> Matt
> 

-- 
View this message in context: 
http://www.nabble.com/Maven-Embedder-Example--tf3706476s177.html#a10367706
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Maven Embedder Example?

2007-05-07 Thread mraible

Does anyone have a Maven Embedder example that runs archetype:create?  I'd
like to create an archetype, run a plugin and verify that files are created
in the new project.  I could run the archetype creation and plugin with Ant,
but that doesn't seem to be a very good way to test the code generation
plugin I'm writing.

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Maven-Embedder-Example--tf3706476s177.html#a10366156
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Active profiles in settings.xml are wrong in maven-embedder

2007-04-23 Thread Rahamim, Zvi \(Zvi\)
Hi,
I've defined in settings.xml file (under M2_HOME/conf/) a profile
(my-profile) and set it to be activated.
I removed file "C:\Documents and Settings\\.m2\settings.xml".
When I run build using maven, it knows to uses my-profile, but when I
create a maven project using the maven-embedder, it doesn't have any
active profiles.
Please help,
Thanks!

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



Re: [m2] maven embedder

2007-02-27 Thread Dmitry Beransky

On 2/14/07, Jason van Zyl <[EMAIL PROTECTED]> wrote:

On the IDEA side the Maven Reloaded Plugin by Brian Kate, and
the Maven 2.x Integration by Ralf Quebbemann. I am also working on
this in addition to the embedder as it's the IDE I use.


Thanks!  I didn't see the Reloaded plugin when I did the initial
search.  Sounds like it's exactly what I wanted to do.

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



Re: [m2] maven embedder

2007-02-15 Thread Jason van Zyl


On 15 Feb 07, at 1:32 AM 15 Feb 07, Jochen Wiedmann wrote:


On 2/15/07, Jason van Zyl <[EMAIL PROTECTED]> wrote:


live. That's where we're planning the official IDE integration for
Maven.


What about M2Eclipse?


What about it? I work on that too and that's what we're planning on  
moving to Mevenide.



You call this "official"?



Yes, given it's the first and there isn't anything else.

Jason.




--
How fast can a year go? As fast as your childs first year.

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





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



Re: [m2] maven embedder

2007-02-14 Thread Jochen Wiedmann

On 2/15/07, Jason van Zyl <[EMAIL PROTECTED]> wrote:


live. That's where we're planning the official IDE integration for
Maven.


What about M2Eclipse? You call this "official"?



--
How fast can a year go? As fast as your childs first year.

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



Re: [m2] maven embedder

2007-02-14 Thread Jason van Zyl


On 13 Feb 07, at 11:05 PM 13 Feb 07, Dmitry Beransky wrote:


Jason,

Thanks.  That worked great, however I ran into another problem.  I'm
using embedder to write an IntelliJ IDEA plugin and IDEA insists on
using it's own JDOM library.  See this discussion for reference:


You might want to join the effort where the two fellows who were  
writing IDEA integration have merged their efforts at the Mevenide  
project where IDEA, Netbeans and soon the Eclipse integration will  
live. That's where we're planning the official IDE integration for  
Maven. On the IDEA side the Maven Reloaded Plugin by Brian Kate, and  
the Maven 2.x Integration by Ralf Quebbemann. I am also working on  
this in addition to the embedder as it's the IDE I use.




http://intellij.net/forums/thread.jspa?messageID=3441989



This is really because that embedder is an assembly where everything  
is packed together if I deploy 2.1-SNAPSHOTs of everything you could  
use the pieces individually and swap in your own version.



I was able to work around the problem temporarily by removing all JDOM
classes from the embedder jar.  I'm hoping for a more permanent
solution, though.  Is that possible?


You don't need to use the embedder assembly, or in the future I would  
like to mangle the 3rd party libraries using Torsten Curdt's minijar  
plugin which will hide JDOM from you.


Jason.




Thanks
Dmitry


The folks I'm directly supporting for the embedder are the IDE folks.
They are using the embedder from trunk. I will attempt to merge the
trunk into the 2.0.6 release of Maven. If you want something then use
these:

http://idisk.maven.org/jvanzyl/Public/embedder/

Use the first version, that's what was used in the last release of
the Maven Eclipse Integration.

We're just about to release 2.0.5 and I don't have time to merge it
into 2.0.5.

Jason.

> D.
>
> On 2/12/07, franz see <[EMAIL PROTECTED]> wrote:
>>
>> Good day,
>>
>> Odd. I just tried it and it works fine with me. Also, I have just
>> checked
>> the source code of MavenEmbedder() and it does not use
>> XmlPullParserException, so I am not sure why it was looking for  
that.

>>
>> Are you sure your debugging the right line?
>>
>> Cheers,
>> Franz
>>
>>
>> Dmitry Beransky-3 wrote:
>> >
>> > Hi Franz,
>> >
>> > If I only add the embedder, i get a long list of
>> NoClassDefFoundError,
>> > which goes away only when I counter balance by an equally long
>> list of
>> > included jars.  The very first error I get is this:
>> >
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > org/codehaus/plexus/util/xml/pull/XmlPullParserException
>> >   at org.dembel.maven.MavenUtils.createEmbedder
>> (MavenUtils.java:53)
>> >   at Main.main(Main.java:14)
>> >   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 com.intellij.rt.execution.application.AppMain.main
>> (AppMain.java:90)
>> >
>> > Where MavenUtils.createEmbedder() looks like this:
>> >
>> >public static MavenEmbedder createEmbedder() {
>> >   MavenEmbedder embedder = new MavenEmbedder();
>> >   return embedder;
>> >}
>> >
>> >
>> > thanks
>> > Dmitry
>> >
>> >
>> > On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Good day to you, Dmitry,
>> >>
>> >> AFAIK, It should be enough to add the maven-embedder artifact
>> to your
>> >> pom's
>> >> dependencies for it to run. Why, what error are you getting?
>> >>
>> >> Cheers,
>> >> Franz
>> >>
>> >>
>> >> Dmitry Beransky-3 wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > I'm not sure if this message is more appropriate here or on
>> the dev
>> >> > list.  Please advise for future messages.
>> >> >
>> >> > What other maven run-time libraries do I need in order to use
>> the
>> >> > embedder?
>> >> >
>> >> >
>> >> > Thanks
>> >> > Dmitry
>> >> >
>> >> >
>&g

Re: [m2] maven embedder

2007-02-13 Thread Dmitry Beransky

Jason,

Thanks.  That worked great, however I ran into another problem.  I'm
using embedder to write an IntelliJ IDEA plugin and IDEA insists on
using it's own JDOM library.  See this discussion for reference:

http://intellij.net/forums/thread.jspa?messageID=3441989

I was able to work around the problem temporarily by removing all JDOM
classes from the embedder jar.  I'm hoping for a more permanent
solution, though.  Is that possible?


Thanks
Dmitry


The folks I'm directly supporting for the embedder are the IDE folks.
They are using the embedder from trunk. I will attempt to merge the
trunk into the 2.0.6 release of Maven. If you want something then use
these:

http://idisk.maven.org/jvanzyl/Public/embedder/

Use the first version, that's what was used in the last release of
the Maven Eclipse Integration.

We're just about to release 2.0.5 and I don't have time to merge it
into 2.0.5.

Jason.

> D.
>
> On 2/12/07, franz see <[EMAIL PROTECTED]> wrote:
>>
>> Good day,
>>
>> Odd. I just tried it and it works fine with me. Also, I have just
>> checked
>> the source code of MavenEmbedder() and it does not use
>> XmlPullParserException, so I am not sure why it was looking for that.
>>
>> Are you sure your debugging the right line?
>>
>> Cheers,
>> Franz
>>
>>
>> Dmitry Beransky-3 wrote:
>> >
>> > Hi Franz,
>> >
>> > If I only add the embedder, i get a long list of
>> NoClassDefFoundError,
>> > which goes away only when I counter balance by an equally long
>> list of
>> > included jars.  The very first error I get is this:
>> >
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > org/codehaus/plexus/util/xml/pull/XmlPullParserException
>> >   at org.dembel.maven.MavenUtils.createEmbedder
>> (MavenUtils.java:53)
>> >   at Main.main(Main.java:14)
>> >   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 com.intellij.rt.execution.application.AppMain.main
>> (AppMain.java:90)
>> >
>> > Where MavenUtils.createEmbedder() looks like this:
>> >
>> >public static MavenEmbedder createEmbedder() {
>> >   MavenEmbedder embedder = new MavenEmbedder();
>> >   return embedder;
>> >}
>> >
>> >
>> > thanks
>> > Dmitry
>> >
>> >
>> > On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Good day to you, Dmitry,
>> >>
>> >> AFAIK, It should be enough to add the maven-embedder artifact
>> to your
>> >> pom's
>> >> dependencies for it to run. Why, what error are you getting?
>> >>
>> >> Cheers,
>> >> Franz
>> >>
>> >>
>> >> Dmitry Beransky-3 wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > I'm not sure if this message is more appropriate here or on
>> the dev
>> >> > list.  Please advise for future messages.
>> >> >
>> >> > What other maven run-time libraries do I need in order to use
>> the
>> >> > embedder?
>> >> >
>> >> >
>> >> > Thanks
>> >> > Dmitry
>> >> >
>> >> >
>> -
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
>> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>> -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context: http://www.nabble.com/maven-embedder-
>> tf3209782s177.html#a8938749
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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




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



Re: [m2] maven embedder

2007-02-13 Thread franz see

Good day to you, Dmitry,

You may want to take a look at your dependency tree ( do mvn
project-info-reports:dependencies then go to target\site\dependencies.html )
and search for what version of plexus-utils your project is using. 

I checked the dependency tree of org.apache.maven:maven-embedder:2.0.4 ( see
[1] ), and it's using org.codehaus.plexus:plexus-utils:1.1.

If according to your dependency tree, you are not using that plexus version,
you may want to declare org.codehaus.plexus:plexus-utils:1.1 as a direct
dependency of your maven project ( ensuring that maven will get that version
of plexus-utils instead of relying on the version it will from its
transitive dependencies ).

Cheers,
Franz

[1] http://maven.apache.org/ref/2.0.4/maven-embedder/dependencies.html


Dmitry Beransky-3 wrote:
> 
> Hi Franz,
> 
> I'm looking at the 2.0.4 sources (that's what I'm using) and I see
> MavenEmbedder.readModel() declaring "throws XmlPullParserException"
> 
> D.
> 
> On 2/12/07, franz see <[EMAIL PROTECTED]> wrote:
>>
>> Good day,
>>
>> Odd. I just tried it and it works fine with me. Also, I have just checked
>> the source code of MavenEmbedder() and it does not use
>> XmlPullParserException, so I am not sure why it was looking for that.
>>
>> Are you sure your debugging the right line?
>>
>> Cheers,
>> Franz
>>
>>
>> Dmitry Beransky-3 wrote:
>> >
>> > Hi Franz,
>> >
>> > If I only add the embedder, i get a long list of NoClassDefFoundError,
>> > which goes away only when I counter balance by an equally long list of
>> > included jars.  The very first error I get is this:
>> >
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > org/codehaus/plexus/util/xml/pull/XmlPullParserException
>> >   at org.dembel.maven.MavenUtils.createEmbedder(MavenUtils.java:53)
>> >   at Main.main(Main.java:14)
>> >   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
>> com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
>> >
>> > Where MavenUtils.createEmbedder() looks like this:
>> >
>> >public static MavenEmbedder createEmbedder() {
>> >   MavenEmbedder embedder = new MavenEmbedder();
>> >   return embedder;
>> >}
>> >
>> >
>> > thanks
>> > Dmitry
>> >
>> >
>> > On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Good day to you, Dmitry,
>> >>
>> >> AFAIK, It should be enough to add the maven-embedder artifact to your
>> >> pom's
>> >> dependencies for it to run. Why, what error are you getting?
>> >>
>> >> Cheers,
>> >> Franz
>> >>
>> >>
>> >> Dmitry Beransky-3 wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > I'm not sure if this message is more appropriate here or on the dev
>> >> > list.  Please advise for future messages.
>> >> >
>> >> > What other maven run-time libraries do I need in order to use the
>> >> > embedder?
>> >> >
>> >> >
>> >> > Thanks
>> >> > Dmitry
>> >> >
>> >> >
>> -----
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/maven-embedder-tf3209782s177.html#a8938749
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/maven-embedder-tf3209782s177.html#a8957702
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: [m2] maven embedder

2007-02-13 Thread Jason van Zyl

On 13 Feb 07, at 10:32 AM 13 Feb 07, Dmitry Beransky wrote:


Hi Franz,

I'm looking at the 2.0.4 sources (that's what I'm using) and I see
MavenEmbedder.readModel() declaring "throws XmlPullParserException"



The folks I'm directly supporting for the embedder are the IDE folks.  
They are using the embedder from trunk. I will attempt to merge the  
trunk into the 2.0.6 release of Maven. If you want something then use  
these:


http://idisk.maven.org/jvanzyl/Public/embedder/

Use the first version, that's what was used in the last release of  
the Maven Eclipse Integration.


We're just about to release 2.0.5 and I don't have time to merge it  
into 2.0.5.


Jason.


D.

On 2/12/07, franz see <[EMAIL PROTECTED]> wrote:


Good day,

Odd. I just tried it and it works fine with me. Also, I have just  
checked

the source code of MavenEmbedder() and it does not use
XmlPullParserException, so I am not sure why it was looking for that.

Are you sure your debugging the right line?

Cheers,
Franz


Dmitry Beransky-3 wrote:
>
> Hi Franz,
>
> If I only add the embedder, i get a long list of  
NoClassDefFoundError,
> which goes away only when I counter balance by an equally long  
list of

> included jars.  The very first error I get is this:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/codehaus/plexus/util/xml/pull/XmlPullParserException
>   at org.dembel.maven.MavenUtils.createEmbedder 
(MavenUtils.java:53)

>   at Main.main(Main.java:14)
>   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 com.intellij.rt.execution.application.AppMain.main 
(AppMain.java:90)

>
> Where MavenUtils.createEmbedder() looks like this:
>
>public static MavenEmbedder createEmbedder() {
>   MavenEmbedder embedder = new MavenEmbedder();
>   return embedder;
>}
>
>
> thanks
> Dmitry
>
>
> On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:
>>
>> Good day to you, Dmitry,
>>
>> AFAIK, It should be enough to add the maven-embedder artifact  
to your

>> pom's
>> dependencies for it to run. Why, what error are you getting?
>>
>> Cheers,
>> Franz
>>
>>
>> Dmitry Beransky-3 wrote:
>> >
>> > Hi,
>> >
>> > I'm not sure if this message is more appropriate here or on  
the dev

>> > list.  Please advise for future messages.
>> >
>> > What other maven run-time libraries do I need in order to use  
the

>> > embedder?
>> >
>> >
>> > Thanks
>> > Dmitry
>> >
>> >  
-

>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>>  
-

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

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

--
View this message in context: http://www.nabble.com/maven-embedder- 
tf3209782s177.html#a8938749

Sent from the Maven - Users mailing list archive at Nabble.com.


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




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





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



Re: [m2] maven embedder

2007-02-13 Thread Dmitry Beransky

Hi Franz,

I'm looking at the 2.0.4 sources (that's what I'm using) and I see
MavenEmbedder.readModel() declaring "throws XmlPullParserException"

D.

On 2/12/07, franz see <[EMAIL PROTECTED]> wrote:


Good day,

Odd. I just tried it and it works fine with me. Also, I have just checked
the source code of MavenEmbedder() and it does not use
XmlPullParserException, so I am not sure why it was looking for that.

Are you sure your debugging the right line?

Cheers,
Franz


Dmitry Beransky-3 wrote:
>
> Hi Franz,
>
> If I only add the embedder, i get a long list of NoClassDefFoundError,
> which goes away only when I counter balance by an equally long list of
> included jars.  The very first error I get is this:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/codehaus/plexus/util/xml/pull/XmlPullParserException
>   at org.dembel.maven.MavenUtils.createEmbedder(MavenUtils.java:53)
>   at Main.main(Main.java:14)
>   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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
>
> Where MavenUtils.createEmbedder() looks like this:
>
>public static MavenEmbedder createEmbedder() {
>   MavenEmbedder embedder = new MavenEmbedder();
>   return embedder;
>}
>
>
> thanks
> Dmitry
>
>
> On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:
>>
>> Good day to you, Dmitry,
>>
>> AFAIK, It should be enough to add the maven-embedder artifact to your
>> pom's
>> dependencies for it to run. Why, what error are you getting?
>>
>> Cheers,
>> Franz
>>
>>
>> Dmitry Beransky-3 wrote:
>> >
>> > Hi,
>> >
>> > I'm not sure if this message is more appropriate here or on the dev
>> > list.  Please advise for future messages.
>> >
>> > What other maven run-time libraries do I need in order to use the
>> > embedder?
>> >
>> >
>> > Thanks
>> > Dmitry
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/maven-embedder-tf3209782s177.html#a8938749
Sent from the Maven - Users mailing list archive at Nabble.com.


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




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



Re: [m2] maven embedder

2007-02-12 Thread franz see

Good day,

Odd. I just tried it and it works fine with me. Also, I have just checked
the source code of MavenEmbedder() and it does not use
XmlPullParserException, so I am not sure why it was looking for that. 

Are you sure your debugging the right line? 

Cheers,
Franz


Dmitry Beransky-3 wrote:
> 
> Hi Franz,
> 
> If I only add the embedder, i get a long list of NoClassDefFoundError,
> which goes away only when I counter balance by an equally long list of
> included jars.  The very first error I get is this:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/codehaus/plexus/util/xml/pull/XmlPullParserException
>   at org.dembel.maven.MavenUtils.createEmbedder(MavenUtils.java:53)
>   at Main.main(Main.java:14)
>   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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
> 
> Where MavenUtils.createEmbedder() looks like this:
> 
>public static MavenEmbedder createEmbedder() {
>   MavenEmbedder embedder = new MavenEmbedder();
>   return embedder;
>}
> 
> 
> thanks
> Dmitry
> 
> 
> On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:
>>
>> Good day to you, Dmitry,
>>
>> AFAIK, It should be enough to add the maven-embedder artifact to your
>> pom's
>> dependencies for it to run. Why, what error are you getting?
>>
>> Cheers,
>> Franz
>>
>>
>> Dmitry Beransky-3 wrote:
>> >
>> > Hi,
>> >
>> > I'm not sure if this message is more appropriate here or on the dev
>> > list.  Please advise for future messages.
>> >
>> > What other maven run-time libraries do I need in order to use the
>> > embedder?
>> >
>> >
>> > Thanks
>> > Dmitry
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -----
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/maven-embedder-tf3209782s177.html#a8938749
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: [m2] maven embedder

2007-02-11 Thread Dmitry Beransky

Hi Franz,

If I only add the embedder, i get a long list of NoClassDefFoundError,
which goes away only when I counter balance by an equally long list of
included jars.  The very first error I get is this:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/codehaus/plexus/util/xml/pull/XmlPullParserException
at org.dembel.maven.MavenUtils.createEmbedder(MavenUtils.java:53)
at Main.main(Main.java:14)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Where MavenUtils.createEmbedder() looks like this:

  public static MavenEmbedder createEmbedder() {
 MavenEmbedder embedder = new MavenEmbedder();
 return embedder;
  }


thanks
Dmitry


On 2/11/07, franz see <[EMAIL PROTECTED]> wrote:


Good day to you, Dmitry,

AFAIK, It should be enough to add the maven-embedder artifact to your pom's
dependencies for it to run. Why, what error are you getting?

Cheers,
Franz


Dmitry Beransky-3 wrote:
>
> Hi,
>
> I'm not sure if this message is more appropriate here or on the dev
> list.  Please advise for future messages.
>
> What other maven run-time libraries do I need in order to use the
> embedder?
>
>
> Thanks
> Dmitry
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
Sent from the Maven - Users mailing list archive at Nabble.com.


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




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



Re: [m2] maven embedder

2007-02-11 Thread franz see

Good day to you, Dmitry,

AFAIK, It should be enough to add the maven-embedder artifact to your pom's
dependencies for it to run. Why, what error are you getting?

Cheers,
Franz


Dmitry Beransky-3 wrote:
> 
> Hi,
> 
> I'm not sure if this message is more appropriate here or on the dev
> list.  Please advise for future messages.
> 
> What other maven run-time libraries do I need in order to use the
> embedder?
> 
> 
> Thanks
> Dmitry
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/maven-embedder-tf3209782s177.html#a8917783
Sent from the Maven - Users mailing list archive at Nabble.com.


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



maven embedder

2007-02-11 Thread Dmitry Beransky

Hi,

I'm not sure if this message is more appropriate here or on the dev
list.  Please advise for future messages.

What other maven run-time libraries do I need in order to use the embedder?


Thanks
Dmitry

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



Re: maven embedder pb

2007-01-31 Thread Arnaud Bailly
franz see <[EMAIL PROTECTED]> writes:

> Good day to you, Arnaud, 
>

Thanks fro your answer Franz,
That's actually the way I did it. Here is the mojo code:

/*__
 * 
 * Copyright (C) 2006 Arnaud Bailly / OQube 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 *  
 * email: [EMAIL PROTECTED]
 * creation: Thu Sep 21 2006
 */
package oqube.muse.maven;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;

import oqube.muse.literate.LiterateMuse;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.project.MavenProject;

/**
 * This plugin generates source files and documentation from literate sources in
 * muse format. This plugin executes normally at the beginning of a lifecycle
 * (phase generate-sources) and does the following:
 * 
 * Parse literate muse files found in the source 
parameter,
 * Generate corresponding source files and store them in the
 * sourceOutput parameter,
 * Generate muse files from literate source and store them in the
 * docOutput parameter.
 * 
 * This plugin is a simple wrapper around
 * [EMAIL PROTECTED] oqube.muse.literate.LiterateMuse} class.
 * 
 * @author [EMAIL PROTECTED]
 * @version $Id: LiterateMuseMojo.java 80 2007-01-29 08:52:36Z /CN=nono $
 * @goal publish
 * @phase generate-sources
 */
public class LiterateMuseMojo extends AbstractMojo {

  /**
   * The directory containing literate muse source to parse.
   * 
   * @parameter expression="${basedir}/src/site/muse"
   * @required
   */
  private File source;

  /**
   * Exclusion patterns. All files (and directories) from source directory that
   * matches one of these patterns are excluded.
   * 
   * @parameter
   */
  private List excludes;

  /**
   * Output directory for generated sources.
   * 
   * @parameter 
expression="${project.build.directory}/generated-sources/literate"
   */
  private File sourceOutput;

  /**
   * Output directory for generated documentation. This parameter defaults to
   * null as the input file themselves may be used for documentation generation.
   * If documentation format is different then this paramater shoudl be set
   * accordingly.
   * 
   * @parameter
   */
  private File docOutput = null;

  /**
   * The generated documentation format to use. If this is null (the default),
   * then no documentation is generated.
   * 
   * @parameter
   */
  private String format;

  /**
   * Name of header file to prepend to each generated source file.
   * 
   * @parameter
   */
  private String header;

  /**
   * Name of footer file to append to each generated source file.
   * 
   * @parameter
   */
  private String footer;

  /**
   * If true, then source files are aggregated over the whole set of input
   * files. This allows splitting a source file over several documents and
   * producing a single source.
   * 
   * @parameter expression="false"
   */
  private boolean multifile;

  /**
   * The current project object.
   * 
   * @parameter expression="${project}"
   * @required
   */
  private MavenProject project;

  /**
   * The encoding used for generating source and document files.
   * 
   * @parameter
   */
  private String outputEncoding;

  /**
   * The encoding used for reading literate sources.
   * 
   * @parameter
   */
  private String inputEncoding;

  /**
   * The inclusion filter for fragments to generate. This pattern can be used to
   * control which fragments get their source files generated by the mojo: A
   * fragment is generated if it is included and it is not
   * excluded.
   * 
   * @parameter expression=".*"
   */
  private String filterIn;

  /**
   * The exclusion filter for fragments to generate. This pattern can be used to
   * control which fragments get their source files generated by the mojo. This
   * is very useful for distinguishing test and source files.
   * 
   * @parameter expression="^$"
   */
  private String filterOut;

  /**
   * Tells whether processed sources are test sources or standard sources.
   * 
   * @paramete

Re: maven embedder pb

2007-01-29 Thread franz see

Good day to you, Arnaud, 

Your parameters must match your mojo's fields. And those fields must have an
"@parameter" annotation at the very least.

Since you have sourceOutput, testSource, filterIn, and lenient as
parameters, you should have those as fields as well. Something like

/**
 * @parameter
 */
private File sourceOutput;

/**
 * @parameter
 */
private File testSource;

/**
 * @parameter
 */
private String filterIn;

/**
 * @parameter
 */
private lenient;

Cheers,
Franz


Arnaud Bailly-3 wrote:
> 
> Hello to all,
> I am using MavenEmbedder to do some integration testing for a maven
> plugin I wrote. It works quite fine but it seems that configuration
> inside execution are ignored. Any clue about that ?
> 
> Here is the code snippet:
> 
> package oqube.muse;
> 
> import java.io.File;
> import java.util.Collections;
> import java.util.regex.Pattern;
> 
> import junit.framework.TestCase;
> 
> import oqube.muse.literate.LiterateMuse;
> 
> import org.apache.maven.BuildFailureException;
> import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
> import org.apache.maven.artifact.resolver.ArtifactResolutionException;
> import org.apache.maven.cli.ConsoleDownloadMonitor;
> import org.apache.maven.embedder.MavenEmbedder;
> import org.apache.maven.embedder.MavenEmbedderConsoleLogger;
> import org.apache.maven.embedder.PlexusLoggerAdapter;
> import org.apache.maven.lifecycle.LifecycleExecutionException;
> import org.apache.maven.monitor.event.DefaultEventMonitor;
> import org.apache.maven.monitor.event.EventMonitor;
> import org.apache.maven.project.DuplicateProjectException;
> import org.apache.maven.project.MavenProject;
> import org.apache.maven.project.ProjectBuildingException;
> import org.codehaus.plexus.util.dag.CycleDetectedException;
> 
> /**
>  * Integration testing class for literate muse plugin. This class run
> plugin
>  * with projects using maven embedder and chekcs generation is ok.
>  * 
>  * @author nono
>  * 
>  */
> public class MavenPluginTest extends TestCase {
> 
>   private MavenEmbedder maven;
> 
>   protected void setUp() throws Exception {
> super.setUp();
> maven = new MavenEmbedder();
> ClassLoader classLoader =
> Thread.currentThread().getContextClassLoader();
> maven.setClassLoader(classLoader);
> maven.setLogger(new MavenEmbedderConsoleLogger());
> maven.start();
>   }
> 
>   public void test01() throws CycleDetectedException,
> LifecycleExecutionException, BuildFailureException,
> DuplicateProjectException, ArtifactResolutionException,
> ArtifactNotFoundException, ProjectBuildingException {
> File targetDirectory = new File("target/test-classes/testPlugin01");
> File pomFile = new File(targetDirectory, "pom.xml");
> MavenProject pom = maven.readProjectWithDependencies(pomFile);
> EventMonitor eventMonitor = new DefaultEventMonitor(
> new PlexusLoggerAdapter(new MavenEmbedderConsoleLogger()));
> maven.execute(pom, Collections.singletonList("muse:publish"),
> eventMonitor,
> new ConsoleDownloadMonitor(), null, targetDirectory);
> // check generated data
> File gen = new
> File(targetDirectory,"target/generated-sources/literate/toto/Toto.java");
> assertTrue(gen.exists() && gen.length() > 0);
>   }
> }
> 
> and here is the test pom
> 
> 
> http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
>  4.0.0
>  oqube
>  oqube-site-fr
>  jar
>  1.1
>  OQube Site Francais
>  http://www.oqube.com/
> 
>  2006
>  
>   OQube
>   http://www.oqube.com/contact.html
>  
> 
>  
>   
> 
>
>
> org.apache.maven.plugins
> maven-site-plugin
> 
>  fr,en
> 
>
> 
>
> oqube.muse
> muse-maven-plugin
> 1.0-SNAPSHOT
> 
>  
>   tests
>   
>publish
>   
>   
>target/generated-test-sources
>true
>.*Test.java
>true
>   
>  
> 
>
>   
>  
> 
>  
>   
>oqube.com
>scp://www.oqube.com/var/www/
>   
>  
>  
> 
>oqube.com
>http://www.oqube.com/maven2/
>
> 
>   
> 
>   
>   
> org.apache.maven.plugins
> maven-site-plugin
> 2.0-beta-5
>
> 
>   
> org.apache.maven.doxia
> doxia-site-renderer
> 1.0-alpha-8-muse
>
> 
>   
> 
>  
>   true
>  
> 

maven embedder pb

2007-01-29 Thread Arnaud Bailly
Hello to all,
I am using MavenEmbedder to do some integration testing for a maven
plugin I wrote. It works quite fine but it seems that configuration
inside execution are ignored. Any clue about that ?

Here is the code snippet:

package oqube.muse;

import java.io.File;
import java.util.Collections;
import java.util.regex.Pattern;

import junit.framework.TestCase;

import oqube.muse.literate.LiterateMuse;

import org.apache.maven.BuildFailureException;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.cli.ConsoleDownloadMonitor;
import org.apache.maven.embedder.MavenEmbedder;
import org.apache.maven.embedder.MavenEmbedderConsoleLogger;
import org.apache.maven.embedder.PlexusLoggerAdapter;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.monitor.event.DefaultEventMonitor;
import org.apache.maven.monitor.event.EventMonitor;
import org.apache.maven.project.DuplicateProjectException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingException;
import org.codehaus.plexus.util.dag.CycleDetectedException;

/**
 * Integration testing class for literate muse plugin. This class run plugin
 * with projects using maven embedder and chekcs generation is ok.
 * 
 * @author nono
 * 
 */
public class MavenPluginTest extends TestCase {

  private MavenEmbedder maven;

  protected void setUp() throws Exception {
super.setUp();
maven = new MavenEmbedder();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
maven.setClassLoader(classLoader);
maven.setLogger(new MavenEmbedderConsoleLogger());
maven.start();
  }

  public void test01() throws CycleDetectedException, 
LifecycleExecutionException, BuildFailureException, DuplicateProjectException, 
ArtifactResolutionException, ArtifactNotFoundException, 
ProjectBuildingException {
File targetDirectory = new File("target/test-classes/testPlugin01");
File pomFile = new File(targetDirectory, "pom.xml");
MavenProject pom = maven.readProjectWithDependencies(pomFile);
EventMonitor eventMonitor = new DefaultEventMonitor(
new PlexusLoggerAdapter(new MavenEmbedderConsoleLogger()));
maven.execute(pom, Collections.singletonList("muse:publish"), eventMonitor,
new ConsoleDownloadMonitor(), null, targetDirectory);
// check generated data
File gen = new 
File(targetDirectory,"target/generated-sources/literate/toto/Toto.java");
assertTrue(gen.exists() && gen.length() > 0);
  }
}

and here is the test pom


http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 oqube
 oqube-site-fr
 jar
 1.1
 OQube Site Francais
 http://www.oqube.com/

 2006
 
  OQube
  http://www.oqube.com/contact.html
 

 
  

   
   
org.apache.maven.plugins
maven-site-plugin

 fr,en

   

   
oqube.muse
muse-maven-plugin
1.0-SNAPSHOT

 
  tests
  
   publish
  
  
   target/generated-test-sources
   true
   .*Test.java
   true
  
 

   
  
 

 
  
   oqube.com
   scp://www.oqube.com/var/www/
  
 
 

   oqube.com
   http://www.oqube.com/maven2/
   

  

  
  
org.apache.maven.plugins
maven-site-plugin
2.0-beta-5
   

  
org.apache.maven.doxia
doxia-site-renderer
1.0-alpha-8-muse
   

  

 
  true
 



Help appreciated...
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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



Re: ZQ: Changing the version when using the maven embedder

2006-11-16 Thread franz see

Good day to you, Rahamim

The maven-model under the components directory handles that. You will see
there the models and the Xpp3 Reader and Writer. You may want to use its
Xpp3 Reader to read the pom, then modify its version, the use the Xpp3
Writer to write the pom back.

But that should be done before maven-embedder should be executed. If so, you
can use your app as a utility that should be called before running your
maven ( meaning, before executing maven-embedder).

Cheers,
Franz


Rahamim, Zvi (Zvi) wrote:
> 
> Hi,
> I write a java program that gets a pom.xml file, read it, get from the
> user the version to build and runs maven according to that.
> What I need to do is to change the version of the built project
> according to the user input.
> Can you tell me how to do it?
> Thanks!
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ZQ%3A-Changing-the-version-when-using-the-maven-embedder-tf2634869s177.html#a7393599
Sent from the Maven - Users mailing list archive at Nabble.com.


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



ZQ: Changing the version when using the maven embedder

2006-11-15 Thread Rahamim, Zvi \(Zvi\)
Hi,
I write a java program that gets a pom.xml file, read it, get from the
user the version to build and runs maven according to that.
What I need to do is to change the version of the built project
according to the user input.
Can you tell me how to do it?
Thanks!

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



Maven Embedder without MavenProject

2006-09-30 Thread Henrique Prange

Hi list,

I want to execute mvn install:install-file inside of a maven plug-in. 
I'm trying to use MavenEmbedder, but it depends at least on one 
MavenProject to call execute() method.


I want to use install:install-file, but like this plug-in, I don't want 
to require a project to run my plug-in. Is it possible with maven 
embedder? How can I do that?


Thanks in advance,

Henrique
--

\o/ Henrique Prange, Moleque de Idéias Educação e Tecnologia Ltda
 |  Phone: 55-21-2710-0178 E-mail: [EMAIL PROTECTED]
/ \ http://www.moleque.com.br

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



Re: Where is the maven-embedder 2.1 API documented?

2006-09-05 Thread franz see

Good day to you, Aaron,

You can check out the source for maven-embedder at
http://svn.apache.org/repos/asf/maven/components/trunk/maven-embedder/ ^_^

Cheers, 
Franz


Aaron Tarter wrote:
> 
> Where are the soruces located?
> 
> On 9/5/06, Milos Kleint <[EMAIL PROTECTED]> wrote:
>>
>> AFAIK it's not anywhere.. checkout the sources and build it yourself.
>> but to my knowledge the api might change again soon..
>>
>> Milos
>>
>> On 9/5/06, Aaron Tarter <[EMAIL PROTECTED]> wrote:
>> > I can only find the javadoc for the maven-embedder 2.0.4 on
>> maven.apache.org.
>> > It seems that the API has changed since then.  Can someone point me to
>> the
>> > 2.1 javadoc or some source examples?
>> >
>> > --
>> > Regards,
>> > Aaron J Tarter
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Regards,
> Aaron J Tarter
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Where-is-the-maven-embedder-2.1-API-documented--tf290.html#a6163636
Sent from the Maven - Users forum at Nabble.com.


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



  1   2   >