Hello Anders, Thanks again. So by using classifiers, if i am using a multi module project, even then whole project will be having one single POM? Is it possible in case of a project which is using modules?
What is a GAV anders? Sorry it's a dumb question but i am not very well acquainted with the buzzwords currently. :) Yes i will have a look at classifiers now and will get back to you with my feedback. Cheers, Prithvi Anders Hammar wrote: > > 1) Well, They easiest explanation is that you would then end up with three > different artifacts with the same GAV which actually are three different > artifacts. That breaks one of the basic rules about coordinates of unique > artifacts in Maven. The other, more subtle, is that you should only have > to > execute one build to get all your artifacts. You shouldn't have to build > your project three times. > > 2) Have a look at classifiers. There is always just one primary artifact > (no > classifier) of a project, but you could add extra artifacts with > classifiers. However, do understand that using classifiers incorrectly and > not understanding the limitations will break dependency management in > Maven. > I.e., there is just one pom for a project, so all artifacts (primary and > secondary) will have the same dependencies. > > /Anders > > On Wed, Feb 17, 2010 at 13:30, sehgal.prithvi > <[email protected]>wrote: > >> >> Hello Anders, >> Thanks for such a prompt response. I have two queries in mind after >> reading >> your answer. >> >> 1- Why ain't it good to have project which make different builds? >> Typically >> even >> if we use ANT, we have one build file responsible for generating >> different >> archives >> based on the environment? >> >> 2- Can you tell me what did you exactly mean to have on primary artifact >> and two secondary artifacts with classifiers? I am totally new to maven, >> so >> can you tell me a bit about it? >> >> Thanks, >> Prithvi >> >> >> Anders Hammar wrote: >> > >> > Having profiles determining what should be included in the ear (or any >> > other >> > archive for that matter) is not good practice. You should only do one >> > build >> > that creates all that you need. If you have profiles, you will >> typically >> > run >> > one build for each profile. Not good. >> > A better approach is to have, in your case, three different projects, >> each >> > building the ear for a specific environment. >> > Or, you could have one project with a primary artifact and two >> secondary >> > artifacts (with classifiers). I don't like classifiers so I wouldn't do >> > that, but it ios possible. >> > >> > /Anders >> > >> > On Wed, Feb 17, 2010 at 11:09, sehgal.prithvi >> > <[email protected]>wrote: >> > >> >> >> >> Dear All, >> >> >> >> I am new to Maven and i am encountering the following problem at hand. >> >> >> >> I have made a multi-module project. The project eventually has to >> build >> >> an >> >> EAR artifact from a WAR file. >> >> We have different properties files for different environments i.e. >> >> >> >> - Development >> >> - Test >> >> - Production >> >> >> >> My resource folder architecture is given as below >> >> >> >> resources/development/project.properties >> >> resources/test/project.properties >> >> resources/production/project.properties >> >> >> >> Now, i have implemented the Profiles approach provided in Maven and >> then >> >> for >> >> copying the resources based on different >> >> environments, i was using maven-resources-plugin. >> >> >> >> The issue is that, i want to exclude the folders production and test >> >> completely when my development profile is activated. >> >> When the war is made in the classes folder three folders are made also >> >> >> >> classes/development/project.properties >> >> classes/production/projection.properties >> >> classes/test/project.properties >> >> >> >> Where as i want something like this >> >> >> >> classes/project.properties >> >> >> >> That is referenced in the application-context.xml. Please help me how >> can >> >> i >> >> achieve this effect. >> >> >> >> Prithvi >> >> -- >> >> View this message in context: >> >> >> http://old.nabble.com/Copying-different-property-files-based-on-a-Profile-tp27621527p27621527.html >> >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [email protected] >> >> For additional commands, e-mail: [email protected] >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Copying-different-property-files-based-on-a-Profile-tp27621527p27622997.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > -- View this message in context: http://old.nabble.com/Copying-different-property-files-based-on-a-Profile-tp27621527p27623132.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
