Quantcast

Which is the BEST Approach to define Global POM.XML

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Which is the BEST Approach to define Global POM.XML

Daivish Shah
Hi Maven Team,

I am trying to find out what is the best way to define company specific
GLOBAL POM.XML. Which each team can inherit it in EACH Projects.

Can some one provide me guideline on that ? Is that going to be profile or
just simple POM.XML ? And how to inherit that. Please provide me guideline
to implement it. As this is very critical before we implement all projects
with MAVEN.

Thanks,
Daivish.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Eric Kolotyluk
What I do is have a top-level POM like (see below), and then I have my
top level project POMs reference that (see further below). This may not
be the best example, as I am still in the process of building the
infrastructure, but

 1. I put the Parent POM in its own place in source control and I
    manually deploy it with Maven when I make changes.
 2. You need to do this before creating any Project POMs that reference
    it because they should reference it via Maven and not the file
    system - if you work in a large company you will soon discover why.
 3. There is of course a bootstrapping issue because now the project
    POMs need to know how to find your Repository Manager, which is why
    I include that information in the top level (Corporate) POM so
    people can use it as a reference.
 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
 5. We are still developing our corporate repository infrastructure so
    the content of the Corporate POM will evolve over time as our
    corporate governance and policies are better codified.

Does that help?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
        Copyright © My Company 2012

        Proprietary & Confidential

        This is the top level POM for My Company Maven projects. It
contains rules and standards common to all projects.

        Changes:

        2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
          Created initial version for check-in into source control.

        2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
          Reconfigured for Nexus 2.0 on sonatype.
    -->
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>my-company</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Company Corporate POM</name>
<description>Corporate Project Object Module for standard conventions
and rules.</description>
<developers>
<developer>
<id>10069959</id>
<name>Eric Kolotyluk</name>
<email>[hidden email]</email>
<organization>My Company Ltd.</organization>
<timezone>Vancouver PDT</timezone>
<roles>
<role>Software Architect</role>
<role>Software Developer</role>
</roles>
</developer>
</developers>
<organization>
<name>My Company</name>
</organization>
<distributionManagement>
<downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>My Company Release Repository</name>
<url>http://sonatype:8081/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>My Company Snapshot Repository</name>
<url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<build>
</build>
<repositories>
<repository>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
<id>info.collide.mvn</id>
<name>Collide</name>
<url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
</repository>
<repository>
<id>thirdparty</id>
<name>3rd party</name>
<url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
<dependencies>
</dependencies>
<reporting>
<plugins>
</plugins>
</reporting>
<dependencyManagement>
</dependencyManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

- - - - - - -

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com</groupId>
<artifactId>my-company</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.my-company</groupId>
<artifactId>intersystem</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Company Intersystem</name>
<description>Service layer for collaborative, distributed applications
and services</description>
<licenses>
<license>
<name>My Company Intersystem</name>
<url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>10069959</id>
<name>Eric Kolotyluk</name>
<email>[hidden email]</email>
<organization>My Company</organization>
<timezone>Vancouver PDT</timezone>
<roles>
<role>Software Architect</role>
<role>Software Developer</role>
<role>Intersystem Architect</role>
</roles>
</developer>
</developers>
<organization>
<name>My Company</name>
</organization>
<distributionManagement>
<downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>My Company Release Repository</name>
<url>http://sonatype:8081/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>My Company Snapshot Repository</name>
<url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<build>
</build>
<repositories>
<repository>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
<id>info.collide.mvn</id>
<name>Collide</name>
<url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
</repository>
<repository>
<id>thirdparty</id>
<name>3rd party</name>
<url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
<dependencies>
</dependencies>
<reporting>
<plugins>
</plugins>
</reporting>
<dependencyManagement>
</dependencyManagement>
<properties>
<net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>platform.Java</module>
<module>platform.NET</module>
</modules>
</project>

On 2012-03-14 1:29 PM, Daivish Shah wrote:

> Hi Maven Team,
>
> I am trying to find out what is the best way to define company specific
> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>
> Can some one provide me guideline on that ? Is that going to be profile or
> just simple POM.XML ? And how to inherit that. Please provide me guideline
> to implement it. As this is very critical before we implement all projects
> with MAVEN.
>
> Thanks,
> Daivish.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Which is the BEST Approach to define Global POM.XML

Amir Gheibi
Hi Eric,

I was wondering why your project POM's packaging type is "POM". If I understand correctly, with "POM" packaging type you'd only get 3 default goals bound to their phases (I read it here: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings).

Thanks,
Amir

-----Original Message-----
From: Eric Kolotyluk [mailto:[hidden email]]
Sent: March-14-12 2:22 PM
To: [hidden email]
Subject: Re: Which is the BEST Approach to define Global POM.XML

What I do is have a top-level POM like (see below), and then I have my top level project POMs reference that (see further below). This may not be the best example, as I am still in the process of building the infrastructure, but

 1. I put the Parent POM in its own place in source control and I
    manually deploy it with Maven when I make changes.
 2. You need to do this before creating any Project POMs that reference
    it because they should reference it via Maven and not the file
    system - if you work in a large company you will soon discover why.
 3. There is of course a bootstrapping issue because now the project
    POMs need to know how to find your Repository Manager, which is why
    I include that information in the top level (Corporate) POM so
    people can use it as a reference.
 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
 5. We are still developing our corporate repository infrastructure so
    the content of the Corporate POM will evolve over time as our
    corporate governance and policies are better codified.

Does that help?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
        Copyright (c) My Company 2012

        Proprietary & Confidential

        This is the top level POM for My Company Maven projects. It contains rules and standards common to all projects.

        Changes:

        2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
          Created initial version for check-in into source control.

        2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
          Reconfigured for Nexus 2.0 on sonatype.
    -->
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>my-company</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Company Corporate POM</name>
<description>Corporate Project Object Module for standard conventions and rules.</description> <developers> <developer> <id>10069959</id> <name>Eric Kolotyluk</name> <email>[hidden email]</email>
<organization>My Company Ltd.</organization> <timezone>Vancouver PDT</timezone> <roles> <role>Software Architect</role> <role>Software Developer</role> </roles> </developer> </developers> <organization> <name>My Company</name> </organization> <distributionManagement> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>My Company Release Repository</name> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>My Company Snapshot Repository</name> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<build>
</build>
<repositories>
<repository>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
<id>info.collide.mvn</id>
<name>Collide</name>
<url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
</repository>
<repository>
<id>thirdparty</id>
<name>3rd party</name>
<url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
<dependencies>
</dependencies>
<reporting>
<plugins>
</plugins>
</reporting>
<dependencyManagement>
</dependencyManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

- - - - - - -

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com</groupId>
<artifactId>my-company</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.my-company</groupId>
<artifactId>intersystem</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Company Intersystem</name>
<description>Service layer for collaborative, distributed applications and services</description> <licenses> <license> <name>My Company Intersystem</name> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>10069959</id>
<name>Eric Kolotyluk</name>
<email>[hidden email]</email>
<organization>My Company</organization>
<timezone>Vancouver PDT</timezone>
<roles>
<role>Software Architect</role>
<role>Software Developer</role>
<role>Intersystem Architect</role>
</roles>
</developer>
</developers>
<organization>
<name>My Company</name>
</organization>
<distributionManagement>
<downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>My Company Release Repository</name> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>My Company Snapshot Repository</name> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<build>
</build>
<repositories>
<repository>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
<id>info.collide.mvn</id>
<name>Collide</name>
<url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
</repository>
<repository>
<id>thirdparty</id>
<name>3rd party</name>
<url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
<dependencies>
</dependencies>
<reporting>
<plugins>
</plugins>
</reporting>
<dependencyManagement>
</dependencyManagement>
<properties>
<net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>platform.Java</module>
<module>platform.NET</module>
</modules>
</project>

On 2012-03-14 1:29 PM, Daivish Shah wrote:

> Hi Maven Team,
>
> I am trying to find out what is the best way to define company
> specific GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>
> Can some one provide me guideline on that ? Is that going to be
> profile or just simple POM.XML ? And how to inherit that. Please
> provide me guideline to implement it. As this is very critical before
> we implement all projects with MAVEN.
>
> Thanks,
> Daivish.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Barrie Treloar
On Thu, Mar 15, 2012 at 8:04 AM, Amir Gheibi <[hidden email]> wrote:
> Hi Eric,
>
> I was wondering why your project POM's packaging type is "POM". If I understand correctly, with "POM" packaging type you'd only get 3 default goals bound to their phases (I read it here: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings).

The top level pom's types are always pom.
Since they never build any artifacts.

The corporate one is more like a general defaults, so it doesn't build
anything => use pom.
The top level project often has modules, in which case it MUST be pom.

Which other lifecycles did you expect to be able to run on something
that doesn't itself build an artifact?
This is not the same as being able to run "mvn compile" at the top
level and have this command also run in all the modules.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Manfred Moser
In reply to this post by Amir Gheibi
I did a blog post about this ages ago..

http://www.mosabuam.com/2009/10/company-super-pom-a-maven-practice

Keep in mind that this is a few years old so the versions and such are
out of date.. but the concept still applies.

manfred
http://simpligility.com

On 12-03-14 02:34 PM, Amir Gheibi wrote:

> Hi Eric,
>
> I was wondering why your project POM's packaging type is "POM". If I understand correctly, with "POM" packaging type you'd only get 3 default goals bound to their phases (I read it here: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings).
>
> Thanks,
> Amir
>
> -----Original Message-----
> From: Eric Kolotyluk [mailto:[hidden email]]
> Sent: March-14-12 2:22 PM
> To: [hidden email]
> Subject: Re: Which is the BEST Approach to define Global POM.XML
>
> What I do is have a top-level POM like (see below), and then I have my top level project POMs reference that (see further below). This may not be the best example, as I am still in the process of building the infrastructure, but
>
>   1. I put the Parent POM in its own place in source control and I
>      manually deploy it with Maven when I make changes.
>   2. You need to do this before creating any Project POMs that reference
>      it because they should reference it via Maven and not the file
>      system - if you work in a large company you will soon discover why.
>   3. There is of course a bootstrapping issue because now the project
>      POMs need to know how to find your Repository Manager, which is why
>      I include that information in the top level (Corporate) POM so
>      people can use it as a reference.
>   4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>   5. We are still developing our corporate repository infrastructure so
>      the content of the Corporate POM will evolve over time as our
>      corporate governance and policies are better codified.
>
> Does that help?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <!--
>          Copyright (c) My Company 2012
>
>          Proprietary&  Confidential
>
>          This is the top level POM for My Company Maven projects. It contains rules and standards common to all projects.
>
>          Changes:
>
>          2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>            Created initial version for check-in into source control.
>
>          2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>            Reconfigured for Nexus 2.0 on sonatype.
>      -->
> <modelVersion>4.0.0</modelVersion>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Corporate POM</name>
> <description>Corporate Project Object Module for standard conventions and rules.</description>  <developers>  <developer>  <id>10069959</id>  <name>Eric Kolotyluk</name>  <email>[hidden email]</email>
> <organization>My Company Ltd.</organization>  <timezone>Vancouver PDT</timezone>  <roles>  <role>Software Architect</role>  <role>Software Developer</role>  </roles>  </developer>  </developers>  <organization>  <name>My Company</name>  </organization>  <distributionManagement>  <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> </project>
>
> - - - - - - -
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> </parent>
> <groupId>com.my-company</groupId>
> <artifactId>intersystem</artifactId>
> <version>0.0.2-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Intersystem</name>
> <description>Service layer for collaborative, distributed applications and services</description>  <licenses>  <license>  <name>My Company Intersystem</name>  <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
> <distribution>repo</distribution>
> </license>
> </licenses>
> <developers>
> <developer>
> <id>10069959</id>
> <name>Eric Kolotyluk</name>
> <email>[hidden email]</email>
> <organization>My Company</organization>
> <timezone>Vancouver PDT</timezone>
> <roles>
> <role>Software Architect</role>
> <role>Software Developer</role>
> <role>Intersystem Architect</role>
> </roles>
> </developer>
> </developers>
> <organization>
> <name>My Company</name>
> </organization>
> <distributionManagement>
> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> <modules>
> <module>platform.Java</module>
> <module>platform.NET</module>
> </modules>
> </project>
>
> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>> Hi Maven Team,
>>
>> I am trying to find out what is the best way to define company
>> specific GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>
>> Can some one provide me guideline on that ? Is that going to be
>> profile or just simple POM.XML ? And how to inherit that. Please
>> provide me guideline to implement it. As this is very critical before
>> we implement all projects with MAVEN.
>>
>> Thanks,
>> Daivish.
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Eric Kolotyluk
In reply to this post by Amir Gheibi
Amir, my Project POM has more modules inside (platform.Java &
platform.NET), and they in turn are packaging type "POM" because there
are more modules in those, that typically are types like "JAR" so my
structure looks like

