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 > 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?
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?
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. ... ... org.apache.maven.plugins maven-war-plugin src/webapp ${jboss.expldoed} src/main/filters/${filter}.properties src/webapp/WEB-INF true tabconfig.xml ... ... 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?
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 > > 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 > >
Can we write a custom webapp plugin that uses the war plugin and its configruation?
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: webapp plugin
On 7/18/07, John Coleman <[EMAIL PROTECTED]> wrote: "The war packaging type looks to src/main/webapp for the web application files such as JSPs, but still looks for non-code files in the standard src/main/resources directory. Where you place files such as *.properties files is of personal choice, however, if you think you may filter the resources it is suggested that you place them in resources, not webapp." Maven Unser Guide ...I thought maybe I can adapt the existing plugin as part of my process to do the copy to target. Now I will write complete and self contained and just add it to the phase as suggested. I have absolutely idea, what the Maven User Guide says or doesn't. The authoritative source is the maven war plugins documentation, which clearly indicates, that you may configure additional resource directories. In other words, the process is follows: - Configure your plugin to run in the "generate-resources" phase and let it create a directory below target. - Configure the maven-war-plugin (which runs in the "package" phase, which is definitely later) to pick up your generated directories contents and include it into the webapp. I'll refrain from further comments. Jochen -- "Besides, manipulating elections is under penalty of law, resulting in a preventative effect against manipulating elections. The german government justifying the use of electronic voting machines and obviously believing that we don't need a police, because all illegal actions are forbidden. http://dip.bundestag.de/btd/16/051/1605194.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: webapp plugin
When I read this... "The war packaging type looks to src/main/webapp for the web application files such as JSPs, but still looks for non-code files in the standard src/main/resources directory. Where you place files such as *.properties files is of personal choice, however, if you think you may filter the resources it is suggested that you place them in resources, not webapp." Maven Unser Guide ...I thought maybe I can adapt the existing plugin as part of my process to do the copy to target. Now I will write complete and self contained and just add it to the phase as suggested. John -Original Message- From: Jochen Wiedmann [mailto:[EMAIL PROTECTED] Sent: 18 July 2007 09:20 To: Maven Users List Subject: Re: webapp plugin On 7/18/07, John Coleman <[EMAIL PROTECTED]> wrote: > I started looking at the resources phase, but the existing one just > seems to put resources into the classes directory, and is evidently > aimed at properties files and such. Obviously you did look at the resources *plugin* as opposed to the resources *phase*, where you can execute your own plugin. -- "Besides, manipulating elections is under penalty of law, resulting in a preventative effect against manipulating elections. The german government justifying the use of electronic voting machines and obviously believing that we don't need a police, because all illegal actions are forbidden. http://dip.bundestag.de/btd/16/051/1605194.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you receive this transmission in error, please notify us immediately, and then delete this E-mail. Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments. Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp plugin
On 7/18/07, John Coleman <[EMAIL PROTECTED]> wrote: I started looking at the resources phase, but the existing one just seems to put resources into the classes directory, and is evidently aimed at properties files and such. Obviously you did look at the resources *plugin* as opposed to the resources *phase*, where you can execute your own plugin. -- "Besides, manipulating elections is under penalty of law, resulting in a preventative effect against manipulating elections. The german government justifying the use of electronic voting machines and obviously believing that we don't need a police, because all illegal actions are forbidden. http://dip.bundestag.de/btd/16/051/1605194.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: webapp plugin
Hi, thanks for your replies Jochen. The filtering we do on the js and jsp scans a template version of the files for xml like tags in order to include/drop code sections depending on the role desired (not ideal I think but that's how it is). So far as I understand Maven filtering it is more like a substitution mechanism. We already have our "filter" packaged as a plugin, I don't want a rewrite. I started looking at the resources phase, but the existing one just seems to put resources into the classes directory, and is evidently aimed at properties files and such. Thanks a lot for your tip, I hope I can figure out how to use it, it looks just like what I need. Regards, John -Original Message- From: Jochen Wiedmann [mailto:[EMAIL PROTECTED] Sent: 17 July 2007 12:16 To: Maven Users List Subject: Re: webapp plugin On 7/17/07, John Coleman <[EMAIL PROTECTED]> wrote: > I have developed a plugin that filters js and jsp files to customize > them prior to packaging. The filtering possibilities provided by the maven-war-plugin aren't sufficient? IMO, filtering should be an abstract mechanism, as implemented in Ant, with customizable filters. That would most possibly have saved you 50% of the job or more. > I was going to bind the plugin to the package phase but it would make No, that doesn't make sense. Use the generate-resources phase, write the filtered result to a directory below target and add that directory as a resource to the maven-war-plugin's configuration. > The plugin also expects 2 parameters, these being the source directory > and the target directory. Use meaningful defaults like expression="${myplugin.srcdir" default="src/main/myplugin" expression="${myplugin.destdir" default="${project.build.directory}/myplugin" Jochen -- "Besides, manipulating elections is under penalty of law, resulting in a preventative effect against manipulating elections. The german government justifying the use of electronic voting machines and obviously believing that we don't need a police, because all illegal actions are forbidden. http://dip.bundestag.de/btd/16/051/1605194.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you receive this transmission in error, please notify us immediately, and then delete this E-mail. Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments. Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: webapp plugin/mavenide
Yes Milos, Mavenide2.3 with embedded Maven, no idea what version. I see Maven2.1 is not available yet anyway. But would just be nice to have prepare-package available for me now. The problem is the package goal also does the copy over of webapp resources I want to tweak, so I can't see a way to fit in my plugin. It seems I must hack the package plugin for this? Thanks, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 17 July 2007 14:14 To: Maven Users List Subject: Re: webapp plugin/mavenide John Coleman wrote: > I got my plugin working and want to bind it to prepare-package, but > that's in Maven2.1. Is there way to do this task in Maven2? > > TIA > are you using maven support in netbeans? that one by default builds with a custom 2.0.4-like maven2 embedder. allowing to build with any external version of maven2 is TBD. Upgrading to a more uptodate version of maven2 embedder is TBD as well. The current trunk is not as stable as the version currently used. Milos > John > > > Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. > > Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you receive this transmission in error, please notify us immediately, and then delete this E-mail. > > Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments. > > Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK. > > > - > 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: webapp plugin/mavenide
John Coleman wrote: I got my plugin working and want to bind it to prepare-package, but that's in Maven2.1. Is there way to do this task in Maven2? TIA are you using maven support in netbeans? that one by default builds with a custom 2.0.4-like maven2 embedder. allowing to build with any external version of maven2 is TBD. Upgrading to a more uptodate version of maven2 embedder is TBD as well. The current trunk is not as stable as the version currently used. Milos John Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you receive this transmission in error, please notify us immediately, and then delete this E-mail. Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments. Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK. - 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]
webapp plugin/mavenide
I got my plugin working and want to bind it to prepare-package, but that's in Maven2.1. Is there way to do this task in Maven2? TIA John Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you receive this transmission in error, please notify us immediately, and then delete this E-mail. Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments. Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp plugin
On 7/17/07, John Coleman <[EMAIL PROTECTED]> wrote: I have developed a plugin that filters js and jsp files to customize them prior to packaging. The filtering possibilities provided by the maven-war-plugin aren't sufficient? IMO, filtering should be an abstract mechanism, as implemented in Ant, with customizable filters. That would most possibly have saved you 50% of the job or more. I was going to bind the plugin to the package phase but it would make No, that doesn't make sense. Use the generate-resources phase, write the filtered result to a directory below target and add that directory as a resource to the maven-war-plugin's configuration. The plugin also expects 2 parameters, these being the source directory and the target directory. Use meaningful defaults like expression="${myplugin.srcdir" default="src/main/myplugin" expression="${myplugin.destdir" default="${project.build.directory}/myplugin" Jochen -- "Besides, manipulating elections is under penalty of law, resulting in a preventative effect against manipulating elections. The german government justifying the use of electronic voting machines and obviously believing that we don't need a police, because all illegal actions are forbidden. http://dip.bundestag.de/btd/16/051/1605194.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
webapp plugin
Hi, I have developed a plugin that filters js and jsp files to customize them prior to packaging. I was going to bind the plugin to the package phase but it would make more sense to apply the filtering during the copy of the webapp directory to the target. If I apply during the package phase then the plugin will replace the unfiltered files copied in during the earlier copy phase. This seems a bit wasteful. The plugin also expects 2 parameters, these being the source directory and the target directory. Which phase should I bind to, and are there any properties that I can use to default the source and target. I tried ${maven.war.src} and ${maven.war.webapp.dir}, but they are null so perhaps they are Maven1 only? TIA John Coleman, MSTA Senior Developer Consultant Eurobase Banking Solutions Bury House, 31 Bury Street, London EC3A 5AG, U.K. Office: +44 (0)1245 496 706, Fax: +44 (0)20 7626 6203 Mobile: +44 (0)7734 506586 Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you receive this transmission in error, please notify us immediately, and then delete this E-mail. Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments. Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK.