Skip to main content
Jump to: navigation, search

Maven

Revision as of 18:46, 18 March 2011 by Alex.blewitt.gmail.com (Talk | contribs) (Added related bugs)

A prototype of Maven repository support at Eclipse is undergoing creation.

The site currently runs Nexus and is available at http://maven.eclipse.org

Proposal

Nexus is capable of segregating and aggregating individual repositories. To facilitate the management of artefacts hosted, it is proposed that the Nexus repository is configured with a number of subsidiary repositories which will hold different content, as follows:

  • /orbit - for holding Orbit approved external dependencies
  • /central - for aggregating:
  • /release - for storing final releases, e.g. Helios 3.6, 3.6.1, 3.6.2
  • /milestone - for storing milestone releases (for the latest build only?) e.g. 3.7M1, 3.7M2
  • /integration - for storing -SNAPSHOT equivalents of integration (I) builds
  • /nightly - for storing -SNAPSHOT equivalents of nightly (N) builds

It is proposed that the release entries are permanently available, whilst milestones may be cleared out after the final release, and nightly and integration builds are cleared out automatically.

Repositories

In order to build against known good sources, the 'repositories' should be configured such that they only consume from /central for acquisition of Maven plugins, and not to satisfy build dependencies. In other words, something like:

  <repositories>
    <repository>
      <id>orbit</id>
      <name>Orbit approved dependency repository</name>
      <layout>maven2</layout>
      <url>http://maven.eclipse.org/orbit</url>
      <snapshots><enabled>false</enabled></snapshot>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <name>Maven central</name>
        <layout>maven2</layout>
        <url>http://maven.eclipse.org/central</url>
        <snapshots><enabled>false</enabled></snapshot>
        <releases><updatePolicy>never</updatePolicy></releases>  
    </pluginRepository>
  </pluginRepositories>

This will enable plugin dependencies (e.g. Tycho) to be resolved whilst not allowing project dependencies to consume other than from the Orbit pre-approved repository.

Profiles

To allow different repositories to be switched between, we could use the profile mechanism in Maven to allow other repositories to be brought in:

  <profiles>
    <profile>
      <id>milestone</id>
      <activation><activeByDefault>false</activeByDefault></activation>
      <repositories>
        <repository>
          <id>milestone</id>
          <name>Milestone releases</name>
          <url>http://maven.eclipse.org/milestone</url>
          <snapshots><enabled>false</enabled></snapshots>
        </repository>
      </repositories>  
    </profile>
    <profile>
      <id>integration</id>
      <activation><activeByDefault>false</activeByDefault></activation>
      <repositories>
        <repository>
          <id>integration</id>
          <name>Integration releases</name>
          <url>http://maven.eclipse.org/integration</url>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>  
    </profile>
    <profile>
      <id>nightly</id>
      <activation><activeByDefault>false</activeByDefault></activation>
      <repositories>
        <repository>
          <id>nightly</id>
          <name>Nightly releases</name>
          <url>http://maven.eclipse.org/nightly</url>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>  
    </profile>
  </profiles>

This will allow compilation against a milestone, integration or nightly branch set of dependencies with e.g. maven -P nightly.

Related Bugs

  • bug 283745 - Provide a Maven repository for stuff built at Eclipse
  • bug 340416 - Resolving dependencies from Orbit

Back to the top