Corporate POM
+-- Project POM 1
+--+-- Platform POM 1.1
+--+--+-- Artifact POM 1.1.1
+--+--+-- Artifact POM 1.1.2
+--+-- Platform POM 1.2
+--+--+-- Artifact POM 1.2.1
+--+--+-- Artifact POM 1.2.2

The Project and Platform POM are just there for structural reasons. For
example if I want I can do a clean and deploy in the Project POM
directory and everything gets built, tested and deployed, or I work on
more specific pieces.

Cheers, Eric

On 2012-03-14 2:34 PM, Amir Gheibi wrote:

> Hi Eric,
>
> I was wondering why your project POM's packaging type is "POM". If I understand correctly, with "POM" packaging type you'd only get 3 default goals bound to their phases (I read it here: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings).
>
> Thanks,
> Amir
>
> -----Original Message-----
> From: Eric Kolotyluk [mailto:[hidden email]]
> Sent: March-14-12 2:22 PM
> To: [hidden email]
> Subject: Re: Which is the BEST Approach to define Global POM.XML
>
> What I do is have a top-level POM like (see below), and then I have my top level project POMs reference that (see further below). This may not be the best example, as I am still in the process of building the infrastructure, but
>
>   1. I put the Parent POM in its own place in source control and I
>      manually deploy it with Maven when I make changes.
>   2. You need to do this before creating any Project POMs that reference
>      it because they should reference it via Maven and not the file
>      system - if you work in a large company you will soon discover why.
>   3. There is of course a bootstrapping issue because now the project
>      POMs need to know how to find your Repository Manager, which is why
>      I include that information in the top level (Corporate) POM so
>      people can use it as a reference.
>   4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>   5. We are still developing our corporate repository infrastructure so
>      the content of the Corporate POM will evolve over time as our
>      corporate governance and policies are better codified.
>
> Does that help?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <!--
>          Copyright (c) My Company 2012
>
>          Proprietary&  Confidential
>
>          This is the top level POM for My Company Maven projects. It contains rules and standards common to all projects.
>
>          Changes:
>
>          2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>            Created initial version for check-in into source control.
>
>          2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>            Reconfigured for Nexus 2.0 on sonatype.
>      -->
> <modelVersion>4.0.0</modelVersion>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Corporate POM</name>
> <description>Corporate Project Object Module for standard conventions and rules.</description>  <developers>  <developer>  <id>10069959</id>  <name>Eric Kolotyluk</name>  <email>[hidden email]</email>
> <organization>My Company Ltd.</organization>  <timezone>Vancouver PDT</timezone>  <roles>  <role>Software Architect</role>  <role>Software Developer</role>  </roles>  </developer>  </developers>  <organization>  <name>My Company</name>  </organization>  <distributionManagement>  <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> </project>
>
> - - - - - - -
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> </parent>
> <groupId>com.my-company</groupId>
> <artifactId>intersystem</artifactId>
> <version>0.0.2-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Intersystem</name>
> <description>Service layer for collaborative, distributed applications and services</description>  <licenses>  <license>  <name>My Company Intersystem</name>  <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
> <distribution>repo</distribution>
> </license>
> </licenses>
> <developers>
> <developer>
> <id>10069959</id>
> <name>Eric Kolotyluk</name>
> <email>[hidden email]</email>
> <organization>My Company</organization>
> <timezone>Vancouver PDT</timezone>
> <roles>
> <role>Software Architect</role>
> <role>Software Developer</role>
> <role>Intersystem Architect</role>
> </roles>
> </developer>
> </developers>
> <organization>
> <name>My Company</name>
> </organization>
> <distributionManagement>
> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>  <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> <modules>
> <module>platform.Java</module>
> <module>platform.NET</module>
> </modules>
> </project>
>
> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>> Hi Maven Team,
>>
>> I am trying to find out what is the best way to define company
>> specific GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>
>> Can some one provide me guideline on that ? Is that going to be
>> profile or just simple POM.XML ? And how to inherit that. Please
>> provide me guideline to implement it. As this is very critical before
>> we implement all projects with MAVEN.
>>
>> Thanks,
>> Daivish.
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Which is the BEST Approach to define Global POM.XML

Amir Gheibi
Got it. Thanks.

-----Original Message-----
From: Eric Kolotyluk [mailto:[hidden email]]
Sent: March-14-12 2:57 PM
To: Amir Gheibi
Cc: Maven Users List
Subject: Re: Which is the BEST Approach to define Global POM.XML

Amir, my Project POM has more modules inside (platform.Java & platform.NET), and they in turn are packaging type "POM" because there are more modules in those, that typically are types like "JAR" so my structure looks like

Corporate POM
+-- Project POM 1
+--+-- Platform POM 1.1
+--+--+-- Artifact POM 1.1.1
+--+--+-- Artifact POM 1.1.2
+--+-- Platform POM 1.2
+--+--+-- Artifact POM 1.2.1
+--+--+-- Artifact POM 1.2.2

The Project and Platform POM are just there for structural reasons. For example if I want I can do a clean and deploy in the Project POM directory and everything gets built, tested and deployed, or I work on more specific pieces.

Cheers, Eric

On 2012-03-14 2:34 PM, Amir Gheibi wrote:

> Hi Eric,
>
> I was wondering why your project POM's packaging type is "POM". If I understand correctly, with "POM" packaging type you'd only get 3 default goals bound to their phases (I read it here: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings).
>
> Thanks,
> Amir
>
> -----Original Message-----
> From: Eric Kolotyluk [mailto:[hidden email]]
> Sent: March-14-12 2:22 PM
> To: [hidden email]
> Subject: Re: Which is the BEST Approach to define Global POM.XML
>
> What I do is have a top-level POM like (see below), and then I have my
> top level project POMs reference that (see further below). This may
> not be the best example, as I am still in the process of building the
> infrastructure, but
>
>   1. I put the Parent POM in its own place in source control and I
>      manually deploy it with Maven when I make changes.
>   2. You need to do this before creating any Project POMs that reference
>      it because they should reference it via Maven and not the file
>      system - if you work in a large company you will soon discover why.
>   3. There is of course a bootstrapping issue because now the project
>      POMs need to know how to find your Repository Manager, which is why
>      I include that information in the top level (Corporate) POM so
>      people can use it as a reference.
>   4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>   5. We are still developing our corporate repository infrastructure so
>      the content of the Corporate POM will evolve over time as our
>      corporate governance and policies are better codified.
>
> Does that help?
>
> <?xml version="1.0" encoding="UTF-8"?> <project
> xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <!--
>          Copyright (c) My Company 2012
>
>          Proprietary&  Confidential
>
>          This is the top level POM for My Company Maven projects. It contains rules and standards common to all projects.
>
>          Changes:
>
>          2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>            Created initial version for check-in into source control.
>
>          2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>            Reconfigured for Nexus 2.0 on sonatype.
>      -->
> <modelVersion>4.0.0</modelVersion>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Corporate POM</name>
> <description>Corporate Project Object Module for standard conventions
> and rules.</description>  <developers>  <developer>  <id>10069959</id>
> <name>Eric Kolotyluk</name>  <email>[hidden email]</email>
> <organization>My Company Ltd.</organization>  <timezone>Vancouver
> PDT</timezone>  <roles>  <role>Software Architect</role>
> <role>Software Developer</role>  </roles>  </developer>  </developers>
> <organization>  <name>My Company</name>  </organization>
> <distributionManagement>
> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloa
> dUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/
> </url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> </project>
>
> - - - - - - -
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> </parent>
> <groupId>com.my-company</groupId>
> <artifactId>intersystem</artifactId>
> <version>0.0.2-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Intersystem</name>
> <description>Service layer for collaborative, distributed applications
> and services</description>  <licenses>  <license>  <name>My Company
> Intersystem</name>
> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuid
> elines/Intersystem/default.aspx</url>
> <distribution>repo</distribution>
> </license>
> </licenses>
> <developers>
> <developer>
> <id>10069959</id>
> <name>Eric Kolotyluk</name>
> <email>[hidden email]</email>
> <organization>My Company</organization> <timezone>Vancouver
> PDT</timezone> <roles> <role>Software Architect</role> <role>Software
> Developer</role> <role>Intersystem Architect</role> </roles>
> </developer> </developers> <organization> <name>My Company</name>
> </organization> <distributionManagement>
> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloa
> dUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/
> </url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> <modules>
> <module>platform.Java</module>
> <module>platform.NET</module>
> </modules>
> </project>
>
> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>> Hi Maven Team,
>>
>> I am trying to find out what is the best way to define company
>> specific GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>
>> Can some one provide me guideline on that ? Is that going to be
>> profile or just simple POM.XML ? And how to inherit that. Please
>> provide me guideline to implement it. As this is very critical before
>> we implement all projects with MAVEN.
>>
>> Thanks,
>> Daivish.
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Daivish Shah
Thanks all for quick responses !!!

Special Thanks to Eric Kolotyluk and Manfred Moser.

Blog is super cool. Thanks for posting it.
*
*
*
*

On Wed, Mar 14, 2012 at 2:51 PM, Amir Gheibi <[hidden email]>wrote:

