Re: Can we write a custom webapp plugin that uses the war plugin and its configruation?
Hi Jörg, never thought of that, thanks. Didn't have any problems so far, though. -Sven 2009/8/26 Jörg Schaible joerg.schai...@gmx.de Hi Sven, Sven Preßler wrote: You might want to take a look at the maven-inherit-plugin: http://www.ops4j.org/projects/pax/construct/maven-inherit-plugin/ Honestly, this plugin leads directly into Maven plugin dependency hell. If you like to have arbitrary side effects in multi-project builds, well, go ahead and use it - otherwise stay as far away as you can. Why? Maven will load each plugin only once. Now, if you write an extension to the maven-compiler-plugin and refer e.g. version 2.0 as dependency and in your POM you declare the maven-compiler-plugin with version 2.2, it depends on your build order which version of the compiler plugin is used. However, from your POM you'll never ever recognize that this extension will actually inject an old version of the maven-compiler-plugin and it might simply fail on unknown configuration elements or the other way round, your extension plugin can fail, because the newer version is no longer compatible (Maven plugins are never required to be binary compatible). - Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Can we write a custom webapp plugin that uses the war plugin and its configruation?
You might want to take a look at the maven-inherit-plugin: http://www.ops4j.org/projects/pax/construct/maven-inherit-plugin/ -Sven 2009/8/25 Anil-C achalamalase...@gmail.com I am trying to create a new plugin webapp with two goals clean and refresh to extend the functionality of the maven-war-plugin. webapp:clean would clean the webappDirectory and webapp:refresh would refresh the warSourceDirectory and apply modifications to the webappDirectory (similar to war:exploded but doesn't proces the source directory) skipping the web.xml (guessed it right, hotdeploy for jsp's, tags, images alone) and ofcourse use the configuration defined in maven-war-plugin as it is like any filtering, blah blah, without . The way i am hoping to achieve this is,get hold of the maven-war-plugin instance based on the project pom somehow and invoke custom methods with in that Mojo. I don't know if there is a way to do the first part? I have digged through the users forum and the tutorials/blogs available on maven plugin development. However, i couldn't find a good example that i can refer to in my situation. I am not experience plugin writer (infact this is the first onmy own, apart from the standard hello world examples). Any suggesstions that can help me getting through my first plugin is greatly appreciated. Thank you Anil -- View this message in context: http://www.nabble.com/Can-we-write-a-custom-webapp-plugin-that-uses-the-war-plugin-and-its-configruation--tp25140948p25140948.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: Can we write a custom webapp plugin that uses the war plugin and its configruation?
Thanks for the quick reply. I have tried this plugin earlier thats not what i wanted. This plugin reads the metadata information of the plugin at compile time. I need something that can read the configuration of from the pom for maven-war-plugin (if no configuration specified, take defaults), and provide them to my custom plugin. To give an example, below is the current configuration we have in our web application. pom.xml ... ... plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId configuration warSourceDirectorysrc/webapp/warSourceDirectory webappDirectory${jboss.expldoed}/webappDirectory filters filtersrc/main/filters/${filter}.properties/filter /filters webResources resource directorysrc/webapp/WEB-INF/directory filteringtrue/filtering includes includetabconfig.xml/include /includes /resource /webResources /configuration /plugin ... ... /pom When i use my custom goal webapp:refresh - i would like to refresh the webapp directory alone using the above configuration. I would really not like to redefined this configuration again for my custom plugin of the pom. Sven Preßler wrote: You might want to take a look at the maven-inherit-plugin: http://www.ops4j.org/projects/pax/construct/maven-inherit-plugin/ -Sven -- View this message in context: http://www.nabble.com/Can-we-write-a-custom-webapp-plugin-that-uses-the-war-plugin-and-its-configruation--tp25140948p25142714.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: Can we write a custom webapp plugin that uses the war plugin and its configruation?
Hi Sven, Sven Preßler wrote: You might want to take a look at the maven-inherit-plugin: http://www.ops4j.org/projects/pax/construct/maven-inherit-plugin/ Honestly, this plugin leads directly into Maven plugin dependency hell. If you like to have arbitrary side effects in multi-project builds, well, go ahead and use it - otherwise stay as far away as you can. Why? Maven will load each plugin only once. Now, if you write an extension to the maven-compiler-plugin and refer e.g. version 2.0 as dependency and in your POM you declare the maven-compiler-plugin with version 2.2, it depends on your build order which version of the compiler plugin is used. However, from your POM you'll never ever recognize that this extension will actually inject an old version of the maven-compiler-plugin and it might simply fail on unknown configuration elements or the other way round, your extension plugin can fail, because the newer version is no longer compatible (Maven plugins are never required to be binary compatible). - Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org