Creating a custom lifecycle
Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csaba csaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
take a look at the maven deploy plugin configuration[1] and set skiptrue/skip hope this helps Simo [1] http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Dec 1, 2010 at 12:18 PM, Gajo Csaba csaba.g...@cosylab.com wrote: I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
I didn't try it yet, but I'll try it now. I think this will not solve the problem. If you write mvn deploy, you will probably have the compile, test etc. phases executed. What I need is, to not run any of these phases, but immediately print out this is not supported and end the execution. The only way to do is, as far as I know, is to create my own lifecycle. Csaba On 1.12.2010 12:31, Simone Tripodi wrote: take a look at the maven deploy plugin configuration[1] and set skiptrue/skip hope this helps Simo [1] http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Dec 1, 2010 at 12:18 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
2010/12/1 Gajo Csaba csaba.g...@cosylab.com: I didn't try it yet, but I'll try it now. I think this will not solve the problem. If you write mvn deploy, you will probably have the compile, test etc. phases executed. What I need is, to not run any of these phases, but immediately print out this is not supported and end the execution. The only way to do is, as far as I know, is to create my own lifecycle. Sorry but I don't understand. What kind of project does not need to compile, test, etc.? What should mvn apple do? Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
Not sure what you aiming for, but you could introduce new packaging, and that new packaging might introduce completely new lifecycle also. If you build some custom packaging, this would be the best, since it gives you freedom to do all what you need in your custom build, but also freedom to map whatever you want in there. Thanks, ~t~ On Wed, Dec 1, 2010 at 12:34 PM, Gajo Csaba csaba.g...@cosylab.com wrote: I didn't try it yet, but I'll try it now. I think this will not solve the problem. If you write mvn deploy, you will probably have the compile, test etc. phases executed. What I need is, to not run any of these phases, but immediately print out this is not supported and end the execution. The only way to do is, as far as I know, is to create my own lifecycle. Csaba On 1.12.2010 12:31, Simone Tripodi wrote: take a look at the maven deploy plugin configuration[1] and set skiptrue/skip hope this helps Simo [1] http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Dec 1, 2010 at 12:18 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a custom lifecycle
Yes, I've created a new packaging. In my test project pom.xml, I now have: packagingapple/packaging build plugins plugin groupIdcom.test.phases/groupId artifactIdAppleLifecycle/artifactId extensionstrue/extensions /plugin /plugins /build The AppleLifecycle project defines the apple lifecycle. However, contrary to how custom lifecycles are usually defined, my components.xml looks like this: plexus components component roleorg.apache.maven.lifecycle.mapping.LifecycleMapping/role role-hintapple/role-hint implementationcom.test.phases.HelloLifecycle/implementation /component /components /plexus The HelloLifecycle is my custom lifecycle, which supports only the compile phase. So if you write mvn package, it will skip all the phases, and execute only compile. The lifecycle.xml looks like this: lifecycles lifecycle idapple/id /lifecycle /lifecycles This works, the test project uses my custom lifecycle for building itself. However, the compile, test, package etc. goals are still there. I want to redefine them. The problem is, that if I write mvn deploy, it will execute also mvn compile (because compile test package install deploy). What I want is, when I write mvn deploy, that it doesn't execute compile. Instead, it should just print out a message. How to do this? I know that this is possible. For example, the site command is outside the scope of the default lifecycle. If you write mvn deploy, then the site phase will not get executed. Also, if you write site, it will not invoke deploy. What I want is, when I write deploy, that it doesn't invoke the test, compile, package etc. phases, but instead print out a message. Csaba On 1.12.2010 12:48, Tamás Cservenák wrote: Not sure what you aiming for, but you could introduce new packaging, and that new packaging might introduce completely new lifecycle also. If you build some custom packaging, this would be the best, since it gives you freedom to do all what you need in your custom build, but also freedom to map whatever you want in there. Thanks, ~t~ On Wed, Dec 1, 2010 at 12:34 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I didn't try it yet, but I'll try it now. I think this will not solve the problem. If you write mvn deploy, you will probably have the compile, test etc. phases executed. What I need is, to not run any of these phases, but immediately print out this is not supported and end the execution. The only way to do is, as far as I know, is to create my own lifecycle. Csaba On 1.12.2010 12:31, Simone Tripodi wrote: take a look at the maven deploy plugin configuration[1] and set skiptrue/skip hope this helps Simo [1] http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Dec 1, 2010 at 12:18 PM, Gajo Csabacsaba.g...@cosylab.com wrote: I want to delete the deploy goal. Make it exist as much as mvn apple does On 1.12.2010 12:14, Antonio Petrelli wrote: It's best to tell us what you want to accomplish. Fighting Maven is always a bad thing. Antonio 2010/12/1 Gajo Csabacsaba.g...@cosylab.com: Hello, I'm trying to create a custom lifecycle. In this case, I don't mean providing custom classes for one of the defined phases, but redefining the phases themselves. For example, the DefaultLifecycleMapping seems to support clean, compile, test etc... How can I, for example, make it so that the phases are deploy, clean, compile, install, test? Which component should I override to be able to do this? I see that there are 3 cases where this is done: clean, site and default. I've created by own class which implements LifecycleMapping. I wrote a components.xml and lifecycle.xml for it. When I observe the getPhases(String lifecycle) method, I see that the value of lifecycle is always default. I'm guessing that I need to define something so that this wouldn't be default, but my own lifecycle, for example apple. How to do this? Thanks, Csaba - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
Am Freitag, 9. Juli 2010 00:38:37 schrieb asookazian: Thanks! Now I just need to write a simple Mojo/plugin that will copy the exploded EAR directory to the server/default/deploy directory in JBoss. cool. Or you use the maven-antrun-plugin and save yourself some work :) hth, - martin signature.asc Description: This is a digitally signed message part.
Re: Creating a Custom Lifecycle
Am Freitag, 9. Juli 2010 08:04:20 schrieb Martin Höller: Am Freitag, 9. Juli 2010 00:38:37 schrieb asookazian: Thanks! Now I just need to write a simple Mojo/plugin that will copy the exploded EAR directory to the server/default/deploy directory in JBoss. cool. Or you use the maven-antrun-plugin and save yourself some work :) The cargo plugin is usually used for depolying artifacts to containers and it seems, it can also deploy exploded wars (I haven't use this feature). See http://old.nabble.com/-mvnreloadable-webapps-to7702892.html#a7715823 or use google for some details. hth, - martin signature.asc Description: This is a digitally signed message part.
Re: Creating a Custom Lifecycle
Martin Höller wrote: Am Freitag, 9. Juli 2010 00:38:37 schrieb asookazian: Thanks! Now I just need to write a simple Mojo/plugin that will copy the exploded EAR directory to the server/default/deploy directory in JBoss. cool. Or you use the maven-antrun-plugin and save yourself some work :) hth, - martin I modified the HardDeployMojo in the jboss-maven-plugin so that it copies the exploded EAR directory and not the packaged EAR file. But the copied exploded EAR does not deploy cleanly in JBoss AS 4.2.2.GA (nor does the packaged EAR). There are several NPEs in the server.log and I'm not sure why... -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1045577.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
I'm going to stick with my Ant build.xml explode target that hooks into maven via macrodef. I was trying to avoid using Ant with Maven but it's taking too long to get the exploded WAR+EAR working with Maven and JBoss... target name=unzip echo message=**Beginning unzip target.../ echo message=Base directory is ${basedir} / mkdir dir=${basedir}\target\${ear.app.name}\temp/ unzip src=${basedir}\target\${ear.app.name}\${war.app.name}.war dest=${basedir}\target\${ear.app.name}\temp/ delete file=${basedir}\target\${ear.app.name}\${war.app.name}.war/ mkdir dir=${basedir}\target\${ear.app.name}\${war.app.name}.war/ copy todir=${basedir}\target\${ear.app.name}\${war.app.name}.war fileset dir=${basedir}\target\${ear.app.name}\temp / /copy delete dir=${basedir}\target\${ear.app.name}\temp/ /target target name=install echo message=**Beginning install target.../ maven target=install basedir=${basedir} arg line=-f ${pom.file} -npu -Dmaven.test.skip=true / /maven /target target name=clean echo message=**Beginning clean target.../ echo message=Deleting ${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\temp directory/ delete dir=${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\temp/ maven target=clean basedir=${basedir} arg line=-f ${pom.file} / /maven /target !-- target name=explode depends=showproperties, clean, install, unzip description=Runs mvn clean install and then unzips the EAR/WAR and copies to JBoss deploy directory -- target name=explode depends=showproperties, clean, install, unzip echo message=**Beginning explode target.../ mkdir dir=${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear / copy todir=${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear fileset dir=${artifact.dir} / /copy tstamp format property=now pattern=MM/dd/ hh:mm:ss locale=en,US/ /tstamp echo message=Current datetime: ${now}/ echo message=The app can be accessed at ${final.url} / /target -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1045597.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
Am Mittwoch, 7. Juli 2010 18:46:34 schrieb asookazian: There is some limited coverage of creating a custom lifecycle here: http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-cu stom-lifecycle.html but it also covers forking and parallel lifecycles, I'm not sure I'm really interested in that. I want to change the package lifecycle so that it uses war:explode goal rather than war:war goal. What about just configuring the war:explode goal in your pom.xml? war:war would still be executed, but is this a problem? hth, - martin signature.asc Description: This is a digitally signed message part.
Re: Creating a Custom Lifecycle
Martin Höller wrote: Am Mittwoch, 7. Juli 2010 18:46:34 schrieb asookazian: There is some limited coverage of creating a custom lifecycle here: http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-cu stom-lifecycle.html but it also covers forking and parallel lifecycles, I'm not sure I'm really interested in that. I want to change the package lifecycle so that it uses war:explode goal rather than war:war goal. What about just configuring the war:explode goal in your pom.xml? war:war would still be executed, but is this a problem? hth, - martin I just realized something very basic after reading first chapter of Maven 2: Effective Implementation. The web application archive is produced in the target directory, which is Maven's default working directory. There you will find both the target/simple-webapp subdirectory that contains the exploded, or unpacked, web application contents ready to be packaged, and the target/simple-webapp.war file that contains those files after the packaging process. So perhaps if the unpack goal of the jboss-maven-plugin was modified to use the already exploded WAR in the exploded EAR, then we would be good. At least as far as JBoss users are concerned... public void unpack( File zipFile, File targetDir ) throws IOException { FileInputStream in = new FileInputStream( zipFile ); ZipInputStream zipIn = new ZipInputStream( in ); File dir = targetDir.getCanonicalFile(); dir.mkdirs(); ZipEntry entry; while ( ( entry = zipIn.getNextEntry() ) != null ) { if ( entry.isDirectory() ) { continue; } String file = targetDir + / + entry.getName(); new File( file ).getParentFile().getCanonicalFile().mkdirs(); FileOutputStream out = new FileOutputStream( file ); streamcopy( zipIn, out ); out.close(); } zipIn.close(); } http://svn.codehaus.org/mojo/tags/jboss-maven-plugin-1.4.1/src/main/java/org/codehaus/mojo/jboss/HardDeployMojo.java -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1045103.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
On 7/8/10 11:28 AM, asookazian wrote: I just realized something very basic after reading first chapter of Maven 2: Effective Implementation. The web application archive is produced in the target directory, which is Maven's default working directory. There you will find both the target/simple-webapp subdirectory that contains the exploded, or unpacked, web application contents ready to be packaged, and the target/simple-webapp.war file that contains those files after the packaging process. So perhaps if the unpack goal of the jboss-maven-plugin was modified to use the already exploded WAR in the exploded EAR, then we would be good. At least as far as JBoss users are concerned... No. The way that dependencies go from project to project is via artifacts installed/deployed into the local repository. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
have you had a look at the unpackTypes configuration option of m-ear-p? On 8 July 2010 16:28, asookazian asookaz...@gmail.com wrote: Martin Höller wrote: Am Mittwoch, 7. Juli 2010 18:46:34 schrieb asookazian: There is some limited coverage of creating a custom lifecycle here: http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-cu stom-lifecycle.html but it also covers forking and parallel lifecycles, I'm not sure I'm really interested in that. I want to change the package lifecycle so that it uses war:explode goal rather than war:war goal. What about just configuring the war:explode goal in your pom.xml? war:war would still be executed, but is this a problem? hth, - martin I just realized something very basic after reading first chapter of Maven 2: Effective Implementation. The web application archive is produced in the target directory, which is Maven's default working directory. There you will find both the target/simple-webapp subdirectory that contains the exploded, or unpacked, web application contents ready to be packaged, and the target/simple-webapp.war file that contains those files after the packaging process. So perhaps if the unpack goal of the jboss-maven-plugin was modified to use the already exploded WAR in the exploded EAR, then we would be good. At least as far as JBoss users are concerned... public void unpack( File zipFile, File targetDir ) throws IOException { FileInputStream in = new FileInputStream( zipFile ); ZipInputStream zipIn = new ZipInputStream( in ); File dir = targetDir.getCanonicalFile(); dir.mkdirs(); ZipEntry entry; while ( ( entry = zipIn.getNextEntry() ) != null ) { if ( entry.isDirectory() ) { continue; } String file = targetDir + / + entry.getName(); new File( file ).getParentFile().getCanonicalFile().mkdirs(); FileOutputStream out = new FileOutputStream( file ); streamcopy( zipIn, out ); out.close(); } zipIn.close(); } http://svn.codehaus.org/mojo/tags/jboss-maven-plugin-1.4.1/src/main/java/org/codehaus/mojo/jboss/HardDeployMojo.java -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1045103.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
stephenconnolly wrote: have you had a look at the unpackTypes configuration option of m-ear-p? That was exactly what I needed and it worked (I just did this in my profile): build pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId version2.3.1/version configuration unpackTypeswar/unpackTypes /configuration /plugin /plugins /pluginManagement /build Thanks! Now I just need to write a simple Mojo/plugin that will copy the exploded EAR directory to the server/default/deploy directory in JBoss. cool. -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1045261.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
] [compiler:testCompile] [INFO] No sources to compile [INFO] [surefire:test] [INFO] No tests to run. [INFO] [war:war] [INFO] Packaging webapp [INFO] Assembling webapp[testapp] in [C:\Documents and Settings\asookazian\My Do cuments\ubuntu_projects.tar\projects\testapp\target\testapp] [INFO] Processing war project [INFO] Copying webapp resources[C:\Documents and Settings\asookazian\My Document s\ubuntu_projects.tar\projects\testapp\src\main\webapp] [INFO] Webapp assembled in [47 msecs] [INFO] Building war: C:\Documents and Settings\asookazian\My Documents\ubuntu_pr ojects.tar\projects\testapp\target\testapp.war [INFO] [zip:touch {execution: ZipForkMojo}] [INFO] doing nothing here [INFO] [install:install] [INFO] Installing C:\Documents and Settings\asookazian\My Documents\ubuntu_proje cts.tar\projects\testapp\target\testapp.war to C:\Documents and Settings\asookaz ian\.m2\repo2\com\intuit\testapp\1.0-SNAPSHOT\testapp-1.0-SNAPSHOT.war [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Wed Jul 07 11:06:57 PDT 2010 [INFO] Final Memory: 9M/17M [INFO] So the war:war goal is still being exec'd but at least my plugin's execute method is invoked as well. Any ideas how to fix this so the override actually works? thx. -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1044808.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
org.apache.maven.plugins:maven-validate-plugin:validate /validate b/c that plugin does not exist. How do you know which plugin a lifecycle phase is associated with? mvn help:describe? -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1044816.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a Custom Lifecycle
Getting closer. Now using war:exploded (see below). So in order to wrap this up (for an exploded EAR), there are a few steps required. The mojo for the maven-ear-plugin (which doesn't have an exploded goal!) needs to be modified to add the exploded goal. Then the exploded WAR needs to be copied into the appropriate directory in the exploded EAR. Finally, for a 'mvn install', the EAR would need to be packaged to be installed into the local Maven repo. 2nd thought: the exploded EAR is already available prior to the packaging of the EAR during 'mvn install'. So adding the exploded goal to the maven-ear-plugin is not required. Even better. Now the problem is to actually provide all the appropriate phases in the components.xml below... components.xml component-set components component roleorg.apache.maven.lifecycle.mapping.LifecycleMapping/role role-hintexploded/role-hint implementation org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping /implementation configuration phases process-resources org.apache.maven.plugins:maven-resources-plugin:resources /process-resources compile org.apache.maven.plugins:maven-compiler-plugin:compile /compile !--packageorg.apache.maven.plugins:maven-zip-plugin:exploded/package-- packageorg.apache.maven.plugins:maven-war-plugin:exploded/package /phases /configuration /component /components /component-set -- View this message in context: http://maven.40175.n5.nabble.com/Creating-a-Custom-Lifecycle-tp1044781p1044822.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org