> Got it. Thanks.
>
> -----Original Message-----
> From: Eric Kolotyluk [mailto:[hidden email]]
> Sent: March-14-12 2:57 PM
> To: Amir Gheibi
> Cc: Maven Users List
> Subject: Re: Which is the BEST Approach to define Global POM.XML
>
> Amir, my Project POM has more modules inside (platform.Java &
> platform.NET), and they in turn are packaging type "POM" because there are
> more modules in those, that typically are types like "JAR" so my structure
> looks like
>
> Corporate POM
> +-- Project POM 1
> +--+-- Platform POM 1.1
> +--+--+-- Artifact POM 1.1.1
> +--+--+-- Artifact POM 1.1.2
> +--+-- Platform POM 1.2
> +--+--+-- Artifact POM 1.2.1
> +--+--+-- Artifact POM 1.2.2
>
> The Project and Platform POM are just there for structural reasons. For
> example if I want I can do a clean and deploy in the Project POM directory
> and everything gets built, tested and deployed, or I work on more specific
> pieces.
>
> Cheers, Eric
>
> On 2012-03-14 2:34 PM, Amir Gheibi wrote:
> > Hi Eric,
> >
> > I was wondering why your project POM's packaging type is "POM". If I
> understand correctly, with "POM" packaging type you'd only get 3 default
> goals bound to their phases (I read it here:
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings
> ).
> >
> > Thanks,
> > Amir
> >
> > -----Original Message-----
> > From: Eric Kolotyluk [mailto:[hidden email]]
> > Sent: March-14-12 2:22 PM
> > To: [hidden email]
> > Subject: Re: Which is the BEST Approach to define Global POM.XML
> >
> > What I do is have a top-level POM like (see below), and then I have my
> > top level project POMs reference that (see further below). This may
> > not be the best example, as I am still in the process of building the
> > infrastructure, but
> >
> >   1. I put the Parent POM in its own place in source control and I
> >      manually deploy it with Maven when I make changes.
> >   2. You need to do this before creating any Project POMs that reference
> >      it because they should reference it via Maven and not the file
> >      system - if you work in a large company you will soon discover why.
> >   3. There is of course a bootstrapping issue because now the project
> >      POMs need to know how to find your Repository Manager, which is why
> >      I include that information in the top level (Corporate) POM so
> >      people can use it as a reference.
> >   4. As you may gather I am using Sonatype's Nexus as a Repository
> Manager.
> >   5. We are still developing our corporate repository infrastructure so
> >      the content of the Corporate POM will evolve over time as our
> >      corporate governance and policies are better codified.
> >
> > Does that help?
> >
> > <?xml version="1.0" encoding="UTF-8"?> <project
> > xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/xsd/maven-4.0.0.xsd">
> > <!--
> >          Copyright (c) My Company 2012
> >
> >          Proprietary&  Confidential
> >
> >          This is the top level POM for My Company Maven projects. It
> contains rules and standards common to all projects.
> >
> >          Changes:
> >
> >          2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
> >            Created initial version for check-in into source control.
> >
> >          2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
> >            Reconfigured for Nexus 2.0 on sonatype.
> >      -->
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>com</groupId>
> > <artifactId>my-company</artifactId>
> > <version>0.0.1-SNAPSHOT</version>
> > <packaging>pom</packaging>
> > <name>My Company Corporate POM</name>
> > <description>Corporate Project Object Module for standard conventions
> > and rules.</description>  <developers>  <developer>  <id>10069959</id>
> > <name>Eric Kolotyluk</name>  <email>[hidden email]</email>
> > <organization>My Company Ltd.</organization>  <timezone>Vancouver
> > PDT</timezone>  <roles>  <role>Software Architect</role>
> > <role>Software Developer</role>  </roles>  </developer>  </developers>
> > <organization>  <name>My Company</name>  </organization>
> > <distributionManagement>
> > <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloa
> > dUrl>
> > <repository>
> > <uniqueVersion>false</uniqueVersion>
> > <id>nexus</id>
> > <name>My Company Release Repository</name>
> > <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> > <layout>default</layout>
> > </repository>
> > <snapshotRepository>
> > <id>nexus</id>
> > <name>My Company Snapshot Repository</name>
> > <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> > <layout>default</layout>
> > </snapshotRepository>
> > </distributionManagement>
> > <build>
> > </build>
> > <repositories>
> > <repository>
> > <releases>
> > <updatePolicy>always</updatePolicy>
> > </releases>
> > <id>info.collide.mvn</id>
> > <name>Collide</name>
> > <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/
> > </url>
> > </repository>
> > <repository>
> > <id>thirdparty</id>
> > <name>3rd party</name>
> > <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> > </repository>
> > </repositories>
> > <dependencies>
> > </dependencies>
> > <reporting>
> > <plugins>
> > </plugins>
> > </reporting>
> > <dependencyManagement>
> > </dependencyManagement>
> > <properties>
> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> > </properties>
> > </project>
> >
> > - - - - - - -
> >
> > <project xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/xsd/maven-4.0.0.xsd">
> > <modelVersion>4.0.0</modelVersion>
> > <parent>
> > <groupId>com</groupId>
> > <artifactId>my-company</artifactId>
> > <version>0.0.1-SNAPSHOT</version>
> > </parent>
> > <groupId>com.my-company</groupId>
> > <artifactId>intersystem</artifactId>
> > <version>0.0.2-SNAPSHOT</version>
> > <packaging>pom</packaging>
> > <name>My Company Intersystem</name>
> > <description>Service layer for collaborative, distributed applications
> > and services</description>  <licenses>  <license>  <name>My Company
> > Intersystem</name>
> > <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuid
> > elines/Intersystem/default.aspx</url>
> > <distribution>repo</distribution>
> > </license>
> > </licenses>
> > <developers>
> > <developer>
> > <id>10069959</id>
> > <name>Eric Kolotyluk</name>
> > <email>[hidden email]</email>
> > <organization>My Company</organization> <timezone>Vancouver
> > PDT</timezone> <roles> <role>Software Architect</role> <role>Software
> > Developer</role> <role>Intersystem Architect</role> </roles>
> > </developer> </developers> <organization> <name>My Company</name>
> > </organization> <distributionManagement>
> > <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloa
> > dUrl>
> > <repository>
> > <uniqueVersion>false</uniqueVersion>
> > <id>nexus</id>
> > <name>My Company Release Repository</name>
> > <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> > <layout>default</layout>
> > </repository>
> > <snapshotRepository>
> > <id>nexus</id>
> > <name>My Company Snapshot Repository</name>
> > <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> > <layout>default</layout>
> > </snapshotRepository>
> > </distributionManagement>
> > <build>
> > </build>
> > <repositories>
> > <repository>
> > <releases>
> > <updatePolicy>always</updatePolicy>
> > </releases>
> > <id>info.collide.mvn</id>
> > <name>Collide</name>
> > <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/
> > </url>
> > </repository>
> > <repository>
> > <id>thirdparty</id>
> > <name>3rd party</name>
> > <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> > </repository>
> > </repositories>
> > <dependencies>
> > </dependencies>
> > <reporting>
> > <plugins>
> > </plugins>
> > </reporting>
> > <dependencyManagement>
> > </dependencyManagement>
> > <properties>
> > <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> > </properties>
> > <modules>
> > <module>platform.Java</module>
> > <module>platform.NET</module>
> > </modules>
> > </project>
> >
> > On 2012-03-14 1:29 PM, Daivish Shah wrote:
> >> Hi Maven Team,
> >>
> >> I am trying to find out what is the best way to define company
> >> specific GLOBAL POM.XML. Which each team can inherit it in EACH
> Projects.
> >>
> >> Can some one provide me guideline on that ? Is that going to be
> >> profile or just simple POM.XML ? And how to inherit that. Please
> >> provide me guideline to implement it. As this is very critical before
> >> we implement all projects with MAVEN.
> >>
> >> Thanks,
> >> Daivish.
> >>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Eric Kolotyluk
You are most welcome - and the blog is super cool - I wish I had seen it
a long time ago.

Cheers, Eric

On 2012-03-14 5:33 PM, Daivish Shah wrote:

