Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Maven"

(Proposal)
m
Line 1: Line 1:
 
A prototype of Maven repository support at Eclipse is undergoing creation.
 
A prototype of Maven repository support at Eclipse is undergoing creation.
  
The site currently runs Nexus and is available at http://maven.eclipse.org
+
The site currently runs Nexus and is available at http://maven.eclipse.org/nexus/
  
 
= Proposal =
 
= Proposal =

Revision as of 10:37, 20 March 2011

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

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

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
  • /release - for aggregating
    • /release/ganymede - for storing final releases, e.g. Ganymede 3.5, 3.5.1, 3.5.2
    • /release/helios - for storing final releases, e.g. Helios 3.6, 3.6.1, 3.6.2
  • /milestone - for aggregating
    • /milestone/j... - for storing milestone releases (for Helios+1) e.g. 3.7M1, 3.7M2
  • /integration - for aggregating
    • /integration/j... - for storing -SNAPSHOT equivalents of integration (I) builds; to be purged frequently (weekly?)
  • /nightly - for aggregating
    • /nightly/j... - for storing -SNAPSHOT equivalents of nightly (N) builds; to be purged frequently (nightly?)

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.

In addition, for testing:

  • /testing - for storing -SNAPSHOT equivalents for testing purposes; to be purged occasionally (monthly?)

To support automated builds at Eclipse, it may make sense to proxy publicly available repositories, although these should not be publicly available.

To make it easy to consume these for plugins, it may make sense to have a general name which aggregates all for these (e.g. /build)?

GAVs

For any JAR, org.eclipse.a.b.c, the groupId will be org.eclipse.a and the artifactId will be org.eclipse.a.b.c.

Versions will only use the major.minor.micro format. Build/quantifiers will be dropped. For releases and milestones, these should only be published after the official components have been created and so build IDs will not be an issue. For nightly/snapshot releases, the designator -SNAPSHOT will be used.

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/build</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.

Open issues

Related Bugs

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

Back to the top