Re: m2 multiple war files with some common code
Pete, I tried both the war overlaying as well as the suggestion by Martin to pull shared resources from a directory. As noted, the directive doesn't work in version 2.0.1. I pulled down the latest code and built a local version. I did notice a potential bug. The code in the latest HEAD branch handles copying of the resources but when you turn the on, it fails to copy resources with a ClassCastException. FYI, my project layout is as follows: parent_project/src/WEB-INF (shared resources) parent_project/module1/... parent_project/modeul2/... The configuration for maven-war-plugin in parent's pom.xml: ${project.basedir}/../src/WEB-INF WEB-INF false There is no further configuration of maven-war-plugin in any of child poms. Note: the filters are provided as properties in profiles.xml at the parent project level. -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939224.html#a5424066 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: m2 multiple war files with some common code
I've posted the answer to this a few time on this user list A -Original Message- From: Srinivas Pavani [mailto:[EMAIL PROTECTED] Sent: 13 July 2006 19:51 To: users@maven.apache.org Subject: m2 multiple war files with some common code Can someone shed some light on how to setup maven2 to allow sharing some common code across multiple war files? Given below is an example of how I would like to setup multiple modules but I am not sure how the war generation can occur when webapp contents from common-module are needed for war-module1, war-module2 and war-module3. /parent-project /parent-project/common-module /parent-project/common-module/src/main/java /parent-project/common-module/src/main/resources /parent-project/common-module/src/main/webapp /parent-project/war-module1 /parent-project/war-module1/src/main/java /parent-project/war-module1/src/main/resources /parent-project/war-module1/src/main/webapp /parent-project/war-module2 ... /parent-project/war-module3 ... -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939 224.html#a5314384 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: m2 multiple war files with some common code
Thanks for your input, the ability to unpack may help in my case. -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939224.html#a5321068 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: m2 multiple war files with some common code
the war plugin is also capable of war overlaying. if you declare another war as a dependency it will automatically unpack the war to your current project. =) i'm not sure if this will fit in your current development build structure but try to check it anyway. http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html pete marvin Martin Gladdish wrote: > I had the same problem the other day; trying to share JSPs and config > files > across multiple maven2 apps. > > I solved it by configuring the war plugin to pull in the resources > from the > shared folder, following instructions here: > http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html > > > A word of warning though: the functionality hasn't even been > checked in to the head of the war plugin as yet - I had to apply a patch > that was attached to the jira entry and use my own local patched build of > the war plugin. See http://jira.codehaus.org/browse/MWAR-54 for further > details. > > Hope this helps > > On 13/07/06, Bravo, Kris <[EMAIL PROTECTED]> wrote: >> >> Two options then. >> >> The less desirable is to build the common war, then unpack it into the >> target directory of each webapps before packaging them up. You'll have >> to watch this because the web.xml and other files are liable to get >> trampled. See http://mojo.codehaus.org/dependency-maven-plugin/ and the >> unpack'ing goals. >> >> The other is to create an ear project for each common/webapp pair and >> share the session across both webapps within the ear. I'm gathering from >> a quick google that this is a challenge - you are up for a challenge are >> you? ;) >> >> kris bravo >> >> >> -Original Message- >> From: Srinivas Pavani [mailto:[EMAIL PROTECTED] >> Sent: Thursday, July 13, 2006 3:57 PM >> To: users@maven.apache.org >> Subject: RE: m2 multiple war files with some common code >> >> >> Kris, >> >> Thanks for your reply. >> >> Most likely they will not be placed in the same ear file. Yes there are >> common servlets and jsps that need to be shared across the apps. >> >> The question still remains how to integrate the servlets from common and >> module specific directories into a single WAR file. I don't think just >> listing it as a dependency would solve the problem, would it? >> -- >> View this message in context: >> http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939 >> 224.html#a5315554 >> Sent from the Maven - Users forum at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: m2 multiple war files with some common code
I had the same problem the other day; trying to share JSPs and config files across multiple maven2 apps. I solved it by configuring the war plugin to pull in the resources from the shared folder, following instructions here: http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html A word of warning though: the functionality hasn't even been checked in to the head of the war plugin as yet - I had to apply a patch that was attached to the jira entry and use my own local patched build of the war plugin. See http://jira.codehaus.org/browse/MWAR-54 for further details. Hope this helps On 13/07/06, Bravo, Kris <[EMAIL PROTECTED]> wrote: Two options then. The less desirable is to build the common war, then unpack it into the target directory of each webapps before packaging them up. You'll have to watch this because the web.xml and other files are liable to get trampled. See http://mojo.codehaus.org/dependency-maven-plugin/ and the unpack'ing goals. The other is to create an ear project for each common/webapp pair and share the session across both webapps within the ear. I'm gathering from a quick google that this is a challenge - you are up for a challenge are you? ;) kris bravo -Original Message- From: Srinivas Pavani [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 3:57 PM To: users@maven.apache.org Subject: RE: m2 multiple war files with some common code Kris, Thanks for your reply. Most likely they will not be placed in the same ear file. Yes there are common servlets and jsps that need to be shared across the apps. The question still remains how to integrate the servlets from common and module specific directories into a single WAR file. I don't think just listing it as a dependency would solve the problem, would it? -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939 224.html#a5315554 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: m2 multiple war files with some common code
Two options then. The less desirable is to build the common war, then unpack it into the target directory of each webapps before packaging them up. You'll have to watch this because the web.xml and other files are liable to get trampled. See http://mojo.codehaus.org/dependency-maven-plugin/ and the unpack'ing goals. The other is to create an ear project for each common/webapp pair and share the session across both webapps within the ear. I'm gathering from a quick google that this is a challenge - you are up for a challenge are you? ;) kris bravo -Original Message- From: Srinivas Pavani [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 3:57 PM To: users@maven.apache.org Subject: RE: m2 multiple war files with some common code Kris, Thanks for your reply. Most likely they will not be placed in the same ear file. Yes there are common servlets and jsps that need to be shared across the apps. The question still remains how to integrate the servlets from common and module specific directories into a single WAR file. I don't think just listing it as a dependency would solve the problem, would it? -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939 224.html#a5315554 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: m2 multiple war files with some common code
Kris, Thanks for your reply. Most likely they will not be placed in the same ear file. Yes there are common servlets and jsps that need to be shared across the apps. The question still remains how to integrate the servlets from common and module specific directories into a single WAR file. I don't think just listing it as a dependency would solve the problem, would it? -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939224.html#a5315554 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: m2 multiple war files with some common code
If you're placing them all in the same ear, mark the dependencies as provided and make sure the common-module is defined in your ear project. If not, each war project would list the common module as a dependency. You have a common-module/src/main/webapp folder as well - do you intend to share servlets and jsp pages across them too? kris bravo -Original Message- From: Srinivas Pavani [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 2:51 PM To: users@maven.apache.org Subject: m2 multiple war files with some common code Can someone shed some light on how to setup maven2 to allow sharing some common code across multiple war files? Given below is an example of how I would like to setup multiple modules but I am not sure how the war generation can occur when webapp contents from common-module are needed for war-module1, war-module2 and war-module3. /parent-project /parent-project/common-module /parent-project/common-module/src/main/java /parent-project/common-module/src/main/resources /parent-project/common-module/src/main/webapp /parent-project/war-module1 /parent-project/war-module1/src/main/java /parent-project/war-module1/src/main/resources /parent-project/war-module1/src/main/webapp /parent-project/war-module2 ... /parent-project/war-module3 ... -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939 224.html#a5314384 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
m2 multiple war files with some common code
Can someone shed some light on how to setup maven2 to allow sharing some common code across multiple war files? Given below is an example of how I would like to setup multiple modules but I am not sure how the war generation can occur when webapp contents from common-module are needed for war-module1, war-module2 and war-module3. /parent-project /parent-project/common-module /parent-project/common-module/src/main/java /parent-project/common-module/src/main/resources /parent-project/common-module/src/main/webapp /parent-project/war-module1 /parent-project/war-module1/src/main/java /parent-project/war-module1/src/main/resources /parent-project/war-module1/src/main/webapp /parent-project/war-module2 ... /parent-project/war-module3 ... -- View this message in context: http://www.nabble.com/m2-multiple-war-files-with-some-common-code-tf1939224.html#a5314384 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]