> Thanks all for quick responses !!!
>
> Special Thanks to Eric Kolotyluk and Manfred Moser.
>
> Blog is super cool. Thanks for posting it.
> *
> *
> *
> *
>
> On Wed, Mar 14, 2012 at 2:51 PM, Amir Gheibi<[hidden email]>wrote:
>
>> Got it. Thanks.
>>
>> -----Original Message-----
>> From: Eric Kolotyluk [mailto:[hidden email]]
>> Sent: March-14-12 2:57 PM
>> To: Amir Gheibi
>> Cc: Maven Users List
>> Subject: Re: Which is the BEST Approach to define Global POM.XML
>>
>> Amir, my Project POM has more modules inside (platform.Java&
>> platform.NET), and they in turn are packaging type "POM" because there are
>> more modules in those, that typically are types like "JAR" so my structure
>> looks like
>>
>> Corporate POM
>> +-- Project POM 1
>> +--+-- Platform POM 1.1
>> +--+--+-- Artifact POM 1.1.1
>> +--+--+-- Artifact POM 1.1.2
>> +--+-- Platform POM 1.2
>> +--+--+-- Artifact POM 1.2.1
>> +--+--+-- Artifact POM 1.2.2
>>
>> The Project and Platform POM are just there for structural reasons. For
>> example if I want I can do a clean and deploy in the Project POM directory
>> and everything gets built, tested and deployed, or I work on more specific
>> pieces.
>>
>> Cheers, Eric
>>
>> On 2012-03-14 2:34 PM, Amir Gheibi wrote:
>>> Hi Eric,
>>>
>>> I was wondering why your project POM's packaging type is "POM". If I
>> understand correctly, with "POM" packaging type you'd only get 3 default
>> goals bound to their phases (I read it here:
>> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings
>> ).
>>> Thanks,
>>> Amir
>>>
>>> -----Original Message-----
>>> From: Eric Kolotyluk [mailto:[hidden email]]
>>> Sent: March-14-12 2:22 PM
>>> To: [hidden email]
>>> Subject: Re: Which is the BEST Approach to define Global POM.XML
>>>
>>> What I do is have a top-level POM like (see below), and then I have my
>>> top level project POMs reference that (see further below). This may
>>> not be the best example, as I am still in the process of building the
>>> infrastructure, but
>>>
>>>    1. I put the Parent POM in its own place in source control and I
>>>       manually deploy it with Maven when I make changes.
>>>    2. You need to do this before creating any Project POMs that reference
>>>       it because they should reference it via Maven and not the file
>>>       system - if you work in a large company you will soon discover why.
>>>    3. There is of course a bootstrapping issue because now the project
>>>       POMs need to know how to find your Repository Manager, which is why
>>>       I include that information in the top level (Corporate) POM so
>>>       people can use it as a reference.
>>>    4. As you may gather I am using Sonatype's Nexus as a Repository
>> Manager.
>>>    5. We are still developing our corporate repository infrastructure so
>>>       the content of the Corporate POM will evolve over time as our
>>>       corporate governance and policies are better codified.
>>>
>>> Does that help?
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>  <project
>>> xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>> <!--
>>>           Copyright (c) My Company 2012
>>>
>>>           Proprietary&   Confidential
>>>
>>>           This is the top level POM for My Company Maven projects. It
>> contains rules and standards common to all projects.
>>>           Changes:
>>>
>>>           2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>>>             Created initial version for check-in into source control.
>>>
>>>           2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>>>             Reconfigured for Nexus 2.0 on sonatype.
>>>       -->
>>> <modelVersion>4.0.0</modelVersion>
>>> <groupId>com</groupId>
>>> <artifactId>my-company</artifactId>
>>> <version>0.0.1-SNAPSHOT</version>
>>> <packaging>pom</packaging>
>>> <name>My Company Corporate POM</name>
>>> <description>Corporate Project Object Module for standard conventions
>>> and rules.</description>   <developers>   <developer>   <id>10069959</id>
>>> <name>Eric Kolotyluk</name>   <email>[hidden email]</email>
>>> <organization>My Company Ltd.</organization>   <timezone>Vancouver
>>> PDT</timezone>   <roles>   <role>Software Architect</role>
>>> <role>Software Developer</role>   </roles>   </developer>   </developers>
>>> <organization>   <name>My Company</name>   </organization>
>>> <distributionManagement>
>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloa
>>> dUrl>
>>> <repository>
>>> <uniqueVersion>false</uniqueVersion>
>>> <id>nexus</id>
>>> <name>My Company Release Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>> <layout>default</layout>
>>> </repository>
>>> <snapshotRepository>
>>> <id>nexus</id>
>>> <name>My Company Snapshot Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>> <layout>default</layout>
>>> </snapshotRepository>
>>> </distributionManagement>
>>> <build>
>>> </build>
>>> <repositories>
>>> <repository>
>>> <releases>
>>> <updatePolicy>always</updatePolicy>
>>> </releases>
>>> <id>info.collide.mvn</id>
>>> <name>Collide</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/
>>> </url>
>>> </repository>
>>> <repository>
>>> <id>thirdparty</id>
>>> <name>3rd party</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>> </repository>
>>> </repositories>
>>> <dependencies>
>>> </dependencies>
>>> <reporting>
>>> <plugins>
>>> </plugins>
>>> </reporting>
>>> <dependencyManagement>
>>> </dependencyManagement>
>>> <properties>
>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>> </properties>
>>> </project>
>>>
>>> - - - - - - -
>>>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>> <modelVersion>4.0.0</modelVersion>
>>> <parent>
>>> <groupId>com</groupId>
>>> <artifactId>my-company</artifactId>
>>> <version>0.0.1-SNAPSHOT</version>
>>> </parent>
>>> <groupId>com.my-company</groupId>
>>> <artifactId>intersystem</artifactId>
>>> <version>0.0.2-SNAPSHOT</version>
>>> <packaging>pom</packaging>
>>> <name>My Company Intersystem</name>
>>> <description>Service layer for collaborative, distributed applications
>>> and services</description>   <licenses>   <license>   <name>My Company
>>> Intersystem</name>
>>> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuid
>>> elines/Intersystem/default.aspx</url>
>>> <distribution>repo</distribution>
>>> </license>
>>> </licenses>
>>> <developers>
>>> <developer>
>>> <id>10069959</id>
>>> <name>Eric Kolotyluk</name>
>>> <email>[hidden email]</email>
>>> <organization>My Company</organization>  <timezone>Vancouver
>>> PDT</timezone>  <roles>  <role>Software Architect</role>  <role>Software
>>> Developer</role>  <role>Intersystem Architect</role>  </roles>
>>> </developer>  </developers>  <organization>  <name>My Company</name>
>>> </organization>  <distributionManagement>
>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloa
>>> dUrl>
>>> <repository>
>>> <uniqueVersion>false</uniqueVersion>
>>> <id>nexus</id>
>>> <name>My Company Release Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>> <layout>default</layout>
>>> </repository>
>>> <snapshotRepository>
>>> <id>nexus</id>
>>> <name>My Company Snapshot Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>> <layout>default</layout>
>>> </snapshotRepository>
>>> </distributionManagement>
>>> <build>
>>> </build>
>>> <repositories>
>>> <repository>
>>> <releases>
>>> <updatePolicy>always</updatePolicy>
>>> </releases>
>>> <id>info.collide.mvn</id>
>>> <name>Collide</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/
>>> </url>
>>> </repository>
>>> <repository>
>>> <id>thirdparty</id>
>>> <name>3rd party</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>> </repository>
>>> </repositories>
>>> <dependencies>
>>> </dependencies>
>>> <reporting>
>>> <plugins>
>>> </plugins>
>>> </reporting>
>>> <dependencyManagement>
>>> </dependencyManagement>
>>> <properties>
>>> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>> </properties>
>>> <modules>
>>> <module>platform.Java</module>
>>> <module>platform.NET</module>
>>> </modules>
>>> </project>
>>>
>>> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>>> Hi Maven Team,
>>>>
>>>> I am trying to find out what is the best way to define company
>>>> specific GLOBAL POM.XML. Which each team can inherit it in EACH
>> Projects.
>>>> Can some one provide me guideline on that ? Is that going to be
>>>> profile or just simple POM.XML ? And how to inherit that. Please
>>>> provide me guideline to implement it. As this is very critical before
>>>> we implement all projects with MAVEN.
>>>>
>>>> Thanks,
>>>> Daivish.
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Anders Hammar
In reply to this post by Eric Kolotyluk
You should NOT declare repositories (or plugin repositories) in a
corporate pom. That should be handled in settings.xml.

/Anders

On Wed, Mar 14, 2012 at 22:22, Eric Kolotyluk <[hidden email]> wrote:

> What I do is have a top-level POM like (see below), and then I have my top
> level project POMs reference that (see further below). This may not be the
> best example, as I am still in the process of building the infrastructure,
> but
>
> 1. I put the Parent POM in its own place in source control and I
>   manually deploy it with Maven when I make changes.
> 2. You need to do this before creating any Project POMs that reference
>   it because they should reference it via Maven and not the file
>   system - if you work in a large company you will soon discover why.
> 3. There is of course a bootstrapping issue because now the project
>   POMs need to know how to find your Repository Manager, which is why
>   I include that information in the top level (Corporate) POM so
>   people can use it as a reference.
> 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
> 5. We are still developing our corporate repository infrastructure so
>   the content of the Corporate POM will evolve over time as our
>   corporate governance and policies are better codified.
>
> Does that help?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <!--
>       Copyright © My Company 2012
>
>       Proprietary & Confidential
>
>       This is the top level POM for My Company Maven projects. It contains
> rules and standards common to all projects.
>
>       Changes:
>
>       2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>         Created initial version for check-in into source control.
>
>       2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>         Reconfigured for Nexus 2.0 on sonatype.
>   -->
> <modelVersion>4.0.0</modelVersion>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Corporate POM</name>
> <description>Corporate Project Object Module for standard conventions and
> rules.</description>
> <developers>
> <developer>
> <id>10069959</id>
> <name>Eric Kolotyluk</name>
> <email>[hidden email]</email>
> <organization>My Company Ltd.</organization>
> <timezone>Vancouver PDT</timezone>
> <roles>
> <role>Software Architect</role>
> <role>Software Developer</role>
> </roles>
> </developer>
> </developers>
> <organization>
> <name>My Company</name>
> </organization>
> <distributionManagement>
> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> </project>
>
> - - - - - - -
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>com</groupId>
> <artifactId>my-company</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> </parent>
> <groupId>com.my-company</groupId>
> <artifactId>intersystem</artifactId>
> <version>0.0.2-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>My Company Intersystem</name>
> <description>Service layer for collaborative, distributed applications and
> services</description>
> <licenses>
> <license>
> <name>My Company Intersystem</name>
> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
> <distribution>repo</distribution>
> </license>
> </licenses>
> <developers>
> <developer>
> <id>10069959</id>
> <name>Eric Kolotyluk</name>
> <email>[hidden email]</email>
> <organization>My Company</organization>
> <timezone>Vancouver PDT</timezone>
> <roles>
> <role>Software Architect</role>
> <role>Software Developer</role>
> <role>Intersystem Architect</role>
> </roles>
> </developer>
> </developers>
> <organization>
> <name>My Company</name>
> </organization>
> <distributionManagement>
> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
> <repository>
> <uniqueVersion>false</uniqueVersion>
> <id>nexus</id>
> <name>My Company Release Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
> <layout>default</layout>
> </repository>
> <snapshotRepository>
> <id>nexus</id>
> <name>My Company Snapshot Repository</name>
> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
> <layout>default</layout>
> </snapshotRepository>
> </distributionManagement>
> <build>
> </build>
> <repositories>
> <repository>
> <releases>
> <updatePolicy>always</updatePolicy>
> </releases>
> <id>info.collide.mvn</id>
> <name>Collide</name>
> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
> </repository>
> <repository>
> <id>thirdparty</id>
> <name>3rd party</name>
> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
> </repository>
> </repositories>
> <dependencies>
> </dependencies>
> <reporting>
> <plugins>
> </plugins>
> </reporting>
> <dependencyManagement>
> </dependencyManagement>
> <properties>
> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> <modules>
> <module>platform.Java</module>
> <module>platform.NET</module>
> </modules>
> </project>
>
>
> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>
>> Hi Maven Team,
>>
>> I am trying to find out what is the best way to define company specific
>> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>
>> Can some one provide me guideline on that ? Is that going to be profile or
>> just simple POM.XML ? And how to inherit that. Please provide me guideline
>> to implement it. As this is very critical before we implement all projects
>> with MAVEN.
>>
>> Thanks,
>> Daivish.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Mark Derricutt
I'm almost tempted to write an enforcer plugin to block repository
declarations from ANY pom.  Corporate or project....

On Thu Mar 15 22:09:24 2012, Anders Hammar wrote:
> You should NOT declare repositories (or plugin repositories) in a
> corporate pom. That should be handled in settings.xml.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Anders Hammar
I have that in my Nexus staging rules... So that novice Maven users
get hit late in the process. :-)

/Anders

On Thu, Mar 15, 2012 at 11:04, Mark Derricutt <[hidden email]> wrote:

> I'm almost tempted to write an enforcer plugin to block repository
> declarations from ANY pom.  Corporate or project....
>
> On Thu Mar 15 22:09:24 2012, Anders Hammar wrote:
>>
>> You should NOT declare repositories (or plugin repositories) in a
>> corporate pom. That should be handled in settings.xml.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Jörg Schaible-3
In reply to this post by Eric Kolotyluk
Eric Kolotyluk wrote:

> What I do is have a top-level POM like (see below), and then I have my
> top level project POMs reference that (see further below). This may not
> be the best example, as I am still in the process of building the
> infrastructure, but
>
>  1. I put the Parent POM in its own place in source control and I
>     manually deploy it with Maven when I make changes.
>  2. You need to do this before creating any Project POMs that reference
>     it because they should reference it via Maven and not the file
>     system - if you work in a large company you will soon discover why.
>  3. There is of course a bootstrapping issue because now the project
>     POMs need to know how to find your Repository Manager, which is why
>     I include that information in the top level (Corporate) POM so
>     people can use it as a reference.
>  4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>  5. We are still developing our corporate repository infrastructure so
>     the content of the Corporate POM will evolve over time as our
>     corporate governance and policies are better codified.
>
> Does that help?

[snip]

> <modules>
> <module>platform.Java</module>
> <module>platform.NET</module>
> </modules>

[snip]

It's a bad idea to declare modules in a global (resp. corporate POM). Such a
POM should be a project on its own with no submodules. Or do you think the
Apache parent POM references all projects at Apache that use Maven directly
(or indirectly)?

A project POM may now refer the global parent either using a specific
version (to pin down a specific set of versions and dependencies) or a
SNAPSHOT to use the latest entries/updates of the global POM.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Joao Silva
In reply to this post by Anders Hammar
Hi Anders

