RE: [PLEASE TEST] Apache Maven 3.0-RC2
Hi Our build which consists of 57 projects fails with the following on 3.0-RC2 (Ok on 2.2.1) [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project site-resources: Execution default-install of goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install failed: Un able to load the mojo 'install' in the plugin 'org.apache.maven.plugins:maven-install-plugin:2.3.1'. A required class is missing: org.codehaus.plexus.digest.Digester [ERROR] - [ERROR] realm = pluginorg.apache.maven.plugins:maven-install-plugin:2.3.1 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/e:/data/.m2/repository/org/apache/maven/plugins/maven-install-plug in/2.3.1/maven-install-plugin- 2.3.1.jar [ERROR] urls[1] = file:/e:/data/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus -utils-1.1.jar [ERROR] Number of foreign imports: 4 [ERROR] import: Entry[import org.codehaus.plexus.util.xml.pull.XmlSerializer from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.util.xml.pull.XmlPullParserException from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.util.xml.pull.XmlPullParser from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.util.xml.Xpp3Dom from realm ClassRealm[plexus.core, parent: null]] [ERROR] [ERROR] realm =maven.api [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] Number of foreign imports: 21 [ERROR] import: Entry[import org.sonatype.aether from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.personality from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.logging from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.lifecycle from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.context from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.container from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.configuration from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.component from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.classworlds from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.PlexusContainerException from realm ClassRealm[plexus.core, parent: nul l]] [ERROR] import: Entry[import org.codehaus.plexus.PlexusContainer from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.PlexusConstants from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.plexus.MutablePlexusContainer from realm ClassRealm[plexus.core, parent: null] ] [ERROR] import: Entry[import org.codehaus.plexus.DuplicateChildContainerException from realm ClassRealm[plexus.core, par ent: null]] [ERROR] import: Entry[import org.codehaus.plexus.DefaultPlexusContainer from realm ClassRealm[plexus.core, parent: null] ] [ERROR] import: Entry[import org.codehaus.plexus.DefaultContainerConfiguration from realm ClassRealm[plexus.core, parent : null]] [ERROR] import: Entry[import org.codehaus.plexus.DefaultComponentRegistry from realm ClassRealm[plexus.core, parent: nul l]] [ERROR] import: Entry[import org.codehaus.plexus.ContainerConfiguration from realm ClassRealm[plexus.core, parent: null] ] [ERROR] import: Entry[import org.codehaus.plexus.ComponentRegistry from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.codehaus.classworlds from realm ClassRealm[plexus.core, parent: null]] [ERROR] import: Entry[import org.apache.maven from realm ClassRealm[plexus.core, parent: null]] mvh Hermod -Original Message- From: Benjamin Bentmann [mailto:benjamin.bentm...@udo.edu] Sent: Wednesday, September 22, 2010 8:44 PM To: Maven Developers List; Maven Users List Subject: [PLEASE TEST] Apache Maven 3.0-RC2 Hi, in preparation for the release of Apache Maven 3.0, the Maven team is seeking your help to discover regressions since Maven 2.x. Everybody interested in taking a preview of the upcoming release for a test drive can get source and binary bundles from this URL: https://repository.apache.org/content/repositories/maven-006/org/apache/ maven/apache-maven/3.0-RC2/ Before reporting any issues found during testing, please be sure to have a close look at the compatibility notes for Maven 3.x: https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibilit y+Notes If you encounter unexpected build issues, please fill a report in JIRA that provides sufficient information to reproduce and
RE: [PLEASE TEST] Apache Maven 3.0-RC2
Hi Using IBM JRE so I'll wait to see if it gets fixed. Hermod -Original Message- From: Benjamin Bentmann [mailto:benjamin.bentm...@udo.edu] Sent: Thursday, September 23, 2010 2:57 PM To: Maven Developers List Subject: Re: [PLEASE TEST] Apache Maven 3.0-RC2 hermod.opstv...@dnbnor.no wrote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project site-resources: Execution default-install of goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install failed: Un able to load the mojo 'install' in the plugin 'org.apache.maven.plugins:maven-install-plugin:2.3.1'. A required class is missing: org.codehaus.plexus.digest.Digester This looks like http://jira.codehaus.org/browse/MNG-4794 which turned out to be an issue with IBM's JRE. If this error occurred using a Sun JRE, please create an issue with detailed logs and steps to reproduce it. Benjamin - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
RE: Maven performance
Hi Do the same test with mvn org.twdata.maven:maven-cli-plugin:execute-phase - A regular compile with large projects cuts down the time drastically Hermod -Original Message- From: Jörg Schaible [mailto:joerg.schai...@gmx.de] Sent: Tuesday, April 27, 2010 2:11 PM To: dev@maven.apache.org Subject: Maven performance Hi guys, it's not the first time I complain about Maven performance, but it seems M3 is heading the right direction. Yet, still not on the 2.0.x level: % = $ MAVEN_OPTS=-Xmx768m -XX:MaxPermSize=128m mvn-2.0 eclipse:eclipse Apache Maven 2.0.11 Java version: 1.6.0_20 Java home: /opt/sun-jdk-1.6.0.20/jre Default locale: en_US, platform encoding: UTF-8 OS name: linux version: 2.6.32-gentoo-r7 arch: i386 Family: unix snip [INFO] Total time: 2 minutes 46 seconds [INFO] Finished at: Tue Apr 27 12:06:49 CEST 2010 [INFO] Final Memory: 362M/573M $ MAVEN_OPTS=-Xmx768m -XX:MaxPermSize=128m mvn-2.2 eclipse:eclipse Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.6.0_20 Java home: /opt/sun-jdk-1.6.0.20/jre Default locale: en_US, platform encoding: UTF-8 OS name: linux version: 2.6.32-gentoo-r7 arch: i386 Family: unix snip [INFO] Total time: 6 minutes 46 seconds [INFO] Finished at: Tue Apr 27 11:31:13 CEST 2010 [INFO] Final Memory: 434M/682M $ MAVEN_OPTS=-Xmx768m -XX:MaxPermSize=128m mvn-3.0 eclipse:eclipse Apache Maven 3.0-beta-1 (r935667; 2010-04-19 19:00:39+0200) Java version: 1.6.0_20 Java home: /opt/sun-jdk-1.6.0.20/jre Default locale: en_US, platform encoding: UTF-8 OS name: linux version: 2.6.32-gentoo-r7 arch: i386 Family: unix snip [INFO] Total time: 4:02.127s [INFO] Finished at: Tue Apr 27 12:02:12 CEST 2010 [INFO] Final Memory: 344M/443M % = The build processes ~400 projects. The version output is somewhat faked (esp. for M2.0), it's just to give you the details of the environment. M3 is way better than M2.2, but not (yet ?) at the level of 2.0.11 (and I bet 2.0.9 will be a lot faster again). Also have a look at the memory footprint. Since M2.2 it is quite no longer possible for me to build all the stuff at once. M3 looks very promising here. - Jörg - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
RE: Problem with ejb deployment
Hi Which version of WebSphere is this? Hermod -Original Message- From: Hemant Ved [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 04, 2007 11:07 AM To: dev@maven.apache.org Cc: [EMAIL PROTECTED] Subject: Problem with ejb deployment Hi all I am trying to deploy ejb using maven and websphere application server? Can anybody please tell me which cargo plugin is required? I know there are cargo jboss and weblogic plugins available but does anybody know whether any Cargo Maven plugin is available for websphere? Also when I run the command mvn cargo:deploy I get the below error Internal error in the plugin manager executing goal 'org.codehaus.cargo:c argo-maven2-plugin:0.3.1:deploy': Unable to find the mojo ' org.codehaus.cargo:ca rgo-maven2-plugin:0.3.1:deploy' in the plugin ' org.codehaus.cargo:cargo-maven2-p lugin' Disclaimer: ' The contents of this electronic mail message are only binding upon Equens or its affiliates, if the contents of the message are accompanied by a lawfully recognized type of signature. The contents of this electronic mail message are priviliged and confidential and are intended only for use by the addressee. If you have received this electronic mail message by error, please notify the sender and delete the message without taking notices of its content, reproducing it and using it in any way.' Equens was founded by Interpay Nederland B.V. and Transaktionsinstitut für Zahlungsverkehrsdienstleistungen AG * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [vote-result] debugging maven with eclipse
Hi There is actually a much easier way to do this: Use the M2 Eclipse plugin from codehaus. In the window/preferences panel of Eclipse check off debug output. In the Maven plugin you want to debug, set a beakpoint. Configure a new External M2 run. Start the run and it will break at your breakpoint and you can step through your code (Mavens too if you have attachec the source) Hermod -Original Message- From: Franz Allan Valencia See [mailto:[EMAIL PROTECTED] Sent: Friday, February 16, 2007 3:13 AM To: Maven Developers List Subject: Re: [vote-result] debugging maven with eclipse Good day to you, John, Thanks :) I'll try to incorporate it this weekend :) ..unless somebody else wants to do it, in that case, please feel free to do so :) Thanks, Franz On 2/15/07, John J. Franey [EMAIL PROTECTED] wrote: Franz, Thanks for your contribution. I'm new to developing maven internals and my first question has been how to debug maven. I want to use the debugger to learn how maven is working internally. I've discovered this technique to debug maven 2.0.4 under eclipse 3.2. Please add it to your tutorial if it is appropriate. Part of your tutorial is addressing how to debug a user project's unit tests as they are run via surefire. I'm not certain if the technique I describe here is useful for debugging a user projects' unit test under surefire, but maybe. Here is how I can run/debug maven-core. This is can be applied to any maven subproject that a maven developer may want to edit and run/debug. Please feel free to incorporate this into your tutorial if it is appropriate. First level: running and debugging maven under eclipse: setting up a run config. The principal here is to merely incorporate the important elements of the mvn script into an eclipse run configuration. This run configuration would then be activated as any other run configuration would by clicking run or debug buttons in the toolbar. 0) checkout the maven subproject (I picked maven-core but any should work) and create an eclipse project. I used m2eclipse, but I suppose maven's eclipse plugin ought to work as well. 1) In eclipse, create a new Run configuration: 1a) Run-Run... 1b) select Java Application 1c) select New (to create new Java Application run), pick a name for the config that would include the project name and goal like: maven myproject install which would be meant to run the install goal in myproject. 1d) In the Run dialog: Main tab) a) project: maven-core b) main class: org.codehaus.classworlds.Launcher Arguments tab) Program arguments: any maven goals or command line argumens (like -X) VM arguments: -Dmaven.home=your maven installation root -Dclassworlds.conf=your maven installation root/bin/m2.conf working directory: select other: directory of the project used as maven's input Classpath tab) remove User Entries - maven-core add External Jars your maven installation root/core/boot/classworlds-1.1.jar Source tab) add project maven-core Run) This step will invoke maven without debugging. It will also have the affect of registring this new run config as the default run config (and debug run config) 2) Select a breakpoint int maven-core. I picked: org.apache.maven.DefaultMaven.execute. Then click the little beetle (debug run). The Next Level: developing maven internals and debugging them: If you want to make changes to the maven-core or other maven subprojects, you will need to provide your own version of bin/m2.conf. The purpose is to tell the internal class loading mechanism (classworlds and plexus) where your development build directory is so it could load your version of the classes. Your custom m2.conf file could be located anywhere in your filesystem, but since m2.conf is homed in maven-core, which is my example maven subproject, I edit it in place. Editing this file doesn't take much understanding of classworlds (I for one do not understand it to any level). Copy the original from maven's install bin directory to your preferred location. Edit the file and add the path to your eclipse build output for the maven projects involved. I added the middle line in this snippet from m2.conf: [plexus.core.maven] load /home/jfraney/projects/maven-2.0.4/maven-core/bin load ${maven.home}/lib/*.jar Then change the maven run configuration that was created above. The property classworlds.conf must be adjusted to point to your custom m2.conf file. Regards, John -- View this message in context: http://www.nabble.com/debugging-maven-with-eclipse-tf2434872s177.html#a8988667 Sent from the Maven Developers mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: maintain own metadata
Hi 1. How is this different from JaxB? 2. The documentation at http://xml.safris.org/bind/ leaves something to be desired Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of seva safris Sent: Tuesday, January 23, 2007 11:08 AM To: dev@maven.apache.org Subject: maintain own metadata Hi, I have a project that I would like to be available on Maven's central repository. I have already had a preliminary version of my project deployed to repo1.maven.org, but it seems inefficient to keep asking you guys to have new versions deployed as time goes on. The project can be identified by the org.safris.xml groupId. I would like to request that I take responsibility for maintaining my own metadata and set up an automated rsync system for deployment. Please tell me what needs to be done to make this work. Brief description of my project: The XML Bind solution is an alternative approach at XML binding for Java. The Generator solution is capable of generating source code from an XSD, allowing the Runtime to marshal and unmarshal those objects into XML. The builders are responsible for defining task and plugin classes for with Ant and Maven. Builder-ant is for Ant, and Builder-maven is for Maven. Project page: http://xml.safris.org/bind/ Thank you, seva safris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SV: Mojo and it's own dependencies
Hi Great - I'll take a peek Hermod -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 20, 2006 2:02 AM To: Maven Developers List Subject: Re: SV: Mojo and it's own dependencies On 31 Oct 06, at 9:06 AM 31 Oct 06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi I am now able to look at it. I suppose the what you refer to as common project called maven-ant is not the maven-ant plugin? What is the svn of this? Long delay, but I was just able to get the sample Ant-based mojo today. It was work for a client and it had to get some approval and be cleaned up but you can now find it here: http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/axis-maven-plugin It's a Maven plugin that is completely written in Ant script. The plugin resources are unpacked in the target directory so that you can reference physical files in your Ant scripts, it has full access to the various classpath entries in the same way the Ant Run plugin does, and it has an example of loading custom taskdefs. In this case taskdefs from ant-contrib. So this comes from a production build where knowledge of Ant must be leveraged and this now shows you can do whatever you want with Ant, yet allows you contain the inherent un- maintainability of Ant in a plugin and have it be completely reusable. From the perspective of the Maven users it doesn't matter now whether the plugin is written in Ant script, Ruby, or Java. It's all the same, and configured the same way for users of Maven. I have not back-ported the changes required to make this run in 2.0.x. I will attempt to do this but it won't happen before the new year. I need to makes some pictures of integration tests across versions and create some more ITs before I attempt to back-port the changes. At the very least, you can see how it works. Jason. Hermod -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 11:36 PM To: Maven Developers List Subject: Re: SV: Mojo and it's own dependencies On 19 Oct 06, at 5:19 PM 19 Oct 06, Hermod Opstvedt wrote: Hi Yeah, now we're talking. I need to setup a classpath for another java class that is to be run by an ant based mojo. So setting up the first mojo with the same dependencies as it, I will be able to supply the Ant script that as a classpath variable (Sneaky but does the trick) I need to document it, and you can help me with it, but I have that working with the new ant-based plugin stuff that I've committed. What I got working was an axis plugin entirely written in Ant. So a plugin script used in an ant-based plugin now has access to the compile, test, runtime and plugin classpath. I reworked all the ant stuff and combined John and Kenney's work and put it in a common project called maven-ant. I'll dig you up a sample if you document it :-) It fully works and has been run with a sizable ant script. Jason. Hermod -Opprinnelig melding- Fra: Jason van Zyl [mailto:[EMAIL PROTECTED] Sendt: 19. oktober 2006 21:30 Til: Maven Developers List Emne: Re: Mojo and it's own dependencies On 19 Oct 06, at 1:50 PM 19 Oct 06, Hermod Opstvedt wrote: Hi Is there a Maven helper class that can be called from a Mojo that will give the Mojo access to it's own dependencies? You can use the expression ${plugin.artifacts} i.e. /** * @parameter expression=${plugin.artifacts} */ private List pluginArtifacts; Is that what you're looking for? Jason. Hermod - 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] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-info-reports dependencies report problem
Hi After the cleanup in the maven-info-reports-plugin with respect to JarAnalyzer, the dependencis report is broken with an error referring to the JarAnalyzer. When running the report now I get the following: org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the pl ugin manager executing goal 'org.apache.maven.plugins:maven-project-info-reports -plugin:2.1-SNAPSHOT:dependencies': Unable to find the mojo 'org.apache.maven.pl ugins:maven-project-info-reports-plugin:2.1-SNAPSHOT:dependencies' in the plugin snip/ Caused by: org.codehaus.plexus.component.composition.CompositionException: Compo sition failed for the field jarAnalyzerFactory in object of type org.apache.mave n.report.projectinfo.DependenciesReport at org.codehaus.plexus.component.composition.FieldComponentComposer.assi gnRequirementToField(FieldComponentComposer.java:144) at org.codehaus.plexus.component.composition.FieldComponentComposer.asse mbleComponent(FieldComponentComposer.java:73) at org.codehaus.plexus.component.composition.DefaultComponentComposerMan ager.assembleComponent(DefaultComponentComposerManager.java:68) at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPl exusContainer.java:1486) at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPha se.execute(CompositionPhase.java:29) ... 26 more Caused by: java.lang.IllegalArgumentException at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccess orImpl.java:63) at java.lang.reflect.Field.set(Field.java:656) at org.codehaus.plexus.component.composition.FieldComponentComposer.assi gnRequirementToField(FieldComponentComposer.java:137) ... 30 more Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SV: Mojo and it's own dependencies
Hi I am now able to look at it. I suppose the what you refer to as common project called maven-ant is not the maven-ant plugin? What is the svn of this? Hermod -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 11:36 PM To: Maven Developers List Subject: Re: SV: Mojo and it's own dependencies On 19 Oct 06, at 5:19 PM 19 Oct 06, Hermod Opstvedt wrote: Hi Yeah, now we're talking. I need to setup a classpath for another java class that is to be run by an ant based mojo. So setting up the first mojo with the same dependencies as it, I will be able to supply the Ant script that as a classpath variable (Sneaky but does the trick) I need to document it, and you can help me with it, but I have that working with the new ant-based plugin stuff that I've committed. What I got working was an axis plugin entirely written in Ant. So a plugin script used in an ant-based plugin now has access to the compile, test, runtime and plugin classpath. I reworked all the ant stuff and combined John and Kenney's work and put it in a common project called maven-ant. I'll dig you up a sample if you document it :-) It fully works and has been run with a sizable ant script. Jason. Hermod -Opprinnelig melding- Fra: Jason van Zyl [mailto:[EMAIL PROTECTED] Sendt: 19. oktober 2006 21:30 Til: Maven Developers List Emne: Re: Mojo and it's own dependencies On 19 Oct 06, at 1:50 PM 19 Oct 06, Hermod Opstvedt wrote: Hi Is there a Maven helper class that can be called from a Mojo that will give the Mojo access to it's own dependencies? You can use the expression ${plugin.artifacts} i.e. /** * @parameter expression=${plugin.artifacts} */ private List pluginArtifacts; Is that what you're looking for? Jason. Hermod - 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] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Plugin executions
Hi Take a look at profiles. Hermod -Original Message- From: SlinnHawkins, Jon (ELS) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 17, 2006 8:05 AM To: Maven Developers List Subject: Plugin executions Hi All, Is there any way of specifying which execution to use when inheriting plugin executions form a parent pom. I have a department wide pom, which configures various plugins and executions for use across all our maven projects (just 1 at the moment, but will be about 15 soon). I need to be able to specify from the individual project pom which execution to use. For example I am using the exec-maven-plugin which is configured with 4 different executions, each with a unique id. I would like to be able to specify which of the 4 executions to use when using that plugin. Any ideas ? Thanks in advance Jon * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Not using pom.xml
Hi My mistake with the = sign. Maybe you should file an RFE in Jira for this. This might come in to flavours: 1. @requiresProject should ignore existing pom, or 2. introduce a new parameter @ingnoreProject. Hermod -Original Message- From: Jagan Padmanabha Pillai -X (jpadmana - Insight Solutions, Inc. at Cisco) [mailto:[EMAIL PROTECTED] Sent: Friday, July 14, 2006 7:56 AM To: Maven Developers List Subject: RE: Not using pom.xml I think there is no = sign. Its just @requiresProject false. This will run fine with no pom.xml but if pom is available it uses it. I want it to ignore the pom.xml even if the file is available. Any idea ?? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 10:44 PM To: dev@maven.apache.org Subject: RE: Not using pom.xml Hi Did you set @requiresProject=false? Hermod -Original Message- From: Jagan Padmanabha Pillai -X (jpadmana - Insight Solutions, Inc. at Cisco) [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 11:08 PM To: Maven Developers List Subject: Not using pom.xml Hi, Is there any way I can force my custom made plugin to not use pom.xml. There is a parameter @requiresProject (which is used in archetype), this works fine if there is no pom.xml. But if pom is available the plugin will use it. What I want is even if the pom.xml is available do NOT use it. Please let me know. Thanks -Jagan * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [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: Plugins can't be built!
Hi When I try to build the plugins, I get the following: [INFO] Scanning for projects... [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] The projects in the reactor contain a cyclic reference: Edge between 'Ver tex{label='org.apache.maven.plugins:maven-jxr-plugin'}' and 'Vertex{label='org.a pache.maven.plugins:maven-javadoc-plugin'}' introduces to cycle in the graph org .apache.maven.plugins:maven-javadoc-plugin -- org.apache.maven.plugins:maven-jx r-plugin -- org.apache.maven.plugins:maven-javadoc-plugin [INFO] [INFO] For more information, run Maven with the -e switch [INFO] Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 11:55 AM To: Maven Developers List Subject: Re: Plugins can't be built! Dennis Lundberg wrote: Brett Porter wrote: This shouldn't have broken - needs investigation. A while back, we agreed to add a feature to 2.0.5 (the implementation attribute). The plugin plugin was updated to use the new tools and such. However, it also has a prereq of maven 2.0.5, so maven 2.0.4 and below which give this error should use the previous version of the plugin. Are you saying that I need to use Maven 2.0.5 SNAPSHOT to build all plugins from now on? I prefer to stay on the released version of Maven as long as possible, to make sure that I have the same environment as most users do. But I see the chicken-and-egg problem here. If the plugin plugin has a prereq on Maven 2.0.5 shouldn't it give some sort of understandable error message to the user if he/she tries to run it with Maven 2.0.4, instead of just a stack trace? What about using profiles for this? I wonder if we should add the building of the plugins using the different releases of Maven to make sure that they keep the backwards compatability (Sorry, I do not have time to fix it :( ). -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Not using pom.xml
Hi Did you set @requiresProject=false? Hermod -Original Message- From: Jagan Padmanabha Pillai -X (jpadmana - Insight Solutions, Inc. at Cisco) [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 11:08 PM To: Maven Developers List Subject: Not using pom.xml Hi, Is there any way I can force my custom made plugin to not use pom.xml. There is a parameter @requiresProject (which is used in archetype), this works fine if there is no pom.xml. But if pom is available the plugin will use it. What I want is even if the pom.xml is available do NOT use it. Please let me know. Thanks -Jagan * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error building plugins
Hi I am trying to build the plugins, but I am getting an error that indicates that there must be an error in one of the pom's: [INFO] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='org.apache.maven.plugins:maven-jxr-plugin'}' and 'Vertex{label='org.apache.maven.plugins:maven-javadoc-plugin'}' introduces to cycle in the graph org.apache.maven.plugins:maven-javadoc-plugin -- org.apache.maven.plugins:maven-jxr-plugin -- org.apache.maven.plugins:maven-javadoc-plugin Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Embedder error when executing MOJO
Hi I have a mojo that calls the MavenExecutionRequest, and asks it to run archetyp:create. When I try to run it, the Embedder complains with the errormessage and stacktrace below. In short, it complains that there is no field ErrorDiagnostics in DefaultMaven. Why is the Embedder trying to access the non exsitant field? Has there been a code change that relies on that field now beeing present in DefaultMaven? Hermod Embedded error: Cannot lookup required component. Component composition failed. No field of type: 'class org.apache.maven.usabilit y.diagnostics.ErrorDiagnostics' exists in class 'org.apache.maven.DefaultMaven'. Component: role: 'org.apache.maven.Maven', implementation: 'org.apache.maven.De faultMaven' org.apache.maven.lifecycle.LifecycleExecutionException: Embedder at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:559) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:219) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Embedder at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:53) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:534) ... 16 more Caused by: org.apache.maven.embedder.MavenEmbedderException: Cannot lookup requi red component. at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:650) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:550) at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:51) ... 18 more Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupExc eption: Unable to lookup component 'org.apache.maven.Maven', it could not be sta rted at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:339) at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:599) ... 20 more Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycle Exception: Error starting component at org.codehaus.plexus.component.manager.AbstractComponentManager.startC omponentLifecycle(AbstractComponentManager.java:109) at org.codehaus.plexus.component.manager.AbstractComponentManager.create ComponentInstance(AbstractComponentManager.java:95) at org.codehaus.plexus.component.manager.ClassicSingletonComponentManage r.getComponent(ClassicSingletonComponentManager.java:92) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:331) ... 22 more Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecution Exception: Error composing component at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPha se.execute(CompositionPhase.java:33) at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(Abstract LifecycleHandler.java:101) at org.codehaus.plexus.component.manager.AbstractComponentManager.startC omponentLifecycle(AbstractComponentManager.java:105) ... 25 more Caused by: org.codehaus.plexus.component.composition.CompositionException: Compo nent composition failed. No field of type: 'class org.apache.maven.usability.dia gnostics.ErrorDiagnostics' exists in class 'org.apache.maven.DefaultMaven'. Comp onent: role: 'org.apache.maven.Maven', implementation: 'org.apache.maven.Default Maven' at
RE: Embedder error when executing MOJO
Hi I have been messing around with this and have discovered something odd: If I add a main method to my mojo, which again calls execute(), and run it as a regular java class with, it runs fine. It is only when I try to run it as a mojo through mvn that it fails. Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 10:27 AM To: dev@maven.apache.org Subject: Embedder error when executing MOJO Hi I have a mojo that calls the MavenExecutionRequest, and asks it to run archetype:create. When I try to run it, the Embedder complains with the errormessage and stacktrace below. In short, it complains that there is no field ErrorDiagnostics in DefaultMaven. Why is the Embedder trying to access the non exsitant field? Has there been a code change that relies on that field now beeing present in DefaultMaven? Hermod Embedded error: Cannot lookup required component. Component composition failed. No field of type: 'class org.apache.maven.usabilit y.diagnostics.ErrorDiagnostics' exists in class 'org.apache.maven.DefaultMaven'. Component: role: 'org.apache.maven.Maven', implementation: 'org.apache.maven.De faultMaven' org.apache.maven.lifecycle.LifecycleExecutionException: Embedder at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:559) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:219) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Embedder at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:53) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:534) ... 16 more Caused by: org.apache.maven.embedder.MavenEmbedderException: Cannot lookup requi red component. at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:650) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:550) at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:51) ... 18 more Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupExc eption: Unable to lookup component 'org.apache.maven.Maven', it could not be sta rted at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:339) at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:599) ... 20 more Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycle Exception: Error starting component at org.codehaus.plexus.component.manager.AbstractComponentManager.startC omponentLifecycle(AbstractComponentManager.java:109) at org.codehaus.plexus.component.manager.AbstractComponentManager.create ComponentInstance(AbstractComponentManager.java:95) at org.codehaus.plexus.component.manager.ClassicSingletonComponentManage r.getComponent(ClassicSingletonComponentManager.java:92) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:331) ... 22 more Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecution Exception: Error composing component at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPha se.execute(CompositionPhase.java:33) at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(Abstract LifecycleHandler.java:101) at
RE: Embedder error when executing MOJO
Hi I wondering if this has something to do with me trying to run Maven 2.1-SNAPSHOT version plugins under Maven 2.0.4. Is this not possible, and if not : is there a way to build Maven 2.1-SNAPSHOT? Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 12:04 PM To: dev@maven.apache.org Subject: RE: Embedder error when executing MOJO Hi I have been messing around with this and have discovered something odd: If I add a main method to my mojo, which again calls execute(), and run it as a regular java class with, it runs fine. It is only when I try to run it as a mojo through mvn that it fails. Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 10:27 AM To: dev@maven.apache.org Subject: Embedder error when executing MOJO Hi I have a mojo that calls the MavenExecutionRequest, and asks it to run archetype:create. When I try to run it, the Embedder complains with the errormessage and stacktrace below. In short, it complains that there is no field ErrorDiagnostics in DefaultMaven. Why is the Embedder trying to access the non exsitant field? Has there been a code change that relies on that field now beeing present in DefaultMaven? Hermod Embedded error: Cannot lookup required component. Component composition failed. No field of type: 'class org.apache.maven.usabilit y.diagnostics.ErrorDiagnostics' exists in class 'org.apache.maven.DefaultMaven'. Component: role: 'org.apache.maven.Maven', implementation: 'org.apache.maven.De faultMaven' org.apache.maven.lifecycle.LifecycleExecutionException: Embedder at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:559) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:219) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Embedder at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:53) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:534) ... 16 more Caused by: org.apache.maven.embedder.MavenEmbedderException: Cannot lookup requi red component. at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:650) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:550) at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:51) ... 18 more Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupExc eption: Unable to lookup component 'org.apache.maven.Maven', it could not be sta rted at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:339) at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:599) ... 20 more Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycle Exception: Error starting component at org.codehaus.plexus.component.manager.AbstractComponentManager.startC omponentLifecycle(AbstractComponentManager.java:109) at org.codehaus.plexus.component.manager.AbstractComponentManager.create ComponentInstance(AbstractComponentManager.java:95) at org.codehaus.plexus.component.manager.ClassicSingletonComponentManage r.getComponent(ClassicSingletonComponentManager.java:92) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:331)
RE: Executing mojo without a pom.
Hi Thnx, that did it (now why did I not think of trying that). What happens next must some how be related to some versioning problem I guess: In my mojo I call the embedder to have it execute a goal, but it bombs out with the following: Embedded error: Cannot lookup required component. Component composition failed. No field of type: 'class org.apache.maven.usabilit y.diagnostics.ErrorDiagnostics' exists in class 'org.apache.maven.DefaultMaven'. Component: role: 'org.apache.maven.Maven', implementation: 'org.apache.maven.De faultMaven' and the stacktrace is: org.apache.maven.lifecycle.LifecycleExecutionException: Embedder at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:559) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone [snip] Caused by: org.apache.maven.plugin.MojoExecutionException: Embedder at no.dnbnor.it01.maven.ProjectCreator.execute(ProjectCreator.java:53) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:534) [snip] Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupExc eption: Unable to lookup component 'org.apache.maven.Maven', it could not be sta rted at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai ner.java:339) at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78) [snip] Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycle Exception: Error starting component at org.codehaus.plexus.component.manager.AbstractComponentManager.startC omponentLifecycle(AbstractComponentManager.java:109) [snip] Caused by: org.codehaus.plexus.component.composition.CompositionException: Compo nent composition failed. No field of type: 'class org.apache.maven.usability.dia gnostics.ErrorDiagnostics' exists in class 'org.apache.maven.DefaultMaven'. Comp onent: role: 'org.apache.maven.Maven', implementation: 'org.apache.maven.Default Maven' Hermod -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Thursday, June 29, 2006 12:28 PM To: Maven Developers List Subject: Re: Executing mojo without a pom. On 29 Jun 06, at 5:22 AM 29 Jun 06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi That is what I thought too, but I have a very simple mojo (that does no have @requiresProject set) that when run complains that: [INFO] Cannot execute mojo: generate. It requires a project with an existing pom .xml, but the build is not using one. Sorry Hermod, it is set to true by default so in your Mojo you specifically have to say that you don't need a project using @requiresProject false You can take a look at the archetype plugin to see an example of this in action: http://svn.apache.org/viewvc/maven/archetype/trunk/maven-archetype/ maven-archetype-plugin/src/main/java/org/apache/maven/plugin/ archetype/MavenArchetypeMojo.java?view=markup Jason. Hermod -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 28, 2006 1:20 PM To: Maven Developers List Subject: Re: Executing mojo without a pom. On 28 Jun 06, at 11:18 AM 28 Jun 06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi As part of a an initial project setup, I want to execute a mojo that I have written (sort of like archetyep:create). At this stage the pom is not available, so I was wondering how to specify that the mojo does not require a pom. By default a Mojo does not require a POM. You must specify when your Mojo needs a maven project you enforce that by using the @requiresProject in your Mojo. When Maven inspects the metadata for a plugin before executing a Mojo (DefaultPluginManager) it will check this flag and throw an exception if there is no pom.xml file present. But by default you don't need a pom.xml file to have your Mojo execute. Jason. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Jason van Zyl [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Executing mojo without a pom.
Hi As part of a an initial project setup, I want to execute a mojo that I have written (sort of like archetyep:create). At this stage the pom is not available, so I was wondering how to specify that the mojo does not require a pom. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Executing mojo without a pom.
Hi That is what I thought too, but I have a very simple mojo (that does no have @requiresProject set) that when run complains that: [INFO] Cannot execute mojo: generate. It requires a project with an existing pom .xml, but the build is not using one. Hermod -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 28, 2006 1:20 PM To: Maven Developers List Subject: Re: Executing mojo without a pom. On 28 Jun 06, at 11:18 AM 28 Jun 06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi As part of a an initial project setup, I want to execute a mojo that I have written (sort of like archetyep:create). At this stage the pom is not available, so I was wondering how to specify that the mojo does not require a pom. By default a Mojo does not require a POM. You must specify when your Mojo needs a maven project you enforce that by using the @requiresProject in your Mojo. When Maven inspects the metadata for a plugin before executing a Mojo (DefaultPluginManager) it will check this flag and throw an exception if there is no pom.xml file present. But by default you don't need a pom.xml file to have your Mojo execute. Jason. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Jason van Zyl [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]
Ant java task and command line length
Hi In one of my Mojos I am running an Ant skript which execute a java task that forks a new jvm. I have run into a situation where if the commandline exceeds 1010 characters it fails. I have seen that this was also a problem with the javadoc task, but was circumvented with the addition of the useexternalfile parameter. Has anybody run into this and found a workaround for this problem? Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Your patch worked great :). Could you please file this in jira so that it becomes part of the 2.1 version if everyone agrees to this fix. Hermod -Original Message- From: Opstvedt, Hermod Sent: Tuesday, June 06, 2006 7:11 AM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi I might have a slight variation to you statement about goals operating on pom's or not. Let's say that you are creating an archetype that creates a specific multiproject layout where the pom beeing operated on is about to become a module in maybe weird module structure. In such a case there might actualy be a difference between the path to the pom, and what you consider the basedir of you structure. I'll give your patch a try and see if it solves the problem immidiatly at hand. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, June 04, 2006 4:52 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, I'm attaching a patch which tries to solve the issue with the basedir discussed in this thread. The value of the ${basedir} expression is thereby computed by one of the following fallbacks (in the given order): 1. If the goal being executed is attached to a project, take the directory where the POM file of the project resides as the ${basedir}. 2. If a basedir has been specified on the MavenExecutionRequest, take this as the ${basedir}. 3. Otherwise, take System.getProperty( user.dir ) as the ${basedir}. The patch merely introduces the fallback 2. In the current implementation, 1. and 3. are already used. Before taking any further step, I wanted to ask whether the above behavior would be OK. So, if anyone is willing to have a brief look at the patch (it's very short), that would be great as I'm still very new to the code. Thanks a lot in advance! BTW: Combining this patch with Hermod's one for the archetype plugin should solve the problem of the plugin not respecting the specified basedir when creating a new project. Greets, Ovidio [EMAIL PROTECTED] wrote: Hi Something must be wrong in another place. The eclipse:eclipse goal excutes ok with the supplied (i.e correct) basedir, but the MavenArchetypeMojo for some reason is supplied the working directory, which is not what is supplied in the call. Here is the patch : Index: MavenArchetypeMojo.java === --- MavenArchetypeMojo.java (revisjon 410213) +++ MavenArchetypeMojo.java (arbeidskopi) @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.File; /** * The archetype creation goal looks for an archetype with a given groupId, artifactId, and @@ -122,6 +123,12 @@ */ private MavenProject project; +/** + * @parameter expression=${basedir} + */ +private File basedir; + + public void execute() throws MojoExecutionException { @@ -143,8 +150,6 @@ groupId = project.getGroupId(); } -String basedir = System.getProperty( user.dir ); - if ( packageName == null ) { getLog().info( Defaulting package to group ID: + groupId ); @@ -155,7 +160,7 @@ // TODO: context mojo more appropriate? Map map = new HashMap(); -map.put( basedir, basedir ); +map.put( basedir, basedir.getAbsolutePath() ); map.put( package, packageName ); -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 9:26 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi Have not had the time before now. It still does not work. The basedir is still set to the current directory. The ${basedir} will be set to the value you set in the embedder, this is working for me in my IDEA plugin where I use the embedder. Can you include the patch from the assembly plugin so I can see what you did? -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
RE: creating a new project with the MavenEmbedder
Hi I might have a slight variation to you statement about goals operating on pom's or not. Let's say that you are creating an archetype that creates a specific multiproject layout where the pom beeing operated on is about to become a module in maybe weird module structure. In such a case there might actualy be a difference between the path to the pom, and what you consider the basedir of you structure. I'll give your patch a try and see if it solves the problem immidiatly at hand. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, June 04, 2006 4:52 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, I'm attaching a patch which tries to solve the issue with the basedir discussed in this thread. The value of the ${basedir} expression is thereby computed by one of the following fallbacks (in the given order): 1. If the goal being executed is attached to a project, take the directory where the POM file of the project resides as the ${basedir}. 2. If a basedir has been specified on the MavenExecutionRequest, take this as the ${basedir}. 3. Otherwise, take System.getProperty( user.dir ) as the ${basedir}. The patch merely introduces the fallback 2. In the current implementation, 1. and 3. are already used. Before taking any further step, I wanted to ask whether the above behavior would be OK. So, if anyone is willing to have a brief look at the patch (it's very short), that would be great as I'm still very new to the code. Thanks a lot in advance! BTW: Combining this patch with Hermod's one for the archetype plugin should solve the problem of the plugin not respecting the specified basedir when creating a new project. Greets, Ovidio [EMAIL PROTECTED] wrote: Hi Something must be wrong in another place. The eclipse:eclipse goal excutes ok with the supplied (i.e correct) basedir, but the MavenArchetypeMojo for some reason is supplied the working directory, which is not what is supplied in the call. Here is the patch : Index: MavenArchetypeMojo.java === --- MavenArchetypeMojo.java (revisjon 410213) +++ MavenArchetypeMojo.java (arbeidskopi) @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.File; /** * The archetype creation goal looks for an archetype with a given groupId, artifactId, and @@ -122,6 +123,12 @@ */ private MavenProject project; +/** + * @parameter expression=${basedir} + */ +private File basedir; + + public void execute() throws MojoExecutionException { @@ -143,8 +150,6 @@ groupId = project.getGroupId(); } -String basedir = System.getProperty( user.dir ); - if ( packageName == null ) { getLog().info( Defaulting package to group ID: + groupId ); @@ -155,7 +160,7 @@ // TODO: context mojo more appropriate? Map map = new HashMap(); -map.put( basedir, basedir ); +map.put( basedir, basedir.getAbsolutePath() ); map.put( package, packageName ); -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 9:26 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi Have not had the time before now. It still does not work. The basedir is still set to the current directory. The ${basedir} will be set to the value you set in the embedder, this is working for me in my IDEA plugin where I use the embedder. Can you include the patch from the assembly plugin so I can see what you did? -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Something must be wrong in another place. The eclipse:eclipse goal excutes ok with the supplied (i.e correct) basedir, but the MavenArchetypeMojo for some reason is supplied the working directory, which is not what is supplied in the call. Here is the patch : Index: MavenArchetypeMojo.java === --- MavenArchetypeMojo.java (revisjon 410213) +++ MavenArchetypeMojo.java (arbeidskopi) @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.File; /** * The archetype creation goal looks for an archetype with a given groupId, artifactId, and @@ -122,6 +123,12 @@ */ private MavenProject project; +/** + * @parameter expression=${basedir} + */ +private File basedir; + + public void execute() throws MojoExecutionException { @@ -143,8 +150,6 @@ groupId = project.getGroupId(); } -String basedir = System.getProperty( user.dir ); - if ( packageName == null ) { getLog().info( Defaulting package to group ID: + groupId ); @@ -155,7 +160,7 @@ // TODO: context mojo more appropriate? Map map = new HashMap(); -map.put( basedir, basedir ); +map.put( basedir, basedir.getAbsolutePath() ); map.put( package, packageName ); -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 9:26 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi Have not had the time before now. It still does not work. The basedir is still set to the current directory. The ${basedir} will be set to the value you set in the embedder, this is working for me in my IDEA plugin where I use the embedder. Can you include the patch from the assembly plugin so I can see what you did? -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Yes, I actually had that line in, and it did printed the current directory, not the one given by the .setBaseDir call. That was why I wrote that something must be wrong in another bean, and queried about which bean is responsible for setting the parameters. The odd thing is as I wrote that the eclipse:eclipse archetype does it right. Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 12:10 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi Something must be wrong in another place. The eclipse:eclipse goal excutes ok with the supplied (i.e correct) basedir, but the MavenArchetypeMojo for some reason is supplied the working directory, which is not what is supplied in the call. You mean if you add this: System.out.println(basedir: + basedir.getAbsolutePath() ); it will give you the current directory instead of the one you give the embedder? If it do give the correct value it got to be an issue with something inside the Archetype core itself. Here is the patch : The patch looks correct. -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Have not had the time before now. It still does not work. The basedir is still set to the current directory. Which class is responsible for setting it? Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 12:12 PM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi I'll fix it, and give it a test run. thnx Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 9:22 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi I tried what you suggested, and it did create a project in a directory with the given artifactId, i.e: mvn -f foo/pom.xml archetype:create -DartifactId=whatever creates a project under whatever and the output is : [snip] Notice that the basedir from the log output does not match what was given as input parameter to .setBasedir. It looks like it is ignoring it alltogether. This is as I though, the archetype plugin doesn't use the basedir as it should. Another guy at irc found out the same thing yesterday. If you could try to fix the plugin yourself that would be great. What needs to be done: Add this to the mojo [1]: /** * @parameter expression=${basedir} */ private File basedir; and replace map.put( basedir, basedir ); with map.put( basedir, basedir.getAbsolutePath() ); and try that. If it works please create an issue and submit the patch like it's described in [2]. [1]: https://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java [2]: http://maven.apache.org/guides/development/guide-m2-development.html -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Ok, I'll give that a try and see what happens then. Anyways, the issue of archetype:create and baseDir still stands. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:30 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod, I'm not sure what it is but in any case I would avoid calling a second goal together with the archetype:create goal which should work on the project yet to be created since the following maven2 invocation also fails on the commandline: mvn -DgroupId=a.b.c -DartifactId=d archetype:create eclipse:eclipse This is because eclipse:eclipse needs some project but at the time of invocation none exists yet (you are still creating it). This would then probably explain that when you set your POM file E:/foo/pom.xml on the request, the eclipse:eclipse goal is attached to that existing project and not to the one being created. So, I would really execute the two goals archetype:create and eclipse:eclipse one after the other. Bye, Ovidio [EMAIL PROTECTED] wrote: Hi A little update. I added .setPomFile(E:/foo/pom.xml) to DefaultMavenExecutionRequest, and now it definitly gets weird : [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] Building Unnamed - a.b.c:stdproject-plugin:jar:0.1-SNAPSHOT [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing eclipse:eclipse [ maven embedder INFO] No goals needed for project - skipping [ maven embedder INFO] Not writing settings - defaults suffice [ maven embedder INFO] Wrote Eclipse project for stdproject-plugin to E:\foo. [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] So now it is still creating the project in the current directory with the archetype:create goal, but it is creating the eclipse stuff in foo !? Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 7:18 AM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi I tried what you suggested, and it did create a project in a directory with the given artifactId, i.e: mvn -f foo/pom.xml archetype:create -DartifactId=whatever creates a project under whatever and the output is : [INFO] Parameter: groupId, Value: a.b.c [INFO] Parameter: packageName, Value: a.b.c [INFO] Parameter: basedir, Value: E:\ [INFO] Parameter: package, Value: a.b.c [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: whatever [INFO] * End of debug info from resources from generated POM *** [INFO] Archetype created in dir: E:\whatever However, running this code (with goals=archetype:create eclipse:eclipse : MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(new File(E:/Test)).setGoals(goals) .setLocalRepositoryPath( embedder.getLocalRepositoryPath(settings)).setSettings( settings).setProperties(properties).addEventMonitor( new DefaultEventMonitor(new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger))); embedder.execute(request); Gives: [ maven embedder INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from central [ maven embedder INFO]
RE: creating a new project with the MavenEmbedder
Hi No cigar - Doing it two steps yields the same result as if doing it in one step - Here is the output: [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] [ maven embedder INFO] Total time: 58 seconds [ maven embedder INFO] Finished at: Wed May 31 08:42:55 CEST 2006 [ maven embedder INFO] Final Memory: 5M/9M [ maven embedder INFO] [ maven embedder INFO] Scanning for projects... [ maven embedder INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from central [ maven embedder INFO] [ maven embedder INFO] Building Unnamed - a.b.c:stdproject-plugin:jar:0.1-SNAPSHOT [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing eclipse:eclipse [ maven embedder INFO] No goals needed for project - skipping [ maven embedder INFO] File E:\foo\.project already exists. Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed. [ maven embedder INFO] Not writing settings - defaults suffice [ maven embedder INFO] Wrote Eclipse project for stdproject-plugin to E:\foo. [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:39 AM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi Ok, I'll give that a try and see what happens then. Anyways, the issue of archetype:create and baseDir still stands. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:30 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod, I'm not sure what it is but in any case I would avoid calling a second goal together with the archetype:create goal which should work on the project yet to be created since the following maven2 invocation also fails on the commandline: mvn -DgroupId=a.b.c -DartifactId=d archetype:create eclipse:eclipse This is because eclipse:eclipse needs some project but at the time of invocation none exists yet (you are still creating it). This would then probably explain that when you set your POM file E:/foo/pom.xml on the request, the eclipse:eclipse goal is attached to that existing project and not to the one being created. So, I would really execute the two goals archetype:create and eclipse:eclipse one after the other. Bye, Ovidio [EMAIL PROTECTED] wrote: Hi A little update. I added .setPomFile(E:/foo/pom.xml) to DefaultMavenExecutionRequest, and now it definitly gets weird : [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01
RE: creating a new project with the MavenEmbedder
Hi Yepp, you are right. The problem stems from the fact that the archetype:create goals creates it in the wrong directory. I just have'nt done anything with the code to work around this. I'm going to start debugging through the archetype:create mojo-code to see where things go wrong first. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 9:01 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi again, [...] Anyways, the issue of archetype:create and baseDir still stands. That's true. The same thing happens to me. No cigar - Doing it two steps yields the same result as if doing it in one step - Here is the output: What POM file have you set on the request for the eclipse:eclipse goal? It seems to me that you have still set it to E:/foo/pom.xml even though I guess you want to execute the eclipse:eclipse goal on the project being created, don't you? If so, you should set it to ./new_project/pom.xml or something similar. Sorry, if I misunderstood something. Greets, Ovidio [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] [ maven embedder INFO] Total time: 58 seconds [ maven embedder INFO] Finished at: Wed May 31 08:42:55 CEST 2006 [ maven embedder INFO] Final Memory: 5M/9M [ maven embedder INFO] [ maven embedder INFO] Scanning for projects... [ maven embedder INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from central [ maven embedder INFO] [ maven embedder INFO] Building Unnamed - a.b.c:stdproject-plugin:jar:0.1-SNAPSHOT [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing eclipse:eclipse [ maven embedder INFO] No goals needed for project - skipping [ maven embedder INFO] File E:\foo\.project already exists. Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed. [ maven embedder INFO] Not writing settings - defaults suffice [ maven embedder INFO] Wrote Eclipse project for stdproject-plugin to E:\foo. [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:39 AM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi Ok, I'll give that a try and see what happens then. Anyways, the issue of archetype:create and baseDir still stands. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:30 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod, I'm not sure what it is but in any case I would avoid calling a second goal together with the archetype:create goal which should work on the project yet to be created since the following maven2 invocation also fails on the commandline: mvn -DgroupId=a.b.c -DartifactId=d archetype:create eclipse:eclipse This is because eclipse:eclipse needs some project but at the time of invocation none exists yet (you are still creating it). This would then probably explain that when you set your POM file E:/foo/pom.xml on the request, the eclipse:eclipse goal is attached to that existing project and not to the one being created. So, I would really execute the two goals archetype:create and eclipse:eclipse one
RE: creating a new project with the MavenEmbedder
Hi I have been giving this some thought, and I am wondering if this behaviour is by design (Committers: feel free to chip in here). If you execute a mojo from a commandline, it takes effect from the current directory. There is no parameter/command line switch to direct it to another working directory. Now you might start to wonder: What is the use of the setBaseDir of DefaultMavenExecutionRequest ? As far as I can tell, the only reference to the base directory is in DefaultEventMonitor, which does logging. Since there is no way you can change the working directory in java (i.e can't chdir), in order for this to work from a programatical way, the archetype:create mojo needs to be augmented with baseDir property which it will then use when it creates the project. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 9:01 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi again, [...] Anyways, the issue of archetype:create and baseDir still stands. That's true. The same thing happens to me. No cigar - Doing it two steps yields the same result as if doing it in one step - Here is the output: What POM file have you set on the request for the eclipse:eclipse goal? It seems to me that you have still set it to E:/foo/pom.xml even though I guess you want to execute the eclipse:eclipse goal on the project being created, don't you? If so, you should set it to ./new_project/pom.xml or something similar. Sorry, if I misunderstood something. Greets, Ovidio [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] [ maven embedder INFO] Total time: 58 seconds [ maven embedder INFO] Finished at: Wed May 31 08:42:55 CEST 2006 [ maven embedder INFO] Final Memory: 5M/9M [ maven embedder INFO] [ maven embedder INFO] Scanning for projects... [ maven embedder INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from central [ maven embedder INFO] [ maven embedder INFO] Building Unnamed - a.b.c:stdproject-plugin:jar:0.1-SNAPSHOT [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing eclipse:eclipse [ maven embedder INFO] No goals needed for project - skipping [ maven embedder INFO] File E:\foo\.project already exists. Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed. [ maven embedder INFO] Not writing settings - defaults suffice [ maven embedder INFO] Wrote Eclipse project for stdproject-plugin to E:\foo. [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:39 AM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi Ok, I'll give that a try and see what happens then. Anyways, the issue of archetype:create and baseDir still stands. Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 8:30 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod, I'm not sure what it is but in any case I would avoid calling a second goal together with the archetype:create goal which should work on the project yet to be created since the following maven2 invocation also fails on the
RE: creating a new project with the MavenEmbedder
Hi I'll fix it, and give it a test run. thnx Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 9:22 AM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi I tried what you suggested, and it did create a project in a directory with the given artifactId, i.e: mvn -f foo/pom.xml archetype:create -DartifactId=whatever creates a project under whatever and the output is : [snip] Notice that the basedir from the log output does not match what was given as input parameter to .setBasedir. It looks like it is ignoring it alltogether. This is as I though, the archetype plugin doesn't use the basedir as it should. Another guy at irc found out the same thing yesterday. If you could try to fix the plugin yourself that would be great. What needs to be done: Add this to the mojo [1]: /** * @parameter expression=${basedir} */ private File basedir; and replace map.put( basedir, basedir ); with map.put( basedir, basedir.getAbsolutePath() ); and try that. If it works please create an issue and submit the patch like it's described in [2]. [1]: https://svn.apache.org/repos/asf/maven/archetype/trunk/maven-archetype/maven-archetype-plugin/src/main/java/org/apache/maven/plugin/archetype/MavenArchetypeMojo.java [2]: http://maven.apache.org/guides/development/guide-m2-development.html -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Thank you for the tip. However the ting is that the functionality that I am after actualy presumes that there does not exist any pom. Your sample does require a pom. I was hoping to create an archetype that creates a complete project setup for new developers coming into any of our projects. As far as I have been able to find out, the Maven 2 archetypes are stupid in the sense that there does no seem to be any way have them execute a mojo as part of the lifecycle. They only create the directory structures and copy in the predefines resources. So unless someone can tell me otherwise I'll have to stick with the newest embedder and create a batchfile/shellscript that runs a configurable set set of goals. Not quite what I was hoping for. Maybe I should enter en RFE for the archetype architecture to enable it to run goals? Hermod -Original Message- From: Rinku [mailto:[EMAIL PROTECTED] Sent: Monday, May 29, 2006 10:19 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod, Coincidently, there was a thread on maven-users list about delegating goal to another mojo (see yesterday's posts). I have posted a similar code snippet there that uses embedder, you might want give it a try if you want to stick to released version. HTH, Rahul - Original Message - From: [EMAIL PROTECTED] To: dev@maven.apache.org Sent: Tuesday, May 30, 2006 12:34 AM Subject: RE: creating a new project with the MavenEmbedder Hi Ok, I'll get it from SVN and compile it. Thnx Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Monday, May 29, 2006 1:58 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod! The class compiles against the current 2.1-SNAPSHOT version. The previous versions 2.0.3 and 2.0.4 seem to have a somewhat different API, so it will not compile with those. Prior to my original post on this subject, I was trying to get the whole thing working with the version 2.0.4, but failed, so I'm not sure whether it is possible to achieve the same thing with the old API. Unfortunately, since the version 2.1-SNAPSHOT is probably not on the central repository, you probably have to compile it from the sources. That's at least what I did. Hope that helps! Best regards, Ovidio [EMAIL PROTECTED] wrote: Hi Which version of the embedder is this? I get errors on the methods: getUserSettingsPath and getGlobalSettingsPath - No such methods in the Maven embedder (2.0.3). Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 12:36 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, Thanks a lot, Kenney, for your explanation and code snippet! This is exactly what I was looking for! I have filled in the tiny missing details in your sample code to build up a working example which you can find below. Just in case anyone else is interested in it. One thing I noticed is that the example should not be run from within a directory containing a pom.xml file since, otherwise, this project file is interpreted as being the parent model file! Well, again, thanks a lot! Regards, Ovidio public class ProjectCreator { public static void main(String[] args) throws Exception { MavenEmbedder embedder = new MavenEmbedder(); embedder.setClassLoader( Thread.currentThread().getContextClassLoader() ); embedder.setLogger( new MavenEmbedderConsoleLogger() ); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, Boolean.FALSE ); Properties properties = new Properties(); properties.put( groupId, net.sytes.meco ); properties.put( artifactId, new_project ); MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir( new File( /tmp ) ) .setGoals( Arrays.asList( new String[] { archetype:create } ) ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) ) .setSettings( settings ) .setProperties( properties ) .addEventMonitor( new DefaultEventMonitor( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger ) ) ); embedder.execute( request ); } } Kenney Westerhof wrote: On Sat, 27 May 2006, Ovidio Mallo wrote: Hi, Well, currently running archetype:create seems the simplest way to me. The embedder is primarily meant to build projects, not to create them. You might want to take a look at the maven-cli project. Some plugins, like
RE: creating a new project with the MavenEmbedder
Hi I can't seem to get this to run correctly. I am getting the following error when running your code: org.apache.maven.archetype.ArchetypeTemplateProcessingException: Unable to add module to the current project as it is not of packaging type 'pom' Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Monday, May 29, 2006 1:58 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod! The class compiles against the current 2.1-SNAPSHOT version. The previous versions 2.0.3 and 2.0.4 seem to have a somewhat different API, so it will not compile with those. Prior to my original post on this subject, I was trying to get the whole thing working with the version 2.0.4, but failed, so I'm not sure whether it is possible to achieve the same thing with the old API. Unfortunately, since the version 2.1-SNAPSHOT is probably not on the central repository, you probably have to compile it from the sources. That's at least what I did. Hope that helps! Best regards, Ovidio [EMAIL PROTECTED] wrote: Hi Which version of the embedder is this? I get errors on the methods: getUserSettingsPath and getGlobalSettingsPath - No such methods in the Maven embedder (2.0.3). Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 12:36 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, Thanks a lot, Kenney, for your explanation and code snippet! This is exactly what I was looking for! I have filled in the tiny missing details in your sample code to build up a working example which you can find below. Just in case anyone else is interested in it. One thing I noticed is that the example should not be run from within a directory containing a pom.xml file since, otherwise, this project file is interpreted as being the parent model file! Well, again, thanks a lot! Regards, Ovidio public class ProjectCreator { public static void main(String[] args) throws Exception { MavenEmbedder embedder = new MavenEmbedder(); embedder.setClassLoader( Thread.currentThread().getContextClassLoader() ); embedder.setLogger( new MavenEmbedderConsoleLogger() ); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, Boolean.FALSE ); Properties properties = new Properties(); properties.put( groupId, net.sytes.meco ); properties.put( artifactId, new_project ); MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir( new File( /tmp ) ) .setGoals( Arrays.asList( new String[] { archetype:create } ) ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) ) .setSettings( settings ) .setProperties( properties ) .addEventMonitor( new DefaultEventMonitor( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger ) ) ); embedder.execute( request ); } } Kenney Westerhof wrote: On Sat, 27 May 2006, Ovidio Mallo wrote: Hi, Well, currently running archetype:create seems the simplest way to me. The embedder is primarily meant to build projects, not to create them. You might want to take a look at the maven-cli project. Some plugins, like archetype, don't require an existing pom.xml. A sequence like this (more or less) should work for you: MavenEmbedder embedder = new MavenEmbedder(); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, false ); Properties properties = new Properties(); // set archetype parameters in properties MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(..) .setGoals( Arrays.asList( new String[] { archetype.create } ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) .setSettings( settings ) .setProperties( properties ); embedder.execute( request ); .. and we don't set a pom file here. Good luck! -- Kenney Hi everyone! I just wanted to ask whether there is a clean way to create a new maven project using the MavenEmbedder API. It is of course possible to execute the archetype:create goal but the API seems to always require that you already pass in an existing project (at least an existing pom.xml file) in order to execute any goal. I think such a feature would be quite handy for other
RE: creating a new project with the MavenEmbedder
Hi I was running in a directory where a pom existed. Now running it in an empty directory gives me: Component composition failed. No field of type: 'interface org.apache.maven.artifact.transform.ArtifactTransformationManager' exists in class 'org.apache.maven.project.DefaultMavenProjectBuilder'. Component: role: 'org.apache.maven.project.MavenProjectBuilder', implementation: 'org.apache.maven.project.DefaultMavenProjectBuilder' Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 12:20 PM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi I can't seem to get this to run correctly. I am getting the following error when running your code: org.apache.maven.archetype.ArchetypeTemplateProcessingException: Unable to add module to the current project as it is not of packaging type 'pom' Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Monday, May 29, 2006 1:58 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod! The class compiles against the current 2.1-SNAPSHOT version. The previous versions 2.0.3 and 2.0.4 seem to have a somewhat different API, so it will not compile with those. Prior to my original post on this subject, I was trying to get the whole thing working with the version 2.0.4, but failed, so I'm not sure whether it is possible to achieve the same thing with the old API. Unfortunately, since the version 2.1-SNAPSHOT is probably not on the central repository, you probably have to compile it from the sources. That's at least what I did. Hope that helps! Best regards, Ovidio [EMAIL PROTECTED] wrote: Hi Which version of the embedder is this? I get errors on the methods: getUserSettingsPath and getGlobalSettingsPath - No such methods in the Maven embedder (2.0.3). Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 12:36 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, Thanks a lot, Kenney, for your explanation and code snippet! This is exactly what I was looking for! I have filled in the tiny missing details in your sample code to build up a working example which you can find below. Just in case anyone else is interested in it. One thing I noticed is that the example should not be run from within a directory containing a pom.xml file since, otherwise, this project file is interpreted as being the parent model file! Well, again, thanks a lot! Regards, Ovidio public class ProjectCreator { public static void main(String[] args) throws Exception { MavenEmbedder embedder = new MavenEmbedder(); embedder.setClassLoader( Thread.currentThread().getContextClassLoader() ); embedder.setLogger( new MavenEmbedderConsoleLogger() ); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, Boolean.FALSE ); Properties properties = new Properties(); properties.put( groupId, net.sytes.meco ); properties.put( artifactId, new_project ); MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir( new File( /tmp ) ) .setGoals( Arrays.asList( new String[] { archetype:create } ) ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) ) .setSettings( settings ) .setProperties( properties ) .addEventMonitor( new DefaultEventMonitor( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger ) ) ); embedder.execute( request ); } } Kenney Westerhof wrote: On Sat, 27 May 2006, Ovidio Mallo wrote: Hi, Well, currently running archetype:create seems the simplest way to me. The embedder is primarily meant to build projects, not to create them. You might want to take a look at the maven-cli project. Some plugins, like archetype, don't require an existing pom.xml. A sequence like this (more or less) should work for you: MavenEmbedder embedder = new MavenEmbedder(); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, false ); Properties properties = new Properties(); // set archetype parameters in properties MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(..) .setGoals( Arrays.asList( new String[] { archetype.create } )
RE: creating a new project with the MavenEmbedder
Hi Bullseye - I had a 2.0.1 version in there. Now they are all 2.1-SNAPSHOT and it works OK. Thnx. Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 1:07 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi I was running in a directory where a pom existed. Now running it in an empty directory gives me: Component composition failed. No field of type: 'interface org.apache.maven.artifact.transform.ArtifactTransformationManager' exists in class 'org.apache.maven.project.DefaultMavenProjectBuilder'. Component: role: 'org.apache.maven.project.MavenProjectBuilder', implementation: 'org.apache.maven.project.DefaultMavenProjectBuilder' This looks like an error where you have mixed a few versions of the artifacts. I would guess that you're including both 2.0.x and 2.1.x artitfacts in your class path. -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi Now that I got it running, I have discovered something that may be an error in the DefaultExecutionRequest: This is how I run it: MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(new File(E:/Test)).setGoals(goals) .setLocalRepositoryPath( embedder.getLocalRepositoryPath(settings)).setSettings( settings).setProperties(properties).addEventMonitor( new DefaultEventMonitor(new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger))); The problem is that is is ignoring the .setBasedir(new File(E:/Test)) and creating the project in the current directory ( I am running the archetype:create goal). Is this a known error or am I presuming wrong here. Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 1:23 PM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi Bullseye - I had a 2.0.1 version in there. Now they are all 2.1-SNAPSHOT and it works OK. Thnx. Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 1:07 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi I was running in a directory where a pom existed. Now running it in an empty directory gives me: Component composition failed. No field of type: 'interface org.apache.maven.artifact.transform.ArtifactTransformationManager' exists in class 'org.apache.maven.project.DefaultMavenProjectBuilder'. Component: role: 'org.apache.maven.project.MavenProjectBuilder', implementation: 'org.apache.maven.project.DefaultMavenProjectBuilder' This looks like an error where you have mixed a few versions of the artifacts. I would guess that you're including both 2.0.x and 2.1.x artitfacts in your class path. -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi I'll give it a try. If it does not work, I'll look into what goes on in DefaultMavenExecutionRequest. Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 1:55 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi Now that I got it running, I have discovered something that may be an error in the DefaultExecutionRequest: This is how I run it: MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(new File(E:/Test)).setGoals(goals) .setLocalRepositoryPath( embedder.getLocalRepositoryPath(settings)).setSettings( settings).setProperties(properties).addEventMonitor( new DefaultEventMonitor(new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger))); The problem is that is is ignoring the .setBasedir(new File(E:/Test)) and creating the project in the current directory ( I am running the archetype:create goal). Is this a known error or am I presuming wrong here. This might be a issue with the archetype mojo. Try this: * Create a pom.xml under foo/ * mvn -f foo/pom.xml archetype:create .. If the files are created in the current directory that's an issue with the Mojo. I've used the embedder successfully myself so I'm pretty sure that it works as expected, though I haven't used it without a pom.xml under the basedir. -- Trygve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a new project with the MavenEmbedder
Hi I tried what you suggested, and it did create a project in a directory with the given artifactId, i.e: mvn -f foo/pom.xml archetype:create -DartifactId=whatever creates a project under whatever and the output is : [INFO] Parameter: groupId, Value: a.b.c [INFO] Parameter: packageName, Value: a.b.c [INFO] Parameter: basedir, Value: E:\ [INFO] Parameter: package, Value: a.b.c [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: whatever [INFO] * End of debug info from resources from generated POM *** [INFO] Archetype created in dir: E:\whatever However, running this code (with goals=archetype:create eclipse:eclipse : MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(new File(E:/Test)).setGoals(goals) .setLocalRepositoryPath( embedder.getLocalRepositoryPath(settings)).setSettings( settings).setProperties(properties).addEventMonitor( new DefaultEventMonitor(new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger))); embedder.execute(request); Gives: [ maven embedder INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from central [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] Building Maven Default Project [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing eclipse:eclipse [ maven embedder INFO] No goals needed for project - skipping [ maven embedder INFO] [ maven embedder ERROR] BUILD ERROR [ maven embedder INFO] [ maven embedder INFO] Cannot execute mojo: eclipse. It requires a project with an existing pom.xml, but the build is not using one. [ maven embedder INFO] . Notice that the basedir from the log output does not match what was given as input parameter to .setBasedir. It looks like it is ignoring it alltogether. Hermod - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 2:03 PM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi I'll give it a try. If it does not work, I'll look into what goes on in DefaultMavenExecutionRequest. Hermod -Original Message- From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 1:55 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder [EMAIL PROTECTED] wrote: Hi Now that I got it running, I have discovered something that may be an error in the DefaultExecutionRequest: This is how I run it: MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(new File(E:/Test)).setGoals(goals) .setLocalRepositoryPath( embedder.getLocalRepositoryPath(settings)).setSettings( settings).setProperties(properties).addEventMonitor( new DefaultEventMonitor(new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger))); The problem is that is is ignoring the .setBasedir(new File(E:/Test)) and creating the project in the current directory ( I am running the
RE: creating a new project with the MavenEmbedder
Hi A little update. I added .setPomFile(E:/foo/pom.xml) to DefaultMavenExecutionRequest, and now it definitly gets weird : [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] Building Unnamed - a.b.c:stdproject-plugin:jar:0.1-SNAPSHOT [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing eclipse:eclipse [ maven embedder INFO] No goals needed for project - skipping [ maven embedder INFO] Not writing settings - defaults suffice [ maven embedder INFO] Wrote Eclipse project for stdproject-plugin to E:\foo. [ maven embedder INFO] [ maven embedder INFO] BUILD SUCCESSFUL [ maven embedder INFO] So now it is still creating the project in the current directory with the archetype:create goal, but it is creating the eclipse stuff in foo !? Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 7:18 AM To: dev@maven.apache.org Subject: RE: creating a new project with the MavenEmbedder Hi I tried what you suggested, and it did create a project in a directory with the given artifactId, i.e: mvn -f foo/pom.xml archetype:create -DartifactId=whatever creates a project under whatever and the output is : [INFO] Parameter: groupId, Value: a.b.c [INFO] Parameter: packageName, Value: a.b.c [INFO] Parameter: basedir, Value: E:\ [INFO] Parameter: package, Value: a.b.c [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: whatever [INFO] * End of debug info from resources from generated POM *** [INFO] Archetype created in dir: E:\whatever However, running this code (with goals=archetype:create eclipse:eclipse : MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(new File(E:/Test)).setGoals(goals) .setLocalRepositoryPath( embedder.getLocalRepositoryPath(settings)).setSettings( settings).setProperties(properties).addEventMonitor( new DefaultEventMonitor(new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger))); embedder.execute(request); Gives: [ maven embedder INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from central [ maven embedder INFO] [ maven embedder INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE [ maven embedder INFO] [ maven embedder INFO] Parameter: groupId, Value: a.b.c [ maven embedder INFO] Parameter: packageName, Value: a.b.c [ maven embedder INFO] Parameter: basedir, Value: E:\IT-01 Maven\TestMavenRun [ maven embedder INFO] Parameter: package, Value: a.b.c [ maven embedder INFO] Parameter: version, Value: 0.1-SNAPSHOT [ maven embedder INFO] Parameter: artifactId, Value: new_project [ maven embedder INFO] * End of debug info from resources from generated POM *** [ maven embedder INFO] Archetype created in dir: E:\IT-01 Maven\TestMavenRun\new_project [ maven embedder INFO] [ maven embedder INFO] Building Maven Default Project [ maven embedder INFO]task-segment: [eclipse:eclipse] [ maven embedder INFO] [ maven embedder INFO] Preparing
RE: creating a new project with the MavenEmbedder
Hi Which version of the embedder is this? I get errors on the methods: getUserSettingsPath and getGlobalSettingsPath - No such methods in the Maven embedder (2.0.3). Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 12:36 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, Thanks a lot, Kenney, for your explanation and code snippet! This is exactly what I was looking for! I have filled in the tiny missing details in your sample code to build up a working example which you can find below. Just in case anyone else is interested in it. One thing I noticed is that the example should not be run from within a directory containing a pom.xml file since, otherwise, this project file is interpreted as being the parent model file! Well, again, thanks a lot! Regards, Ovidio public class ProjectCreator { public static void main(String[] args) throws Exception { MavenEmbedder embedder = new MavenEmbedder(); embedder.setClassLoader( Thread.currentThread().getContextClassLoader() ); embedder.setLogger( new MavenEmbedderConsoleLogger() ); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, Boolean.FALSE ); Properties properties = new Properties(); properties.put( groupId, net.sytes.meco ); properties.put( artifactId, new_project ); MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir( new File( /tmp ) ) .setGoals( Arrays.asList( new String[] { archetype:create } ) ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) ) .setSettings( settings ) .setProperties( properties ) .addEventMonitor( new DefaultEventMonitor( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger ) ) ); embedder.execute( request ); } } Kenney Westerhof wrote: On Sat, 27 May 2006, Ovidio Mallo wrote: Hi, Well, currently running archetype:create seems the simplest way to me. The embedder is primarily meant to build projects, not to create them. You might want to take a look at the maven-cli project. Some plugins, like archetype, don't require an existing pom.xml. A sequence like this (more or less) should work for you: MavenEmbedder embedder = new MavenEmbedder(); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, false ); Properties properties = new Properties(); // set archetype parameters in properties MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(..) .setGoals( Arrays.asList( new String[] { archetype.create } ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) .setSettings( settings ) .setProperties( properties ); embedder.execute( request ); .. and we don't set a pom file here. Good luck! -- Kenney Hi everyone! I just wanted to ask whether there is a clean way to create a new maven project using the MavenEmbedder API. It is of course possible to execute the archetype:create goal but the API seems to always require that you already pass in an existing project (at least an existing pom.xml file) in order to execute any goal. I think such a feature would be quite handy for other projects such as the Maven2 Eclipse Plugin. Thanks in advance for any help! Regards, Ovidio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * *
RE: creating a new project with the MavenEmbedder
Hi Ok, I'll get it from SVN and compile it. Thnx Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Monday, May 29, 2006 1:58 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi Hermod! The class compiles against the current 2.1-SNAPSHOT version. The previous versions 2.0.3 and 2.0.4 seem to have a somewhat different API, so it will not compile with those. Prior to my original post on this subject, I was trying to get the whole thing working with the version 2.0.4, but failed, so I'm not sure whether it is possible to achieve the same thing with the old API. Unfortunately, since the version 2.1-SNAPSHOT is probably not on the central repository, you probably have to compile it from the sources. That's at least what I did. Hope that helps! Best regards, Ovidio [EMAIL PROTECTED] wrote: Hi Which version of the embedder is this? I get errors on the methods: getUserSettingsPath and getGlobalSettingsPath - No such methods in the Maven embedder (2.0.3). Hermod -Original Message- From: Ovidio Mallo [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 12:36 PM To: Maven Developers List Subject: Re: creating a new project with the MavenEmbedder Hi, Thanks a lot, Kenney, for your explanation and code snippet! This is exactly what I was looking for! I have filled in the tiny missing details in your sample code to build up a working example which you can find below. Just in case anyone else is interested in it. One thing I noticed is that the example should not be run from within a directory containing a pom.xml file since, otherwise, this project file is interpreted as being the parent model file! Well, again, thanks a lot! Regards, Ovidio public class ProjectCreator { public static void main(String[] args) throws Exception { MavenEmbedder embedder = new MavenEmbedder(); embedder.setClassLoader( Thread.currentThread().getContextClassLoader() ); embedder.setLogger( new MavenEmbedderConsoleLogger() ); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, Boolean.FALSE ); Properties properties = new Properties(); properties.put( groupId, net.sytes.meco ); properties.put( artifactId, new_project ); MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir( new File( /tmp ) ) .setGoals( Arrays.asList( new String[] { archetype:create } ) ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) ) .setSettings( settings ) .setProperties( properties ) .addEventMonitor( new DefaultEventMonitor( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, logger ) ) ); embedder.execute( request ); } } Kenney Westerhof wrote: On Sat, 27 May 2006, Ovidio Mallo wrote: Hi, Well, currently running archetype:create seems the simplest way to me. The embedder is primarily meant to build projects, not to create them. You might want to take a look at the maven-cli project. Some plugins, like archetype, don't require an existing pom.xml. A sequence like this (more or less) should work for you: MavenEmbedder embedder = new MavenEmbedder(); embedder.start(); Settings settings = embedder.buildSettings( embedder.getUserSettingsPath( null ), embedder.getGlobalSettingsPath(), false, false, false, false ); Properties properties = new Properties(); // set archetype parameters in properties MavenExecutionRequest request = new DefaultMavenExecutionRequest() .setBasedir(..) .setGoals( Arrays.asList( new String[] { archetype.create } ) .setLocalRepositoryPath( embedder.getLocalRepositoryPath( settings ) .setSettings( settings ) .setProperties( properties ); embedder.execute( request ); .. and we don't set a pom file here. Good luck! -- Kenney Hi everyone! I just wanted to ask whether there is a clean way to create a new maven project using the MavenEmbedder API. It is of course possible to execute the archetype:create goal but the API seems to always require that you already pass in an existing project (at least an existing pom.xml file) in order to execute any goal. I think such a feature would be quite handy for other projects such as the Maven2 Eclipse Plugin. Thanks in advance for any help! Regards, Ovidio - To unsubscribe,
FW: Maven Archetypes
Hi Reposting it here, since no takers on the user list: I am working on an archetype that is going to set up a special development environment, and I have the following question: Is it possible to specify an execution entry for archetypes. What I mean is that I want an Ant script or maybe a Mojo to execute during the archetype execution lifecycle. The reason beeing that I amongst other stuff want to get the latest version of a project from Subversion as an example. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-jira-plugin
Hi Is there any news on this plugin - Currently it does nothing but print the tableheader with no issues listed. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[M2] Distribution and SCP trouble
Hi I am having a serious issue with the distributionManagement and scp. If I try : distributionManagement site iddnbnoritu-repo/id urlscp:sdlut003://Apache2/htdocs/wasplugin//url /site repository iddnbnoritu-repo/id nameRepository Name/name url scp:sdlut003://Apache2/htdocs/pub/lib/m2/repository /url /repository /distributionManagement it tries to create a directory 03 (as of the last part of sdlut003) if I change that to: distributionManagement site iddnbnoritu-repo/id urlscp:sdlut003.sandslimarka55.dnb.no://Apache2/htdocs/wasplugin//url /site repository iddnbnoritu-repo/id nameRepository Name/name url scp:sdlut003.sandslimarka55.dnb.no://Apache2/htdocs/pub/lib/m2/repository /url /repository /distributionManagement it now tries to create a directory .no Seems to me that there must be something wrong with the wagon plugin here - Meaning it does not handle numbers in server names or multiple subdomains in servernames. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [m2] Maven Ant mojos and logging
Hi No dev takers on this ? Hermod -Original Message- From: Opstvedt, Hermod Sent: Thursday, April 06, 2006 10:43 AM To: dev@maven.apache.org Subject: [m2] Maven Ant mojos and logging Hi What parameter can I supply to mvn to make my ant base mojo tasks log - Meaning if I was running ant I would specify -verbose or -debug Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 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]
[m2] Maven Ant mojos and logging
Hi What parameter can I supply to mvn to make my ant base mojo tasks log - Meaning if I was running ant I would specify -verbose or -debug Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with compile/install goal
Hi I just started getting the following when I try build my project: Project ID: org.apache.maven.plugins:maven-resources-plugin Reason: Error getting POM for 'org.apache.maven.plugins:maven-resources-plugin' from the repository: Failed to resolve artifact, possibly due to a repository li st that is not appropriately equipped for this artifact's metadata. org.apache.maven.plugins:maven-resources-plugin:pom:2.2-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2) Has there been any change to some of the compile/install plugins? Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating artifacts from Dependencies
Hi I am working on an ant task that takes creates a an ant classpath ref for the dependencies in a project. I have the project and dependencies, but need to create artifacts from the dependecies to get the filepath for the dependency. I could of course concatenate together this by using the available attributes from the dependency, but I feel that going trhough an artifact would be a cleaner way. I have tried to create a DefaultArtifactFactory, but I get a NPE when I call the createArtifact method. The NPE stems from : artifactHandlerManager.getArtifactHandler( type ); Looking at the code, there is no setter for the artifactHandlerManager so this will always be null. Is there another implementation/subclass of the DefaultArtifactFactory that I should use instead, or am I barking up the wrong tree here. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating artifacts from Dependencies
Hi I take it that @requiresDependencyResolution is a 1.5 annotation for a java mojo. For this perticular case, I do not have a Java mojo, only ant based. If I want to add that (requiresDependencyResolution) to my mojo.xxx.xml file, how do I do that? Hermod -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, April 03, 2006 10:30 AM To: Maven Developers List Subject: Re: Creating artifacts from Dependencies IIUC, what you want is to use a variable populated with the expression: ${project.artifacts} This will be a collection of artifacts pre-constructed from the transitive dependency closure of that project. Don't forget to add @requiresDependencyResolution to your mojo's metadata as well to guarantee this occurs before your mojo's execution. Cheers, Brett [EMAIL PROTECTED] wrote: Hi I am working on an ant task that takes creates a an ant classpath ref for the dependencies in a project. I have the project and dependencies, but need to create artifacts from the dependecies to get the filepath for the dependency. I could of course concatenate together this by using the available attributes from the dependency, but I feel that going trhough an artifact would be a cleaner way. I have tried to create a DefaultArtifactFactory, but I get a NPE when I call the createArtifact method. The NPE stems from : artifactHandlerManager.getArtifactHandler( type ); Looking at the code, there is no setter for the artifactHandlerManager so this will always be null. Is there another implementation/subclass of the DefaultArtifactFactory that I should use instead, or am I barking up the wrong tree here. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 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: Creating artifacts from Dependencies
Hi Great, I will try that. By the way without it ${project.artifacts} returns empty. Hermod -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, April 03, 2006 10:46 AM To: Maven Developers List Subject: Re: Creating artifacts from Dependencies requiresDependencyResolutiontest/requiresDependencyResolution in the mojo tag. It can be either test (which gets everything needed to run tests, which is everything), runtime (gets compile and runtime) or compile (just compilation deps). - Brett [EMAIL PROTECTED] wrote: Hi I take it that @requiresDependencyResolution is a 1.5 annotation for a java mojo. For this perticular case, I do not have a Java mojo, only ant based. If I want to add that (requiresDependencyResolution) to my mojo.xxx.xml file, how do I do that? Hermod -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, April 03, 2006 10:30 AM To: Maven Developers List Subject: Re: Creating artifacts from Dependencies IIUC, what you want is to use a variable populated with the expression: ${project.artifacts} This will be a collection of artifacts pre-constructed from the transitive dependency closure of that project. Don't forget to add @requiresDependencyResolution to your mojo's metadata as well to guarantee this occurs before your mojo's execution. Cheers, Brett [EMAIL PROTECTED] wrote: Hi I am working on an ant task that takes creates a an ant classpath ref for the dependencies in a project. I have the project and dependencies, but need to create artifacts from the dependecies to get the filepath for the dependency. I could of course concatenate together this by using the available attributes from the dependency, but I feel that going trhough an artifact would be a cleaner way. I have tried to create a DefaultArtifactFactory, but I get a NPE when I call the createArtifact method. The NPE stems from : artifactHandlerManager.getArtifactHandler( type ); Looking at the code, there is no setter for the artifactHandlerManager so this will always be null. Is there another implementation/subclass of the DefaultArtifactFactory that I should use instead, or am I barking up the wrong tree here. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating artifacts from Dependencies
Hi That worked great! Thanks a lot. Hermod -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, April 03, 2006 10:46 AM To: Maven Developers List Subject: Re: Creating artifacts from Dependencies requiresDependencyResolutiontest/requiresDependencyResolution in the mojo tag. It can be either test (which gets everything needed to run tests, which is everything), runtime (gets compile and runtime) or compile (just compilation deps). - Brett [EMAIL PROTECTED] wrote: Hi I take it that @requiresDependencyResolution is a 1.5 annotation for a java mojo. For this perticular case, I do not have a Java mojo, only ant based. If I want to add that (requiresDependencyResolution) to my mojo.xxx.xml file, how do I do that? Hermod -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED] Sent: Monday, April 03, 2006 10:30 AM To: Maven Developers List Subject: Re: Creating artifacts from Dependencies IIUC, what you want is to use a variable populated with the expression: ${project.artifacts} This will be a collection of artifacts pre-constructed from the transitive dependency closure of that project. Don't forget to add @requiresDependencyResolution to your mojo's metadata as well to guarantee this occurs before your mojo's execution. Cheers, Brett [EMAIL PROTECTED] wrote: Hi I am working on an ant task that takes creates a an ant classpath ref for the dependencies in a project. I have the project and dependencies, but need to create artifacts from the dependecies to get the filepath for the dependency. I could of course concatenate together this by using the available attributes from the dependency, but I feel that going trhough an artifact would be a cleaner way. I have tried to create a DefaultArtifactFactory, but I get a NPE when I call the createArtifact method. The NPE stems from : artifactHandlerManager.getArtifactHandler( type ); Looking at the code, there is no setter for the artifactHandlerManager so this will always be null. Is there another implementation/subclass of the DefaultArtifactFactory that I should use instead, or am I barking up the wrong tree here. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]