Re: Multiple module maven project questions
Hi! On 15 Mar 2009, Thai Dang Vu wrote: [...] I have some questions here: 1. How to tell the maven-ear-plugin to use my application.xml? And where in the ear directory should I place my own application.xml? The m-ear-p is able to autogenerate an application.xml for you. Maybe you should try to use this feature. See [1] for details. If auto-generation doesn't fit your needs, I'd put my application.xml in src/main/resources/META-INF/application.xml of my ear module. IMHO, this should work. 2. Because of the dependency on the ejb, I have to run mvn install in the ejb directory before I can run mvn compiler:compile in the war directory. Your dependencies are incorrect! You missed they typeejb/type in your war dependency declaration. 3. In my application.xml, beside the ejb and war modules, I need to add one more module like this: moduleejbjboss-seam-2.1.1.GA.jar/ejb/module The jboss seam jar file can be found with a dependency. What should I do to tell maven to include that file into the root of the ear file it creates when I run mvn ear:ear in the ear directory? Not 100% sure what you want to achieve. Did you try specifying the seam artifact as a normal dependency (with scope runtime) of your EAR? hth, - martin [1] http://maven.apache.org/plugins/maven-ear-plugin/ signature.asc Description: PGP signature
Re: Multiple module maven project questions
See responses inline. On Sun, Mar 15, 2009 at 12:24 PM, Thai Dang Vu dx...@yahoo.com wrote: This is the directory structure of my project [...] I have some questions here: 1. How to tell the maven-ear-plugin to use my application.xml? And where in the ear directory should I place my own application.xml? The default directory for ear sources is src/main/application. If you put your application.xml file in src/main/application/META-INF/application.xml, Maven will pick it up automatically. Most users let maven generates it for you. The ear plugin does that by default. 2. Because of the dependency on the ejb, I have to run mvn install in the ejb directory before I can run mvn compiler:compile in the war directory. Is there any way (like target dependencies in ant) to tell maven to compile / install all modules needed before the mvn compiler:compile is executed? Well, you invoke mvn package at the root level and it will do that for you. 3. In my application.xml, beside the ejb and war modules, I need to add one more module like this: moduleejbjboss-seam-2.1.1.GA.jar/ejb/module The jboss seam jar file can be found with a dependency. What should I do to tell maven to include that file into the root of the ear file it creates when I run mvn ear:ear in the ear directory? Make it a dependency :) If you need something, it needs to be a dependency. You miss the typeejb/type in the jboss-seam dep. 4. If I don't want to create the seam-glassfish-ear-1.0-SNAPSHOT.ear file, but a seam-glassfish-ear-1.0-SNAPSHOT_ear directory in which the ejb module is unpacked in the seam-glassfish-ejb-1.0-SNAPSHOT_jar directory, the war module is unpacked in the seam-glassfish-war-1.0-SNAPSHOT_war directory and the jboss seam library above is unpacked in the jboss-seam-2.1.1.GA_jar directory, what should I do? Read the doc a bit more. To explode the modules, there's an option for that http://maven.apache.org/plugins/maven-ear-plugin/examples/unpacking-a-module.html For the EAR itself there's a feature request ( http://jira.codehaus.org/browse/MEAR-51) but you can have a direct solution with the dependency plugin (unpack goal) I read the http://maven.apache.org/plugins/maven-ear-plugin/ but found no shine to my questions (maybe there are, but not apparent to a maven newbie like me). Question 1,2,3 are not maven ear plugin's question but Maven questions. You better have to read more tutorial on Maven itself first HTH, S. Thank you. -- Large Systems Suck: This rule is 100% transitive. If you build one, you suck -- S.Yegge
Multiple module maven project questions
This is the directory structure of my project seam-glassfish |-- ear ||-- pom.xml |-- ejb ||-- src ||-- pom.xml |-- war ||-- src ||-- pom.xml |-- pom.xml This is the parent pom.xml: modelVersion4.0.0/modelVersion groupIdhome/groupId artifactIdseam-glassfish/artifactId version1.0-SNAPSHOT/version packagingpom/packaging nameseam-glassfish/name modules moduleejb/module modulewar/module moduleear/module /modules !-- nothing special about other parts -- This is my ejb/pom.xml: modelVersion4.0.0/modelVersion artifactIdseam-glassfish-ejb/artifactId packagingejb/packaging nameseam-glassfish-ejb/name parent groupIdhome/groupId artifactIdseam-glassfish/artifactId version1.0-SNAPSHOT/version /parent !-- nothing special about other parts -- This is my war/pom.xml: modelVersion4.0.0/modelVersion artifactIdseam-glassfish-war/artifactId packagingwar/packaging nameseam-glassfish-war/name parent groupIdhome/groupId artifactIdseam-glassfish/artifactId version1.0-SNAPSHOT/version /parent dependencies dependency groupIdhome/groupId artifactIdseam-glassfish-ejb/artifactId version1.0-SNAPSHOT/version /dependency This is my ear/pom.xml: modelVersion4.0.0/modelVersion artifactIdseam-glassfish-ear/artifactId packagingear/packaging nameseam-glassfish-ear/name parent groupIdhome/groupId artifactIdseam-glassfish/artifactId version1.0-SNAPSHOT/version /parent dependencies dependency groupIdhome/groupId artifactIdseam-glassfish-ejb/artifactId version1.0-SNAPSHOT/version typeejb/type /dependency dependency groupIdhome/groupId artifactIdseam-glassfish-war/artifactId version1.0-SNAPSHOT/version typewar/type /dependency /dependencies I have some questions here: 1. How to tell the maven-ear-plugin to use my application.xml? And where in the ear directory should I place my own application.xml? 2. Because of the dependency on the ejb, I have to run mvn install in the ejb directory before I can run mvn compiler:compile in the war directory. Is there any way (like target dependencies in ant) to tell maven to compile / install all modules needed before the mvn compiler:compile is executed? 3. In my application.xml, beside the ejb and war modules, I need to add one more module like this: moduleejbjboss-seam-2.1.1.GA.jar/ejb/module The jboss seam jar file can be found with a dependency. What should I do to tell maven to include that file into the root of the ear file it creates when I run mvn ear:ear in the ear directory? 4. If I don't want to create the seam-glassfish-ear-1.0-SNAPSHOT.ear file, but a seam-glassfish-ear-1.0-SNAPSHOT_ear directory in which the ejb module is unpacked in the seam-glassfish-ejb-1.0-SNAPSHOT_jar directory, the war module is unpacked in the seam-glassfish-war-1.0-SNAPSHOT_war directory and the jboss seam library above is unpacked in the jboss-seam-2.1.1.GA_jar directory, what should I do? I read the http://maven.apache.org/plugins/maven-ear-plugin/ but found no shine to my questions (maybe there are, but not apparent to a maven newbie like me). Thank you.