Hi Dennis, One of the reason I don't prefer your approach (which I had adopted before) is that when all of the the artifact is released into the repository, it's structure does not match up with the actual SVN directory structure. It's harder to derived where that artifact comes from without looking into pom. The generated artifact name of customer-webapp-1.0.war is also not unique enough for us given that we share a Weblogic instance with many other applications.
Is there a best practice for how to choose groupId and artifactId? There are many way to slice and dice this but what is the most logical way and easiest way for user to come up with consistent groupId/artifactId regardless of the project (directory) structure. Look forward to hear comments from other people as well! Regards, rOnn c. Dennis Lundberg <[EMAIL PROTECTED]> 05/19/2007 10:36 PM Please respond to "Maven Developers List" <dev@maven.apache.org> To Maven Developers List <dev@maven.apache.org> cc Subject Re: Specifying IntelliJ module name with maven-idea-plugin [EMAIL PROTECTED] wrote: > Appology to previous email! Notes was playing up on me while editing it > half way! > > > Yes, you are right. I really meant that it doesn't have to be unique > across groupId but within each groupId it has to be unique. > > The approach I have now taken with groupId and artifactId is as follows, > > thisproject (mycompany:thisproject) > +- common (mycompany.thisproject:common) > +- core (mycompany.thisproject.common:core) > +- webapp (mycompany.thisproject.common:webapp) > +- batch (mycompany.thisproject.common:batch) > +- customer (mycompany.thisproject:customer) > +- core (mycompany.thisproject.customer:core) > +- webapp (mycompany.thisproject.customer:webapp) > +- batch (mycompany.thisproject.customer:batch) > > Customer and Common are tightly related but Customer webapp and Customer > batch ismore tightly related to Customer, hence I have a more specific > groupId for Customer apps. As you can see, if I already use following > coordinate, mycompany.thisproject.customer:webapp, why would I need to use > the following form of coordinate? > > mycompany.thisproject.customer:customer-webapp or > mycompany.thisproject.customer:thisproject-customer-webapp ? What I meant was that you might want to reconsider your choice of groupId. If common and customer is both within thisproject, and they are related to eachother in some way, then perhaps mycompany.thisproject would be a better groupId. And yes, that would mean that you end up with customer-webapp and common-webapp as artifactIds. > > > Regards, > rOnn c. > > > > > > > > > Dennis Lundberg <[EMAIL PROTECTED]> > 05/17/2007 08:31 AM > Please respond to > "Maven Developers List" <dev@maven.apache.org> > > > To > Maven Developers List <dev@maven.apache.org> > cc > > Subject > Re: Specifying IntelliJ module name with maven-idea-plugin > > > > > > > [EMAIL PROTECTED] wrote: >> Hi Arik, >> >> Yes, I have been using the prefix for alittle while but found that it is > a >> silly way to get around the problem given that maven coordinate system > is >> groupId:artifactId:version (http://maven.apache.org/pom.html) >> >> artifactId does not need to be unique and it is contextual to groupId. > It >> is silly to keep appending what is essentailly a groupId to the >> artifactId. > > Well, I'd have to answer yes and no to that. The artifactId must be > unique within the context of the groupId. So if we take the example that > you gave (see below) we would, using the syntax "groupId:artifactId", > have either > > 1. > project:common-webapp > project:customer-webapp > > or > > 2. > project-common:webapp > project-customer:webapp > > If common and customer are tightly related they should have the same > groupId, meaning 1. above. And with that you have two unique > artifactIds: "common-webapp" and "customer-webapp". Problem solved. > > >> Also what if there are more nested modules, prefixing artifactId would >> means that the prefix grows as you go deeper. I definitely find that it > is >> harder to maitain the convention and harder still to enforce that >> convention in a larger team environment. >> >> BTW: I really think that the default finalName for the artifact should >> have been a combination of groupId and artifactId. I think that is the >> main motivation for users to prefix thir artifactId with project name. >> >> >> Regards, >> rOnn c. >> >> >> >> >> >> >> >> >> >> "Arik Kfir" <[EMAIL PROTECTED]> >> 05/15/2007 05:49 PM >> Please respond to >> "Maven Developers List" <dev@maven.apache.org> >> >> >> To >> "Maven Developers List" <dev@maven.apache.org> >> cc >> >> Subject >> Re: Specifying IntelliJ module name with maven-idea-plugin >> >> >> >> >> >> >> I always prefix my artifactId(s) with a common prefix - for that reason; > >> e.g. >> "myproject-core", "myproject-commons", "myproject-webapp", >> "myproject-webapp-jsf", "myproject-webapp-struts", and so on. It > lengthens >> the names, but makes everything clear (and I don't need to use the >> 'finalName' property too...) >> >> >> On 5/15/07, Trygve Laugstøl <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: >>>> Hi there, >>>> >>>> I've notice that when using maven-idea-plugin, the module name that is >>>> generated is based solely on artifact id. >>>> >>>> Is there a particular reason for this? Why wouldn't it use project >> name >>>> instead? >>>> >>>> The reason I'm asking this is that we have three maven projects with >>>> following structure, >>>> >>>> project/ >>>> +- common/webapp/ >>>> +- customer/webapp/ >>>> >>>> Where artifact names are simply the name of the directory (e.g., >>> webapp), >>>> and I use final-name as ${groupId}.${artifactId}-${version} to control >>> the >>>> uniqueness of the actual artifacts file name that get generated. >>>> >>>> Unfortunatly, with current maven-idea-plugin this results in a module >>>> naming conflicting within IntelliJ. I think at the very least there >>> should >>>> be a way to specify generated IntelliJ module's name, using pom's >>> project >>>> name seems like a good idea to me. >>>> >>>> Does anyone have any thought on this? >>> The artifact id is normally unique enough, but your idea is still > useful >>> so please file an issue in JIRA[1]. >>> >>> [1]: http://jira.codehaus.org/browse/MIDEA >>> >>> -- >>> Trygve >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> ###################################################################### >> DISCLAIMER: >> This email and any attachment may contain confidential information. >> If you are not the intended recipient you are not authorized to copy >> or disclose all or any part of it without the prior written consent >> of Toyota. >> >> Opinions expressed in this email and any attachments are those of the >> sender and not necessarily the opinions of Toyota. >> Please scan this email and any attachment(s) for viruses. >> Toyota does not accept any responsibility for problems caused by >> viruses, whether it is Toyota's fault or not. >> ###################################################################### >> > > -- Dennis Lundberg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ###################################################################### DISCLAIMER: This email and any attachment may contain confidential information. If you are not the intended recipient you are not authorized to copy or disclose all or any part of it without the prior written consent of Toyota. Opinions expressed in this email and any attachments are those of the sender and not necessarily the opinions of Toyota. Please scan this email and any attachment(s) for viruses. Toyota does not accept any responsibility for problems caused by viruses, whether it is Toyota's fault or not. ######################################################################