Re: RE : [m2] Inter-project dependency question - forced to package sub-module dependencies manually?
This is exactly correct. If you want to build and package *only* your submodule, then Maven needs to have the other dependencies already installed in your local repo... it won't go find them, build, and use them even if they share a parent. This will work if executed from the top/parent pom. Then all artifacts will be built in order and you don't need to install the various module/submodules. Wayne On 3/29/06, Chris Wall [EMAIL PROTECTED] wrote: Thanks Gareth. It sounds as if Maven doesn't have the ability to determine and resolve inter-project dependencies when packaging a child. If a sub-module-A has a dependency on a module-B and module-B isn't package, Maven will not package module-B prior to packaging sub-module-A. Again, this is if Maven is executed from sub-module-A. I figured that since the pom.xmls were linked via parent, artifactIds, and module names, that Maven would have the information needed to resolve the dependency. Instead, from what I understand, you have to build all your dependency modules first, prior to packaging your sub-modules. From the root pom.xml everything works well, but if I just want to work with a sub-module, than extra steps are required. -Chris -Original Message- From: Gareth Western [mailto:[EMAIL PROTECTED] Sent: March 28, 2006 2:50 PM To: Maven Users List Subject: Re: RE : [m2] Inter-project dependency question Hi Chris, I'm not sure if this is the BEST way to do it, but what I do is create a parent pom.xml in the root directory. Then add commons, web-app, and stand-alone app as modules in that parent POM. Maven should figure out that since webapp and standalone app are dependent on the commons module then that's what needs to be built first. Then when you call mvn package (or whatever your goal is) on the parent pom, maven will first do the commons module before anything else. You'll also need to add parent tags to your sub-project (commons, web-app, and stand-alone app). See the example in the documentation at http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%2 0build%20more%20than%20one%20project%20at%20once ? for more details Hope that helps! ~Gareth On 3/28/06, Chris Wall [EMAIL PROTECTED] wrote: Thanks Olivier. How do I represent this dependency in my webapp pom.xml? I have the following dependency declaration, but M2 tries to download the jar instead of resolving that this is internally provided dependency. dependency groupIdmy-common/groupId artifactId my-common/artifactId version1.0-SNAPSHOT/version /dependency ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE : [m2] Inter-project dependency question
Thanks Olivier. How do I represent this dependency in my webapp pom.xml? I have the following dependency declaration, but M2 tries to download the jar instead of resolving that this is internally provided dependency. dependency groupIdmy-common/groupId artifactId my-common/artifactId version1.0-SNAPSHOT/version /dependency -Original Message- From: Olivier Lamy [mailto:[EMAIL PROTECTED] Sent: March 28, 2006 12:01 PM To: 'Maven Users List' Subject: RE : [m2] Inter-project dependency question Perso I do as this. root -- commons 1.0-SNAPSHOT -- webapp -- sub module A (depends on commons 1.0-SNAPSHOT) -- sub module B (depends on commons 1.0-SNAPSHOT) -- stand-alone app (depends on commons 1.0-SNAPSHOT) In the root directory, mvn clean test-compile. (in order to verify all is compatible). When commons is released, changed the version dependency in others modules. And just work in sub module A. - Olivier -Message d'origine- De : Chris Wall [mailto:[EMAIL PROTECTED] Envoyé : mardi 28 mars 2006 19:53 À : Maven Users List Objet : [m2] Inter-project dependency question This is probably a fundamental question for most of you... Considering the following project structure... root -- commons -- webapp -- sub module A -- sub module B -- stand-alone app ... since the webapp project has a dependency on commons (as does the stand-alone app), how do I tell M2 to build commons, if it's not already, from within the webapp module (webapp/pom.xml)? Thanks. -Chris ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, any attachments and the information contained therein (this message) are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited. -- Ce message électronique et tous les fichiers joints ainsi que les informations contenues dans ce message ( ci après le message ), sont confidentiels et destinés exclusivement à l'usage de la personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites. - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE : [m2] Inter-project dependency question
Hi Chris, I'm not sure if this is the BEST way to do it, but what I do is create a parent pom.xml in the root directory. Then add commons, web-app, and stand-alone app as modules in that parent POM. Maven should figure out that since webapp and standalone app are dependent on the commons module then that's what needs to be built first. Then when you call mvn package (or whatever your goal is) on the parent pom, maven will first do the commons module before anything else. You'll also need to add parent tags to your sub-project (commons, web-app, and stand-alone app). See the example in the documentation at http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%20build%20more%20than%20one%20project%20at%20once ? for more details Hope that helps! ~Gareth On 3/28/06, Chris Wall [EMAIL PROTECTED] wrote: Thanks Olivier. How do I represent this dependency in my webapp pom.xml? I have the following dependency declaration, but M2 tries to download the jar instead of resolving that this is internally provided dependency. dependency groupIdmy-common/groupId artifactId my-common/artifactId version1.0-SNAPSHOT/version /dependency