You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stefan Seidel <ss...@vub.de> on 2011/08/18 17:48:49 UTC

Multi-Module and differing artifactId

Hi,

I guess this has been asked before, but is there any way to gracefully
handle situations in a multi-level modular project where the artifactId
does not always correspond to the folder name of the module?

It's especially about the scm url and connection.

So my folder structure is like this:

+/ = org.test:parent
++/childA = org.test.parent:childA
++/childB = org.test.parent:childWithOtherName

Now the scm url for childWithOtherName will always be the one from the
parent with "/childWithOtherName" appended, and there is no way I can
force it to use "/childB", unless I specify the whole path, which is
tedious with large projects.

I even tried to use ${project.parent.scm.connection}, which evaluates
fine with help:evaluate, but will not expand when used in the scm
connection.

Any help?

Stefan

-- 
best regards,

Stefan Seidel
Software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4, 04103 Leipzig
tel.    +49 (341) 9 60 50 93
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de 
web.    www.vub.de

VUB Printmedia GmbH
HRB Köln 24015
GF Dr. A. Preuss Neudorf, Dr. C. Preuss Neudorf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multi-Module and differing artifactId

Posted by Stefan Seidel <ss...@vub.de>.
On Thu, 18 Aug 2011 14:00:26 -0500
Wayne Fay <wa...@gmail.com> wrote:

> > I guess this has been asked before, but is there any way to
> > gracefully handle situations in a multi-level modular project where
> > the artifactId does not always correspond to the folder name of the
> > module?
> 
> Maven operates under certain conventions. This is not the convention,
> thus it is not well supported.
> 
> > parent with "/childWithOtherName" appended, and there is no way I
> > can force it to use "/childB", unless I specify the whole path,
> > which is tedious with large projects.
> 
> This is the "not well supported" aspect. I'm not even sure how good of
> an idea this is. Why can't you just change the artifactId or the
> module name??
Well, I'll resort to this, but it is quite cumbersome. On artifact
level, groupId+artifactId is a unique id, but effectively,
only artifactId needs to be unique (resulting filenames are only
constructed from the artifactId). So I could have

+/           = org.test:parent
+/ejb        = org.test.parent:ejb
+/ejb/common = org.test.parent.ejb:common-ejbs
+/war        = org.test.parent:war
+/war/common = org.test.parent.war:common-wars

but I really am forced to use the unique artifactId in the directory as
well:

+/                = org.test:parent
+/ejb             = org.test.parent:ejb
+/ejb/common-ejbs = org.test.parent.ejb:common-ejbs
+/war             = org.test.parent:war
+/war/common-wars = org.test.parent.war:common-wars

This is just duplicate information and strange, but that's like it with
conventions...

Thanks for your comments,

Stefan

> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 



-- 
best regards,

Stefan Seidel
Software  developer
________________________
VUB Printmedia GmbH
Chopinstraße 4, 04103 Leipzig
tel.    +49 (341) 9 60 50 93
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de 
web.    www.vub.de

VUB Printmedia GmbH
HRB Köln 24015
GF Dr. A. Preuss Neudorf, Dr. C. Preuss Neudorf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multi-Module and differing artifactId

Posted by Wayne Fay <wa...@gmail.com>.
> I guess this has been asked before, but is there any way to gracefully
> handle situations in a multi-level modular project where the artifactId
> does not always correspond to the folder name of the module?

Maven operates under certain conventions. This is not the convention,
thus it is not well supported.

> parent with "/childWithOtherName" appended, and there is no way I can
> force it to use "/childB", unless I specify the whole path, which is
> tedious with large projects.

This is the "not well supported" aspect. I'm not even sure how good of
an idea this is. Why can't you just change the artifactId or the
module name??

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multi-Module and differing artifactId

Posted by Lukas Theussl <lt...@apache.org>.
Hi,

I am not aware of any other solution, but I remember the following 
comment by Benjamin, quoted from http://jira.codehaus.org/browse/MNG-5000:

"The cause of the issue was that module-2 has a different artifactId 
than its module name. Let me stress that such a layout is a recipe for 
trouble as it results in effective URLs that depend on the source of the 
POM (project vs repo), i.e. if somebody (e.g. a plugin) was to construct 
the POM of this project from the repository, it would see different URLs 
than those used when building the project. The same problem would also 
arise during local project building when URLs are inherited from a 
grand-parent via one or more intermediate parents and any of those 
parents is resolved from the repo. For this reason, it's highly 
recommended to synchronize the module name with the artifactId."

HTH,
-Lukas


Stefan Seidel wrote:
> Hi,
>
> I guess this has been asked before, but is there any way to gracefully
> handle situations in a multi-level modular project where the artifactId
> does not always correspond to the folder name of the module?
>
> It's especially about the scm url and connection.
>
> So my folder structure is like this:
>
> +/ = org.test:parent
> ++/childA = org.test.parent:childA
> ++/childB = org.test.parent:childWithOtherName
>
> Now the scm url for childWithOtherName will always be the one from the
> parent with "/childWithOtherName" appended, and there is no way I can
> force it to use "/childB", unless I specify the whole path, which is
> tedious with large projects.
>
> I even tried to use ${project.parent.scm.connection}, which evaluates
> fine with help:evaluate, but will not expand when used in the scm
> connection.
>
> Any help?
>
> Stefan
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org