maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Kolotyluk <eric.koloty...@gmail.com>
Subject Re: Which is the BEST Approach to define Global POM.XML
Date Thu, 15 Mar 2012 13:20:33 GMT
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>eric.kolotyluk@gmail.com</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>eric.kolotyluk@gmail.com</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<eric.kolotyluk@gmail.com>  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>eric.kolotyluk@gmail.com</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>eric.kolotyluk@gmail.com</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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Mime
View raw message