dev@glassfish.java.net

Re: maven pom.xml conventions

From: Romain Grécourt <romain.grecourt_at_oracle.com>
Date: Sat, 05 May 2012 03:18:07 +0200

Le 05/05/12 01:01, Bill Shannon a écrit :
> Romain Grécourt wrote on 05/04/12 17:47:
>> Le 05/05/12 00:30, Bill Shannon a écrit :
>>> There's a bunch of entries in a pom.xml that provide metadata for a
>>> project
>>> that's unrelated to building the project, such as <scm>, <licenses>,
>>> etc.
>> Some of these metadatas are used for releasing maven projects using the
>> maven-release-plugin (e.g scm,)
>
> I don't think any of the GlassFish subprojects are released
> independently,
> are they?
I see that you are talking about "maven modules".
Yes they share the same version, hence they are not released independently.
>
>> Also, some of them are mandatory for deployment to maven central
>> (https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-6.CentralSyncRequirement).
>>
>
> That implies those fields have to be duplicated in all ~400 subprojects
> of GlassFish, even though they're all the same? Seems like it's just
> asking
> for them to get out of sync. And it seems that the current GlassFish
> subprojects aren't doing that.
In the GlassFish workspace, everything is configured properly by the
main pom and its parent (jvet-parent).
If the modules inherit the parent pom, there is no need to duplicate
those fields.
>
>>> For a project that's a subproject of another project (such as a
>>> subproject
>>> of the GlassFish project), how much of this information should be
>>> included?
>> If they are not located in the same workspace but share a common
>> parent (e.g.
>> jvnet-parent), I guess that they should override some information
>> (scm, website
>> ...).
>
> I'm only asking about the case where they're in the same workspace.
> I would expect the top level pom for the workspace to include all this
> information, but the subprojects in the same workspace to only specify
> it if it was different (e.g., <developers>, <mailingLists>).
Yes, we just need to specify what is different.
>
>>> Or is it expected that someone looking for this information will go
>>> up the
>>> tree of parent projects until they find it?
>> If there is pom inheritance, users can still look at the effective
>> pom (mvn
>> help:effective-pom) rather than going up the tree.
>
> So is it ok omit this information in subprojects in the same workspace?
Yes, as far as the "maven module" inherits (transitively or not)
glassfish's parent pom.

Thanks,
Romain