Can you provide some arguments to this statement?
We currently recommend all our projects tech leads to add to their top
level project pom.xml the repositories they use (each individual project
tree usually has 3 repositories: releases, snapshots and 3rdparty).
Since the projects are worked internally only, this eases new developers
and developer rotation in projects.
Our recommendation derives mainly from this blog post from the Sonatype
blog:
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
If there are aspects of this approach that we are not aware of, it would
be great to see them discussed.

Thanks for your time!
Best regards
Joao Silva

On 3/15/2012 9:09 AM, Anders Hammar wrote:

> You should NOT declare repositories (or plugin repositories) in a
> corporate pom. That should be handled in settings.xml.
>
> /Anders
>
> On Wed, Mar 14, 2012 at 22:22, Eric Kolotyluk<[hidden email]>  wrote:
>> What I do is have a top-level POM like (see below), and then I have my top
>> level project POMs reference that (see further below). This may not be the
>> best example, as I am still in the process of building the infrastructure,
>> but
>>
>> 1. I put the Parent POM in its own place in source control and I
>>    manually deploy it with Maven when I make changes.
>> 2. You need to do this before creating any Project POMs that reference
>>    it because they should reference it via Maven and not the file
>>    system - if you work in a large company you will soon discover why.
>> 3. There is of course a bootstrapping issue because now the project
>>    POMs need to know how to find your Repository Manager, which is why
>>    I include that information in the top level (Corporate) POM so
>>    people can use it as a reference.
>> 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>> 5. We are still developing our corporate repository infrastructure so
>>    the content of the Corporate POM will evolve over time as our
>>    corporate governance and policies are better codified.
>>
>> Does that help?
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <!--
>>        Copyright © My Company 2012
>>
>>        Proprietary&  Confidential
>>
>>        This is the top level POM for My Company Maven projects. It contains
>> rules and standards common to all projects.
>>
>>        Changes:
>>
>>        2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>>          Created initial version for check-in into source control.
>>
>>        2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>>          Reconfigured for Nexus 2.0 on sonatype.
>>    -->
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>com</groupId>
>> <artifactId>my-company</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> <packaging>pom</packaging>
>> <name>My Company Corporate POM</name>
>> <description>Corporate Project Object Module for standard conventions and
>> rules.</description>
>> <developers>
>> <developer>
>> <id>10069959</id>
>> <name>Eric Kolotyluk</name>
>> <email>[hidden email]</email>
>> <organization>My Company Ltd.</organization>
>> <timezone>Vancouver PDT</timezone>
>> <roles>
>> <role>Software Architect</role>
>> <role>Software Developer</role>
>> </roles>
>> </developer>
>> </developers>
>> <organization>
>> <name>My Company</name>
>> </organization>
>> <distributionManagement>
>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>> <repository>
>> <uniqueVersion>false</uniqueVersion>
>> <id>nexus</id>
>> <name>My Company Release Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>> <layout>default</layout>
>> </repository>
>> <snapshotRepository>
>> <id>nexus</id>
>> <name>My Company Snapshot Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>> <layout>default</layout>
>> </snapshotRepository>
>> </distributionManagement>
>> <build>
>> </build>
>> <repositories>
>> <repository>
>> <releases>
>> <updatePolicy>always</updatePolicy>
>> </releases>
>> <id>info.collide.mvn</id>
>> <name>Collide</name>
>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>> </repository>
>> <repository>
>> <id>thirdparty</id>
>> <name>3rd party</name>
>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>> </repository>
>> </repositories>
>> <dependencies>
>> </dependencies>
>> <reporting>
>> <plugins>
>> </plugins>
>> </reporting>
>> <dependencyManagement>
>> </dependencyManagement>
>> <properties>
>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> </properties>
>> </project>
>>
>> - - - - - - -
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <modelVersion>4.0.0</modelVersion>
>> <parent>
>> <groupId>com</groupId>
>> <artifactId>my-company</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> </parent>
>> <groupId>com.my-company</groupId>
>> <artifactId>intersystem</artifactId>
>> <version>0.0.2-SNAPSHOT</version>
>> <packaging>pom</packaging>
>> <name>My Company Intersystem</name>
>> <description>Service layer for collaborative, distributed applications and
>> services</description>
>> <licenses>
>> <license>
>> <name>My Company Intersystem</name>
>> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
>> <distribution>repo</distribution>
>> </license>
>> </licenses>
>> <developers>
>> <developer>
>> <id>10069959</id>
>> <name>Eric Kolotyluk</name>
>> <email>[hidden email]</email>
>> <organization>My Company</organization>
>> <timezone>Vancouver PDT</timezone>
>> <roles>
>> <role>Software Architect</role>
>> <role>Software Developer</role>
>> <role>Intersystem Architect</role>
>> </roles>
>> </developer>
>> </developers>
>> <organization>
>> <name>My Company</name>
>> </organization>
>> <distributionManagement>
>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>> <repository>
>> <uniqueVersion>false</uniqueVersion>
>> <id>nexus</id>
>> <name>My Company Release Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>> <layout>default</layout>
>> </repository>
>> <snapshotRepository>
>> <id>nexus</id>
>> <name>My Company Snapshot Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>> <layout>default</layout>
>> </snapshotRepository>
>> </distributionManagement>
>> <build>
>> </build>
>> <repositories>
>> <repository>
>> <releases>
>> <updatePolicy>always</updatePolicy>
>> </releases>
>> <id>info.collide.mvn</id>
>> <name>Collide</name>
>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>> </repository>
>> <repository>
>> <id>thirdparty</id>
>> <name>3rd party</name>
>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>> </repository>
>> </repositories>
>> <dependencies>
>> </dependencies>
>> <reporting>
>> <plugins>
>> </plugins>
>> </reporting>
>> <dependencyManagement>
>> </dependencyManagement>
>> <properties>
>> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> </properties>
>> <modules>
>> <module>platform.Java</module>
>> <module>platform.NET</module>
>> </modules>
>> </project>
>>
>>
>> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>> Hi Maven Team,
>>>
>>> I am trying to find out what is the best way to define company specific
>>> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>>
>>> Can some one provide me guideline on that ? Is that going to be profile or
>>> just simple POM.XML ? And how to inherit that. Please provide me guideline
>>> to implement it. As this is very critical before we implement all projects
>>> with MAVEN.
>>>
>>> Thanks,
>>> Daivish.
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Mirko Friedenhagen-2
In reply to this post by Mark Derricutt
We have a rule for this :-).

Regards Mirko

On Thu, Mar 15, 2012 at 11:04, Mark Derricutt <[hidden email]> wrote:

> I'm almost tempted to write an enforcer plugin to block repository
> declarations from ANY pom.  Corporate or project....
>
>
> On Thu Mar 15 22:09:24 2012, Anders Hammar wrote:
>>
>> You should NOT declare repositories (or plugin repositories) in a
>> corporate pom. That should be handled in settings.xml.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Anders Hammar
In reply to this post by Joao Silva
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/

/Anders

On Thu, Mar 15, 2012 at 11:51, Joao Silva <[hidden email]> wrote:

> Hi Anders
>
> Can you provide some arguments to this statement?
> We currently recommend all our projects tech leads to add to their top level
> project pom.xml the repositories they use (each individual project tree
> usually has 3 repositories: releases, snapshots and 3rdparty).
> Since the projects are worked internally only, this eases new developers and
> developer rotation in projects.
> Our recommendation derives mainly from this blog post from the Sonatype
> blog:
> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
> If there are aspects of this approach that we are not aware of, it would be
> great to see them discussed.
>
> Thanks for your time!
> Best regards
> Joao Silva
>
> On 3/15/2012 9:09 AM, Anders Hammar wrote:
>>
>> You should NOT declare repositories (or plugin repositories) in a
>> corporate pom. That should be handled in settings.xml.
>>
>> /Anders
>>
>> On Wed, Mar 14, 2012 at 22:22, Eric Kolotyluk<[hidden email]>
>>  wrote:
>>>
>>> What I do is have a top-level POM like (see below), and then I have my
>>> top
>>> level project POMs reference that (see further below). This may not be
>>> the
>>> best example, as I am still in the process of building the
>>> infrastructure,
>>> but
>>>
>>> 1. I put the Parent POM in its own place in source control and I
>>>   manually deploy it with Maven when I make changes.
>>> 2. You need to do this before creating any Project POMs that reference
>>>   it because they should reference it via Maven and not the file
>>>   system - if you work in a large company you will soon discover why.
>>> 3. There is of course a bootstrapping issue because now the project
>>>   POMs need to know how to find your Repository Manager, which is why
>>>   I include that information in the top level (Corporate) POM so
>>>   people can use it as a reference.
>>> 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>>> 5. We are still developing our corporate repository infrastructure so
>>>   the content of the Corporate POM will evolve over time as our
>>>   corporate governance and policies are better codified.
>>>
>>> Does that help?
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>> <!--
>>>       Copyright Š My Company 2012
>>>
>>>       Proprietary&  Confidential
>>>
>>>       This is the top level POM for My Company Maven projects. It
>>> contains
>>> rules and standards common to all projects.
>>>
>>>       Changes:
>>>
>>>       2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>>>         Created initial version for check-in into source control.
>>>
>>>       2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>>>         Reconfigured for Nexus 2.0 on sonatype.
>>>   -->
>>> <modelVersion>4.0.0</modelVersion>
>>> <groupId>com</groupId>
>>> <artifactId>my-company</artifactId>
>>> <version>0.0.1-SNAPSHOT</version>
>>> <packaging>pom</packaging>
>>> <name>My Company Corporate POM</name>
>>> <description>Corporate Project Object Module for standard conventions and
>>> rules.</description>
>>> <developers>
>>> <developer>
>>> <id>10069959</id>
>>> <name>Eric Kolotyluk</name>
>>> <email>[hidden email]</email>
>>> <organization>My Company Ltd.</organization>
>>> <timezone>Vancouver PDT</timezone>
>>> <roles>
>>> <role>Software Architect</role>
>>> <role>Software Developer</role>
>>> </roles>
>>> </developer>
>>> </developers>
>>> <organization>
>>> <name>My Company</name>
>>> </organization>
>>> <distributionManagement>
>>>
>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>>> <repository>
>>> <uniqueVersion>false</uniqueVersion>
>>> <id>nexus</id>
>>> <name>My Company Release Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>> <layout>default</layout>
>>> </repository>
>>> <snapshotRepository>
>>> <id>nexus</id>
>>> <name>My Company Snapshot Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>> <layout>default</layout>
>>> </snapshotRepository>
>>> </distributionManagement>
>>> <build>
>>> </build>
>>> <repositories>
>>> <repository>
>>> <releases>
>>> <updatePolicy>always</updatePolicy>
>>> </releases>
>>> <id>info.collide.mvn</id>
>>> <name>Collide</name>
>>>
>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>>> </repository>
>>> <repository>
>>> <id>thirdparty</id>
>>> <name>3rd party</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>> </repository>
>>> </repositories>
>>> <dependencies>
>>> </dependencies>
>>> <reporting>
>>> <plugins>
>>> </plugins>
>>> </reporting>
>>> <dependencyManagement>
>>> </dependencyManagement>
>>> <properties>
>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>> </properties>
>>> </project>
>>>
>>> - - - - - - -
>>>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>> <modelVersion>4.0.0</modelVersion>
>>> <parent>
>>> <groupId>com</groupId>
>>> <artifactId>my-company</artifactId>
>>> <version>0.0.1-SNAPSHOT</version>
>>> </parent>
>>> <groupId>com.my-company</groupId>
>>> <artifactId>intersystem</artifactId>
>>> <version>0.0.2-SNAPSHOT</version>
>>> <packaging>pom</packaging>
>>> <name>My Company Intersystem</name>
>>> <description>Service layer for collaborative, distributed applications
>>> and
>>> services</description>
>>> <licenses>
>>> <license>
>>> <name>My Company Intersystem</name>
>>>
>>> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
>>> <distribution>repo</distribution>
>>> </license>
>>> </licenses>
>>> <developers>
>>> <developer>
>>> <id>10069959</id>
>>> <name>Eric Kolotyluk</name>
>>> <email>[hidden email]</email>
>>> <organization>My Company</organization>
>>> <timezone>Vancouver PDT</timezone>
>>> <roles>
>>> <role>Software Architect</role>
>>> <role>Software Developer</role>
>>> <role>Intersystem Architect</role>
>>> </roles>
>>> </developer>
>>> </developers>
>>> <organization>
>>> <name>My Company</name>
>>> </organization>
>>> <distributionManagement>
>>>
>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>>> <repository>
>>> <uniqueVersion>false</uniqueVersion>
>>> <id>nexus</id>
>>> <name>My Company Release Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>> <layout>default</layout>
>>> </repository>
>>> <snapshotRepository>
>>> <id>nexus</id>
>>> <name>My Company Snapshot Repository</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>> <layout>default</layout>
>>> </snapshotRepository>
>>> </distributionManagement>
>>> <build>
>>> </build>
>>> <repositories>
>>> <repository>
>>> <releases>
>>> <updatePolicy>always</updatePolicy>
>>> </releases>
>>> <id>info.collide.mvn</id>
>>> <name>Collide</name>
>>>
>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>>> </repository>
>>> <repository>
>>> <id>thirdparty</id>
>>> <name>3rd party</name>
>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>> </repository>
>>> </repositories>
>>> <dependencies>
>>> </dependencies>
>>> <reporting>
>>> <plugins>
>>> </plugins>
>>> </reporting>
>>> <dependencyManagement>
>>> </dependencyManagement>
>>> <properties>
>>> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>> </properties>
>>> <modules>
>>> <module>platform.Java</module>
>>> <module>platform.NET</module>
>>> </modules>
>>> </project>
>>>
>>>
>>> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>>>
>>>> Hi Maven Team,
>>>>
>>>> I am trying to find out what is the best way to define company specific
>>>> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>>>
>>>> Can some one provide me guideline on that ? Is that going to be profile
>>>> or
>>>> just simple POM.XML ? And how to inherit that. Please provide me
>>>> guideline
>>>> to implement it. As this is very critical before we implement all
>>>> projects
>>>> with MAVEN.
>>>>
>>>> Thanks,
>>>> Daivish.
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Joao Silva
Hi Anders

Thanks, but I already mentioned that blog post in my email.
Do you have something to add to that post?
Because in my opinion, that post does not offer clear cut conclusions
regarding the inclusion of repositories in pom.xml files:
>
> /Should I put the urls to my repositories in my poms or in my settings?/
>
> The short answer is: /settings/.
>
> The long answer is: /it depends/.
>
For the enterprise scenarios, it may be reasonable to put them in
pom.xml files...

Thanks and best regards
Joao Silva


On 3/15/2012 11:45 AM, Anders Hammar wrote:

> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
>
> /Anders
>
> On Thu, Mar 15, 2012 at 11:51, Joao Silva<[hidden email]>  wrote:
>> Hi Anders
>>
>> Can you provide some arguments to this statement?
>> We currently recommend all our projects tech leads to add to their top level
>> project pom.xml the repositories they use (each individual project tree
>> usually has 3 repositories: releases, snapshots and 3rdparty).
>> Since the projects are worked internally only, this eases new developers and
>> developer rotation in projects.
>> Our recommendation derives mainly from this blog post from the Sonatype
>> blog:
>> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
>> If there are aspects of this approach that we are not aware of, it would be
>> great to see them discussed.
>>
>> Thanks for your time!
>> Best regards
>> Joao Silva
>>
>> On 3/15/2012 9:09 AM, Anders Hammar wrote:
>>> You should NOT declare repositories (or plugin repositories) in a
>>> corporate pom. That should be handled in settings.xml.
>>>
>>> /Anders
>>>
>>> On Wed, Mar 14, 2012 at 22:22, Eric Kolotyluk<[hidden email]>
>>>   wrote:
>>>> What I do is have a top-level POM like (see below), and then I have my
>>>> top
>>>> level project POMs reference that (see further below). This may not be
>>>> the
>>>> best example, as I am still in the process of building the
>>>> infrastructure,
>>>> but
>>>>
>>>> 1. I put the Parent POM in its own place in source control and I
>>>>    manually deploy it with Maven when I make changes.
>>>> 2. You need to do this before creating any Project POMs that reference
>>>>    it because they should reference it via Maven and not the file
>>>>    system - if you work in a large company you will soon discover why.
>>>> 3. There is of course a bootstrapping issue because now the project
>>>>    POMs need to know how to find your Repository Manager, which is why
>>>>    I include that information in the top level (Corporate) POM so
>>>>    people can use it as a reference.
>>>> 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>>>> 5. We are still developing our corporate repository infrastructure so
>>>>    the content of the Corporate POM will evolve over time as our
>>>>    corporate governance and policies are better codified.
>>>>
>>>> Does that help?
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>>> <!--
>>>>        Copyright Š My Company 2012
>>>>
>>>>        Proprietary&    Confidential
>>>>
>>>>        This is the top level POM for My Company Maven projects. It
>>>> contains
>>>> rules and standards common to all projects.
>>>>
>>>>        Changes:
>>>>
>>>>        2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>>>>          Created initial version for check-in into source control.
>>>>
>>>>        2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>>>>          Reconfigured for Nexus 2.0 on sonatype.
>>>>    -->
>>>> <modelVersion>4.0.0</modelVersion>
>>>> <groupId>com</groupId>
>>>> <artifactId>my-company</artifactId>
>>>> <version>0.0.1-SNAPSHOT</version>
>>>> <packaging>pom</packaging>
>>>> <name>My Company Corporate POM</name>
>>>> <description>Corporate Project Object Module for standard conventions and
>>>> rules.</description>
>>>> <developers>
>>>> <developer>
>>>> <id>10069959</id>
>>>> <name>Eric Kolotyluk</name>
>>>> <email>[hidden email]</email>
>>>> <organization>My Company Ltd.</organization>
>>>> <timezone>Vancouver PDT</timezone>
>>>> <roles>
>>>> <role>Software Architect</role>
>>>> <role>Software Developer</role>
>>>> </roles>
>>>> </developer>
>>>> </developers>
>>>> <organization>
>>>> <name>My Company</name>
>>>> </organization>
>>>> <distributionManagement>
>>>>
>>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>>>> <repository>
>>>> <uniqueVersion>false</uniqueVersion>
>>>> <id>nexus</id>
>>>> <name>My Company Release Repository</name>
>>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>>> <layout>default</layout>
>>>> </repository>
>>>> <snapshotRepository>
>>>> <id>nexus</id>
>>>> <name>My Company Snapshot Repository</name>
>>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>>> <layout>default</layout>
>>>> </snapshotRepository>
>>>> </distributionManagement>
>>>> <build>
>>>> </build>
>>>> <repositories>
>>>> <repository>
>>>> <releases>
>>>> <updatePolicy>always</updatePolicy>
>>>> </releases>
>>>> <id>info.collide.mvn</id>
>>>> <name>Collide</name>
>>>>
>>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>>>> </repository>
>>>> <repository>
>>>> <id>thirdparty</id>
>>>> <name>3rd party</name>
>>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>>> </repository>
>>>> </repositories>
>>>> <dependencies>
>>>> </dependencies>
>>>> <reporting>
>>>> <plugins>
>>>> </plugins>
>>>> </reporting>
>>>> <dependencyManagement>
>>>> </dependencyManagement>
>>>> <properties>
>>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>>> </properties>
>>>> </project>
>>>>
>>>> - - - - - - -
>>>>
>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>>> <modelVersion>4.0.0</modelVersion>
>>>> <parent>
>>>> <groupId>com</groupId>
>>>> <artifactId>my-company</artifactId>
>>>> <version>0.0.1-SNAPSHOT</version>
>>>> </parent>
>>>> <groupId>com.my-company</groupId>
>>>> <artifactId>intersystem</artifactId>
>>>> <version>0.0.2-SNAPSHOT</version>
>>>> <packaging>pom</packaging>
>>>> <name>My Company Intersystem</name>
>>>> <description>Service layer for collaborative, distributed applications
>>>> and
>>>> services</description>
>>>> <licenses>
>>>> <license>
>>>> <name>My Company Intersystem</name>
>>>>
>>>> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
>>>> <distribution>repo</distribution>
>>>> </license>
>>>> </licenses>
>>>> <developers>
>>>> <developer>
>>>> <id>10069959</id>
>>>> <name>Eric Kolotyluk</name>
>>>> <email>[hidden email]</email>
>>>> <organization>My Company</organization>
>>>> <timezone>Vancouver PDT</timezone>
>>>> <roles>
>>>> <role>Software Architect</role>
>>>> <role>Software Developer</role>
>>>> <role>Intersystem Architect</role>
>>>> </roles>
>>>> </developer>
>>>> </developers>
>>>> <organization>
>>>> <name>My Company</name>
>>>> </organization>
>>>> <distributionManagement>
>>>>
>>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>>>> <repository>
>>>> <uniqueVersion>false</uniqueVersion>
>>>> <id>nexus</id>
>>>> <name>My Company Release Repository</name>
>>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>>> <layout>default</layout>
>>>> </repository>
>>>> <snapshotRepository>
>>>> <id>nexus</id>
>>>> <name>My Company Snapshot Repository</name>
>>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>>> <layout>default</layout>
>>>> </snapshotRepository>
>>>> </distributionManagement>
>>>> <build>
>>>> </build>
>>>> <repositories>
>>>> <repository>
>>>> <releases>
>>>> <updatePolicy>always</updatePolicy>
>>>> </releases>
>>>> <id>info.collide.mvn</id>
>>>> <name>Collide</name>
>>>>
>>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>>>> </repository>
>>>> <repository>
>>>> <id>thirdparty</id>
>>>> <name>3rd party</name>
>>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>>> </repository>
>>>> </repositories>
>>>> <dependencies>
>>>> </dependencies>
>>>> <reporting>
>>>> <plugins>
>>>> </plugins>
>>>> </reporting>
>>>> <dependencyManagement>
>>>> </dependencyManagement>
>>>> <properties>
>>>> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
>>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>>> </properties>
>>>> <modules>
>>>> <module>platform.Java</module>
>>>> <module>platform.NET</module>
>>>> </modules>
>>>> </project>
>>>>
>>>>
>>>> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>>>> Hi Maven Team,
>>>>>
>>>>> I am trying to find out what is the best way to define company specific
>>>>> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>>>>
>>>>> Can some one provide me guideline on that ? Is that going to be profile
>>>>> or
>>>>> just simple POM.XML ? And how to inherit that. Please provide me
>>>>> guideline
>>>>> to implement it. As this is very critical before we implement all
>>>>> projects
>>>>> with MAVEN.
>>>>>
>>>>> Thanks,
>>>>> Daivish.
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
*João Silva
* *
VILT Group
* *_http://www.vilt-group.com
_
Rua Ivone Silva, 6 - 7º Esq
1050-124 Lisboa - Portugal

Mobile  +351 926 531 097
Phone   +351 210 34 33 00
Fax       +351 210 34 33 99
Email [hidden email] <mailto:[hidden email]>_*
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

stephenconnolly
On 15 March 2012 12:11, Joao Silva <[hidden email]> wrote:

> Hi Anders
>
> Thanks, but I already mentioned that blog post in my email.
> Do you have something to add to that post?
> Because in my opinion, that post does not offer clear cut conclusions
> regarding the inclusion of repositories in pom.xml files:
>>
>>
>> /Should I put the urls to my repositories in my poms or in my settings?/
>>
>> The short answer is: /settings/.
>>
>> The long answer is: /it depends/.
>>
> For the enterprise scenarios, it may be reasonable to put them in pom.xml
> files...

Nope....

For enterprise scenarios, you use

<mirrorOf>*</mirrorOf>

so that *everything* is pulled from your enterprise repository
manager. Otherwise you are putting your enterprise at risk of a
failure of a 3rd party repository... e.g. what happened when JBoss
shut down their old repositories, what happened when those crazy fools
hosting their own maven repos on google-code svn repos deleted their
projects...

You want *everything* in your enterprise repository manager so that
you have complete control over your destiny

-Stephen

>
> Thanks and best regards
> Joao Silva
>
>
>
> On 3/15/2012 11:45 AM, Anders Hammar wrote:
>>
>>
>> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
>>
>> /Anders
>>
>> On Thu, Mar 15, 2012 at 11:51, Joao Silva<[hidden email]>
>>  wrote:
>>>
>>> Hi Anders
>>>
>>> Can you provide some arguments to this statement?
>>> We currently recommend all our projects tech leads to add to their top
>>> level
>>> project pom.xml the repositories they use (each individual project tree
>>> usually has 3 repositories: releases, snapshots and 3rdparty).
>>> Since the projects are worked internally only, this eases new developers
>>> and
>>> developer rotation in projects.
>>> Our recommendation derives mainly from this blog post from the Sonatype
>>> blog:
>>>
>>> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
>>> If there are aspects of this approach that we are not aware of, it would
>>> be
>>> great to see them discussed.
>>>
>>> Thanks for your time!
>>> Best regards
>>> Joao Silva
>>>
>>> On 3/15/2012 9:09 AM, Anders Hammar wrote:
>>>>
>>>> You should NOT declare repositories (or plugin repositories) in a
>>>> corporate pom. That should be handled in settings.xml.
>>>>
>>>> /Anders
>>>>
>>>> On Wed, Mar 14, 2012 at 22:22, Eric Kolotyluk<[hidden email]>
>>>>  wrote:
>>>>>
>>>>> What I do is have a top-level POM like (see below), and then I have my
>>>>> top
>>>>> level project POMs reference that (see further below). This may not be
>>>>> the
>>>>> best example, as I am still in the process of building the
>>>>> infrastructure,
>>>>> but
>>>>>
>>>>> 1. I put the Parent POM in its own place in source control and I
>>>>>   manually deploy it with Maven when I make changes.
>>>>> 2. You need to do this before creating any Project POMs that reference
>>>>>   it because they should reference it via Maven and not the file
>>>>>   system - if you work in a large company you will soon discover why.
>>>>> 3. There is of course a bootstrapping issue because now the project
>>>>>   POMs need to know how to find your Repository Manager, which is why
>>>>>   I include that information in the top level (Corporate) POM so
>>>>>   people can use it as a reference.
>>>>> 4. As you may gather I am using Sonatype's Nexus as a Repository
>>>>> Manager.
>>>>> 5. We are still developing our corporate repository infrastructure so
>>>>>   the content of the Corporate POM will evolve over time as our
>>>>>   corporate governance and policies are better codified.
>>>>>
>>>>> Does that help?
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>>>> <!--
>>>>>       Copyright Š My Company 2012
>>>>>
>>>>>       Proprietary&    Confidential
>>>>>
>>>>>       This is the top level POM for My Company Maven projects. It
>>>>> contains
>>>>> rules and standards common to all projects.
>>>>>
>>>>>       Changes:
>>>>>
>>>>>       2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>>>>>         Created initial version for check-in into source control.
>>>>>
>>>>>       2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>>>>>         Reconfigured for Nexus 2.0 on sonatype.
>>>>>   -->
>>>>> <modelVersion>4.0.0</modelVersion>
>>>>> <groupId>com</groupId>
>>>>> <artifactId>my-company</artifactId>
>>>>> <version>0.0.1-SNAPSHOT</version>
>>>>> <packaging>pom</packaging>
>>>>> <name>My Company Corporate POM</name>
>>>>> <description>Corporate Project Object Module for standard conventions
>>>>> and
>>>>> rules.</description>
>>>>> <developers>
>>>>> <developer>
>>>>> <id>10069959</id>
>>>>> <name>Eric Kolotyluk</name>
>>>>> <email>[hidden email]</email>
>>>>> <organization>My Company Ltd.</organization>
>>>>> <timezone>Vancouver PDT</timezone>
>>>>> <roles>
>>>>> <role>Software Architect</role>
>>>>> <role>Software Developer</role>
>>>>> </roles>
>>>>> </developer>
>>>>> </developers>
>>>>> <organization>
>>>>> <name>My Company</name>
>>>>> </organization>
>>>>> <distributionManagement>
>>>>>
>>>>>
>>>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>>>>> <repository>
>>>>> <uniqueVersion>false</uniqueVersion>
>>>>> <id>nexus</id>
>>>>> <name>My Company Release Repository</name>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>>>> <layout>default</layout>
>>>>> </repository>
>>>>> <snapshotRepository>
>>>>> <id>nexus</id>
>>>>> <name>My Company Snapshot Repository</name>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>>>> <layout>default</layout>
>>>>> </snapshotRepository>
>>>>> </distributionManagement>
>>>>> <build>
>>>>> </build>
>>>>> <repositories>
>>>>> <repository>
>>>>> <releases>
>>>>> <updatePolicy>always</updatePolicy>
>>>>> </releases>
>>>>> <id>info.collide.mvn</id>
>>>>> <name>Collide</name>
>>>>>
>>>>>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>>>>> </repository>
>>>>> <repository>
>>>>> <id>thirdparty</id>
>>>>> <name>3rd party</name>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>>>> </repository>
>>>>> </repositories>
>>>>> <dependencies>
>>>>> </dependencies>
>>>>> <reporting>
>>>>> <plugins>
>>>>> </plugins>
>>>>> </reporting>
>>>>> <dependencyManagement>
>>>>> </dependencyManagement>
>>>>> <properties>
>>>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>>>> </properties>
>>>>> </project>
>>>>>
>>>>> - - - - - - -
>>>>>
>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>>>> <modelVersion>4.0.0</modelVersion>
>>>>> <parent>
>>>>> <groupId>com</groupId>
>>>>> <artifactId>my-company</artifactId>
>>>>> <version>0.0.1-SNAPSHOT</version>
>>>>> </parent>
>>>>> <groupId>com.my-company</groupId>
>>>>> <artifactId>intersystem</artifactId>
>>>>> <version>0.0.2-SNAPSHOT</version>
>>>>> <packaging>pom</packaging>
>>>>> <name>My Company Intersystem</name>
>>>>> <description>Service layer for collaborative, distributed applications
>>>>> and
>>>>> services</description>
>>>>> <licenses>
>>>>> <license>
>>>>> <name>My Company Intersystem</name>
>>>>>
>>>>>
>>>>> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
>>>>> <distribution>repo</distribution>
>>>>> </license>
>>>>> </licenses>
>>>>> <developers>
>>>>> <developer>
>>>>> <id>10069959</id>
>>>>> <name>Eric Kolotyluk</name>
>>>>> <email>[hidden email]</email>
>>>>> <organization>My Company</organization>
>>>>> <timezone>Vancouver PDT</timezone>
>>>>> <roles>
>>>>> <role>Software Architect</role>
>>>>> <role>Software Developer</role>
>>>>> <role>Intersystem Architect</role>
>>>>> </roles>
>>>>> </developer>
>>>>> </developers>
>>>>> <organization>
>>>>> <name>My Company</name>
>>>>> </organization>
>>>>> <distributionManagement>
>>>>>
>>>>>
>>>>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>>>>> <repository>
>>>>> <uniqueVersion>false</uniqueVersion>
>>>>> <id>nexus</id>
>>>>> <name>My Company Release Repository</name>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>>>>> <layout>default</layout>
>>>>> </repository>
>>>>> <snapshotRepository>
>>>>> <id>nexus</id>
>>>>> <name>My Company Snapshot Repository</name>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>>>>> <layout>default</layout>
>>>>> </snapshotRepository>
>>>>> </distributionManagement>
>>>>> <build>
>>>>> </build>
>>>>> <repositories>
>>>>> <repository>
>>>>> <releases>
>>>>> <updatePolicy>always</updatePolicy>
>>>>> </releases>
>>>>> <id>info.collide.mvn</id>
>>>>> <name>Collide</name>
>>>>>
>>>>>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>>>>> </repository>
>>>>> <repository>
>>>>> <id>thirdparty</id>
>>>>> <name>3rd party</name>
>>>>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>>>>> </repository>
>>>>> </repositories>
>>>>> <dependencies>
>>>>> </dependencies>
>>>>> <reporting>
>>>>> <plugins>
>>>>> </plugins>
>>>>> </reporting>
>>>>> <dependencyManagement>
>>>>> </dependencyManagement>
>>>>> <properties>
>>>>> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
>>>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>>>> </properties>
>>>>> <modules>
>>>>> <module>platform.Java</module>
>>>>> <module>platform.NET</module>
>>>>> </modules>
>>>>> </project>
>>>>>
>>>>>
>>>>> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>>>>>
>>>>>> Hi Maven Team,
>>>>>>
>>>>>> I am trying to find out what is the best way to define company
>>>>>> specific
>>>>>> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>>>>>
>>>>>> Can some one provide me guideline on that ? Is that going to be
>>>>>> profile
>>>>>> or
>>>>>> just simple POM.XML ? And how to inherit that. Please provide me
>>>>>> guideline
>>>>>> to implement it. As this is very critical before we implement all
>>>>>> projects
>>>>>> with MAVEN.
>>>>>>
>>>>>> Thanks,
>>>>>> Daivish.
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> --
> *João Silva
> * *
> VILT Group
> * *_http://www.vilt-group.com
> _
> Rua Ivone Silva, 6 - 7º Esq
> 1050-124 Lisboa - Portugal
>
> Mobile  +351 926 531 097
> Phone   +351 210 34 33 00
> Fax       +351 210 34 33 99
> Email [hidden email] <mailto:[hidden email]>_*

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Eric Kolotyluk
In reply to this post by Jörg Schaible-3


On 2012-03-15 3:35 AM, Jörg Schaible wrote:

> Eric Kolotyluk wrote:
>
>> What I do is have a top-level POM like (see below), and then I have my
>> top level project POMs reference that (see further below). This may not
>> be the best example, as I am still in the process of building the
>> infrastructure, but
>>
>>   1. I put the Parent POM in its own place in source control and I
>>      manually deploy it with Maven when I make changes.
>>   2. You need to do this before creating any Project POMs that reference
>>      it because they should reference it via Maven and not the file
>>      system - if you work in a large company you will soon discover why.
>>   3. There is of course a bootstrapping issue because now the project
>>      POMs need to know how to find your Repository Manager, which is why
>>      I include that information in the top level (Corporate) POM so
>>      people can use it as a reference.
>>   4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>>   5. We are still developing our corporate repository infrastructure so
>>      the content of the Corporate POM will evolve over time as our
>>      corporate governance and policies are better codified.
>>
>> Does that help?
> [snip]
>
>> <modules>
>> <module>platform.Java</module>
>> <module>platform.NET</module>
>> </modules>
> [snip]
>
> It's a bad idea to declare modules in a global (resp. corporate POM). Such a
> POM should be a project on its own with no submodules. Or do you think the
> Apache parent POM references all projects at Apache that use Maven directly
> (or indirectly)?

FYI - those modules were not declared in the top level Corporate POM,
they were declare in the Project  POM. The example Corporate POM had no
modules. In the original response I gave the Corporate and Project POMs
were separated by a - - - - - - - - - - line. While Jörg makes a good
point, the point did not pertain to my examples.

>
> A project POM may now refer the global parent either using a specific
> version (to pin down a specific set of versions and dependencies) or a
> SNAPSHOT to use the latest entries/updates of the global POM.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Which is the BEST Approach to define Global POM.XML

Eric Kolotyluk
In reply to this post by Anders Hammar
OK, thanks for the tip Anders - that helps clean things up a bit :-)

What about the <distributionManagement> - should that go in the
Corporate POM, or in the Project POM?

Presumably I would want to override <distributionManagement> in a
Project POM because my <snapshotRepository> might be on a different
Repository Manager that is co-located where my SCM and build servers
were - in a company with disperse development sites. The

Below are my update examples - how do they look now?

Cheers, Eric

- - - - - - - Project POM - - - - - - -

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
       Copyright © My Company 2012

       Proprietary&  Confidential

       This is the top level POM for My Company Maven projects. It contains rules and standards common to all projects.

       Changes:

       2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
         Created initial version for check-in into source control.

       2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
         Reconfigured for Nexus 2.0 on sonatype.
   -->
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>my-company</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Company Corporate POM</name>
<description>Corporate Project Object Module for standard conventions and
rules.</description>
<developers>
<developer>
<id>10069959</id>
<name>Eric Kolotyluk</name>
<email>[hidden email]</email>
<organization>My Company Ltd.</organization>
<timezone>Vancouver PDT</timezone>
<roles>
<role>Software Architect</role>
<role>Software Developer</role>
</roles>
</developer>
</developers>
<organization>
<name>My Company</name>
</organization>
<distributionManagement>
<downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>nexus</id>
<name>My Company Release Repository</name>
<url>http://sonatype:8081/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>My Company Snapshot Repository</name>
<url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<build>
</build>
<dependencies>
</dependencies>
<reporting>
<plugins>
</plugins>
</reporting>
<dependencyManagement>
</dependencyManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

- - - - - - - Project POM - - - - - - -

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com</groupId>
<artifactId>my-company</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.my-company</groupId>
<artifactId>intersystem</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Company Intersystem</name>
<description>Service layer for collaborative, distributed applications and
services</description>
<licenses>
<license>
<name>My Company Intersystem</name>
<url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>10069959</id>
<name>Eric Kolotyluk</name>
<email>[hidden email]</email>
<organization>My Company</organization>
<timezone>Vancouver PDT</timezone>
<roles>
<role>Software Architect</role>
<role>Software Developer</role>
<role>Intersystem Architect</role>
</roles>
</developer>
</developers>
<organization>
<name>My Company</name>
</organization>
<build>
</build>
<dependencies>
</dependencies>
<reporting>
<plugins>
</plugins>
</reporting>
<dependencyManagement>
</dependencyManagement>
<properties>
<net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>platform.Java</module>
<module>platform.NET</module>
</modules>
</project>





On 2012-03-15 2:09 AM, Anders Hammar wrote:

> You should NOT declare repositories (or plugin repositories) in a
> corporate pom. That should be handled in settings.xml.
>
> /Anders
>
> On Wed, Mar 14, 2012 at 22:22, Eric Kolotyluk<[hidden email]>  wrote:
>> What I do is have a top-level POM like (see below), and then I have my top
>> level project POMs reference that (see further below). This may not be the
>> best example, as I am still in the process of building the infrastructure,
>> but
>>
>> 1. I put the Parent POM in its own place in source control and I
>>    manually deploy it with Maven when I make changes.
>> 2. You need to do this before creating any Project POMs that reference
>>    it because they should reference it via Maven and not the file
>>    system - if you work in a large company you will soon discover why.
>> 3. There is of course a bootstrapping issue because now the project
>>    POMs need to know how to find your Repository Manager, which is why
>>    I include that information in the top level (Corporate) POM so
>>    people can use it as a reference.
>> 4. As you may gather I am using Sonatype's Nexus as a Repository Manager.
>> 5. We are still developing our corporate repository infrastructure so
>>    the content of the Corporate POM will evolve over time as our
>>    corporate governance and policies are better codified.
>>
>> Does that help?
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <!--
>>        Copyright © My Company 2012
>>
>>        Proprietary&  Confidential
>>
>>        This is the top level POM for My Company Maven projects. It contains
>> rules and standards common to all projects.
>>
>>        Changes:
>>
>>        2011-09-23 0.0.1-SNAPSHOT Eric Kolotyluk
>>          Created initial version for check-in into source control.
>>
>>        2012-02-27 0.0.1-SNAPSHOT Eric Kolotyluk
>>          Reconfigured for Nexus 2.0 on sonatype.
>>    -->
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>com</groupId>
>> <artifactId>my-company</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> <packaging>pom</packaging>
>> <name>My Company Corporate POM</name>
>> <description>Corporate Project Object Module for standard conventions and
>> rules.</description>
>> <developers>
>> <developer>
>> <id>10069959</id>
>> <name>Eric Kolotyluk</name>
>> <email>[hidden email]</email>
>> <organization>My Company Ltd.</organization>
>> <timezone>Vancouver PDT</timezone>
>> <roles>
>> <role>Software Architect</role>
>> <role>Software Developer</role>
>> </roles>
>> </developer>
>> </developers>
>> <organization>
>> <name>My Company</name>
>> </organization>
>> <distributionManagement>
>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>> <repository>
>> <uniqueVersion>false</uniqueVersion>
>> <id>nexus</id>
>> <name>My Company Release Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>> <layout>default</layout>
>> </repository>
>> <snapshotRepository>
>> <id>nexus</id>
>> <name>My Company Snapshot Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>> <layout>default</layout>
>> </snapshotRepository>
>> </distributionManagement>
>> <build>
>> </build>
>> <repositories>
>> <repository>
>> <releases>
>> <updatePolicy>always</updatePolicy>
>> </releases>
>> <id>info.collide.mvn</id>
>> <name>Collide</name>
>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>> </repository>
>> <repository>
>> <id>thirdparty</id>
>> <name>3rd party</name>
>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>> </repository>
>> </repositories>
>> <dependencies>
>> </dependencies>
>> <reporting>
>> <plugins>
>> </plugins>
>> </reporting>
>> <dependencyManagement>
>> </dependencyManagement>
>> <properties>
>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> </properties>
>> </project>
>>
>> - - - - - - -
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <modelVersion>4.0.0</modelVersion>
>> <parent>
>> <groupId>com</groupId>
>> <artifactId>my-company</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> </parent>
>> <groupId>com.my-company</groupId>
>> <artifactId>intersystem</artifactId>
>> <version>0.0.2-SNAPSHOT</version>
>> <packaging>pom</packaging>
>> <name>My Company Intersystem</name>
>> <description>Service layer for collaborative, distributed applications and
>> services</description>
>> <licenses>
>> <license>
>> <name>My Company Intersystem</name>
>> <url>https://collaborate.my-company.com/sites/SoftwareStandardsAndGuidelines/Intersystem/default.aspx</url>
>> <distribution>repo</distribution>
>> </license>
>> </licenses>
>> <developers>
>> <developer>
>> <id>10069959</id>
>> <name>Eric Kolotyluk</name>
>> <email>[hidden email]</email>
>> <organization>My Company</organization>
>> <timezone>Vancouver PDT</timezone>
>> <roles>
>> <role>Software Architect</role>
>> <role>Software Developer</role>
>> <role>Intersystem Architect</role>
>> </roles>
>> </developer>
>> </developers>
>> <organization>
>> <name>My Company</name>
>> </organization>
>> <distributionManagement>
>> <downloadUrl>http://sonatype:8081/nexus/content/groups/public</downloadUrl>
>> <repository>
>> <uniqueVersion>false</uniqueVersion>
>> <id>nexus</id>
>> <name>My Company Release Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/releases</url>
>> <layout>default</layout>
>> </repository>
>> <snapshotRepository>
>> <id>nexus</id>
>> <name>My Company Snapshot Repository</name>
>> <url>http://sonatype:8081/nexus/content/repositories/snapshots</url>
>> <layout>default</layout>
>> </snapshotRepository>
>> </distributionManagement>
>> <build>
>> </build>
>> <repositories>
>> <repository>
>> <releases>
>> <updatePolicy>always</updatePolicy>
>> </releases>
>> <id>info.collide.mvn</id>
>> <name>Collide</name>
>> <url>http://sonatype:8081/nexus/content/repositories/info.collide.mvn/</url>
>> </repository>
>> <repository>
>> <id>thirdparty</id>
>> <name>3rd party</name>
>> <url>http://sonatype:8081/nexus/content/repositories/thirdparty/</url>
>> </repository>
>> </repositories>
>> <dependencies>
>> </dependencies>
>> <reporting>
>> <plugins>
>> </plugins>
>> </reporting>
>> <dependencyManagement>
>> </dependencyManagement>
>> <properties>
>> <net.sf.jni4net.version>0.8.6.0</net.sf.jni4net.version>
>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> </properties>
>> <modules>
>> <module>platform.Java</module>
>> <module>platform.NET</module>
>> </modules>
>> </project>
>>
>>
>> On 2012-03-14 1:29 PM, Daivish Shah wrote:
>>> Hi Maven Team,
>>>
>>> I am trying to find out what is the best way to define company specific
>>> GLOBAL POM.XML. Which each team can inherit it in EACH Projects.
>>>
>>> Can some one provide me guideline on that ? Is that going to be profile or
>>> just simple POM.XML ? And how to inherit that. Please provide me guideline
>>> to implement it. As this is very critical before we implement all projects
>>> with MAVEN.
>>>
>>> Thanks,
>>> Daivish.
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12
Loading...