Re: Maven Embedder
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
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
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
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
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
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
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
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
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
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.
RE: Maven embedder examples
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
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] How to retrieve the list of available versions of a given plugin?
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?
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?
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?
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?
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?
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
Re: Maven Embedder thread safety
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
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 and phase bindings
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
Re: Maven Embedder - Jar in official repo is too old
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
Re: Maven Embedder - Jar in official repo is too old
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
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]
Re: Maven Embedder 2.1-SNAPSHOT
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
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
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
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]
Re: Maven embedder simple example
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
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]
Re: Maven Embedder Example?
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]
Re: maven embedder pb
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
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 > > > > > 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] > > > -- View this message in context: http://www.nabble.com/maven-embedder-pb-tf3134570s177.html#a8701774 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAI