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 "Services/Nexus"

(Eclipse Snapshots Group)
(Hudson Job Setup)
(27 intermediate revisions by 4 users not shown)
Line 8: Line 8:
  
 
* Snapshots older than 30-days are automatically removed on a weekly basis
 
* Snapshots older than 30-days are automatically removed on a weekly basis
 +
 +
 +
=== Getting a Nexus repo for your Project ===
 +
 +
Simply file a [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Nexus Bug] and specify what project you'd like a Nexus repo for.
  
 
== Pulling artifacts from Nexus ==
 
== Pulling artifacts from Nexus ==
Line 14: Line 19:
  
 
=== Releases Group ===
 
=== Releases Group ===
https://repo.eclipse.org/content/groups/releases/
+
https://repo.eclipse.org/content/repositories/releases/
  
 
This URL is a top-level aggregate of all project releases repositories. This URL is recommended if you just want to pull in releases from any project hosting artifacts on repo.eclipse.org
 
This URL is a top-level aggregate of all project releases repositories. This URL is recommended if you just want to pull in releases from any project hosting artifacts on repo.eclipse.org
  
=== Eclipse Snapshots Group ===
+
=== Snapshots Group ===
https://repo.eclipse.org/content/groups/snapshots/
+
https://repo.eclipse.org/content/repositories/snapshots/
  
 
This URL is a top-level aggregate of all project snapshots repositories. This URL is useful for developers who want to pull in artifacts that may have not yet been released usually nightlies.
 
This URL is a top-level aggregate of all project snapshots repositories. This URL is useful for developers who want to pull in artifacts that may have not yet been released usually nightlies.
Line 26: Line 31:
  
 
Finally you can also use a project specific repo if you only want to ensure you are only pulling artifacts from specific projects. To get the URLs for these projects you can navigate to https://repo.eclipse.org/index.html#view-repositories and browse for the URL link for the specific project.
 
Finally you can also use a project specific repo if you only want to ensure you are only pulling artifacts from specific projects. To get the URLs for these projects you can navigate to https://repo.eclipse.org/index.html#view-repositories and browse for the URL link for the specific project.
 +
  
 
== Deploying artifacts to repo.eclipse.org ==
 
== Deploying artifacts to repo.eclipse.org ==
  
To deploy artifacts to repo.eclipse.org using Maven you will need to add a "distributionManagement" section to your project pom. An example below:
+
To deploy artifacts to repo.eclipse.org you will need to use Hudson (http://hudson.eclipse.org) to configure a job for deploying your artifacts.
 +
 
 +
It is recommended that you use '''JDK 7''' or higher as we have seen SSL Handshake issues when using JDK 6.
 +
 
 +
=== Initial Maven POM setup ===
 +
 
 +
Before Hudson can deploy your project's artifacts to Nexus you will need to do some setup on the Maven side to add a [http://maven.apache.org/pom.html#Distribution_Management "distributionManagement"] section to your project pom. An example below:
  
 
<pre>
 
<pre>
Line 48: Line 60:
 
Replace instances of the word "project" with your project's name.
 
Replace instances of the word "project" with your project's name.
  
 +
Note: It is important to ensure your ID's are "repo.eclipse.org" as the Hudson instance is configured to use these IDs.
  
You will also need to add to your ~/.m2/settings.xml a section to configure your credentials. For example:
+
If you want to keep several snapshot versions use:
 +
<pre>
 +
    <snapshotRepository>
 +
      <uniqueVersion>true</uniqueVersion>
 +
      ...
 +
</pre>
 +
 
 +
=== Hudson/Jenkins Job Setup ===
 +
 
 +
Using http://hudson.eclipse.org you will need to configure Maven to run the "deploy" goal.
 +
 
 +
There are 2 ways you might want to do this:
 +
 
 +
# Simply add the "deploy" goal as one of your Maven goals as part of your build
 +
# Create separate jobs, one for building and one for deploying (if you want more control over when to deploy)
 +
 
 +
 
 +
If you decided to go with creating separate jobs, your deploy job will need access to your build job's workspace, an easy way of making this work is to configure the build job, and the deploy job with the optional '''Use custom workspace''' configuration under '''Advanced project options'''.
 +
 
 +
Example:
 +
 
 +
[[Image:custom_workspace.jpg]]
 +
 
 +
Replace '''<your build job project name>''' with the name of your project job, for example if your build job was named '''''cbi-maven-plugins-build''''' and your project '''cbi''', then your Directory should be '''''/jobs/genie.cbi/cbi-maven-plugins-build/workspace/'''''. This setting should be configured in both your Build job and Deploy jobs.
 +
 
 +
 
 +
<del>Finally your deploy job should invoke an instance of Maven 3 with the "deploy" goal. The only additional option you need to ensure that's configured is to click '''Advanced''' and configure the '''Settings''' option and set it to '''Deploy to repo.eclipse.org'''. This custom settings file contains the necessary credentials in order for you to deploy to repo.eclipse.org.</del>
 +
 
 +
[[Image:deploy_settings.jpg]]
 +
 
 +
'''Update 29.03.2017:''' This is not longer necessary when you want to deploy to '''repo.eclipse.org''' or '''repo.locationtech.org'''. The credentials have been merged into the general Maven settings.xml file that all HIPPs/JIPPs are using.
 +
 
 +
'''Please note:''' a special settings.xml file is still necessary when deploying to OSSRH.
 +
 
 +
== Deploying a jar to repo.eclipse.org ==
 +
 
 +
It is possible to use the Maven '''deploy:deploy-file''' goal to push a jar file into repo.eclipse.org via hudson.eclipse.org. For every jar you wish to push into repo.eclipse.org an associating pom.xml file is necessary.
 +
 
 +
The simplest pom.xml can be as follows:
  
 
<pre>
 
<pre>
  <servers>
+
<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">
    <server>
+
  <modelVersion>4.0.0</modelVersion>
      <id>repo.eclipse.org</id>
+
  <groupId>org.eclipse.jdt</groupId>
      <username>your_committer_id</username>
+
  <artifactId>org.eclipse.jdt.core</artifactId>
      <password>your_committer_password</password>
+
  <version>3.9.0.v20130313-2254</version>
    </server>
+
</project>
  </servers>
+
</pre>
 +
 
 +
hudson.eclipse.org has access to the same /shared as build.eclipse.org so placing your files somewhere there will allow hudson to be able to find it.
 +
 
 +
=== Configuring Hudson for mvn deploy:deploy-file ===
 +
 
 +
There are 3 settings which need to be configured:
 +
 
 +
# Goals: deploy:deploy-file
 +
# Properties:
 +
#:<pre>
 +
#::groupId=<groupId>
 +
#::artifactId=<artifactId>
 +
#::version=<version>
 +
#::packaging=jar
 +
#::file=/shared/path/to/file.jar
 +
#::repositoryId=repo.eclipse.org
 +
#::url=<Your project's repo URL to push jar into>
 +
#:</pre>
 +
# POM File: /path/to/pom.xml
 +
 
 +
For example:
 +
[[Image:mvn-deploy-file.png]]
 +
 
 +
 
 +
Note: You will also need to configure your settings file to use '''Deploy to repo.eclipse.org''' per instructions in the previous section for deploying artifacts.
 +
 
 +
== Deploying to repo.eclipse.org with Gradle ==
 +
 
 +
If you are using Gradle in your build job, you can also deploy to '''repo.eclipse.org''' from your HIPP instance as described in the [https://docs.gradle.org/current/userguide/maven_plugin.html#uploading_to_maven_repositories Gradle user guide].
 +
 
 +
Webmaster will need to setup the Gradle plugin in your HIPP and provide '''~/.gradle/gradle.properties''' with the following two variables:
 +
<pre>
 +
eclipseRepoUsername
 +
eclipseRepoPassword
 
</pre>
 
</pre>
  
id: should match the ID for the repository as specified in the project pom file.
+
Please file [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Hudson a bug] against Eclipse Foundation > Community > Hudson for that.
username: should be your eclipse.org committer ID
+
password: should be your eclipse.org committer password
+

Revision as of 09:45, 29 March 2017

Eclipse Nexus Instance

The Eclipse Nexus instance is hosted at: https://repo.eclipse.org

This repository allows Eclipse projects to publish their build artifacts into a centralized repository hosted by EMO.

Notes:

  • Snapshots older than 30-days are automatically removed on a weekly basis


Getting a Nexus repo for your Project

Simply file a Bug and specify what project you'd like a Nexus repo for.

Pulling artifacts from Nexus

To use repo.eclipse.org to pull artifacts for your project there are a few URLs that can be used.

Releases Group

https://repo.eclipse.org/content/repositories/releases/

This URL is a top-level aggregate of all project releases repositories. This URL is recommended if you just want to pull in releases from any project hosting artifacts on repo.eclipse.org

Snapshots Group

https://repo.eclipse.org/content/repositories/snapshots/

This URL is a top-level aggregate of all project snapshots repositories. This URL is useful for developers who want to pull in artifacts that may have not yet been released usually nightlies.

Project Specific Repos

Finally you can also use a project specific repo if you only want to ensure you are only pulling artifacts from specific projects. To get the URLs for these projects you can navigate to https://repo.eclipse.org/index.html#view-repositories and browse for the URL link for the specific project.


Deploying artifacts to repo.eclipse.org

To deploy artifacts to repo.eclipse.org you will need to use Hudson (http://hudson.eclipse.org) to configure a job for deploying your artifacts.

It is recommended that you use JDK 7 or higher as we have seen SSL Handshake issues when using JDK 6.

Initial Maven POM setup

Before Hudson can deploy your project's artifacts to Nexus you will need to do some setup on the Maven side to add a "distributionManagement" section to your project pom. An example below:

  <distributionManagement>
    <repository>
      <id>repo.eclipse.org</id>
      <name>Project Repository - Releases</name>
      <url>https://repo.eclipse.org/content/repositories/project-releases/</url>
    </repository>
    <snapshotRepository>
      <id>repo.eclipse.org</id>
      <name>Project Repository - Snapshots</name>
      <url>https://repo.eclipse.org/content/repositories/project-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

Replace instances of the word "project" with your project's name.

Note: It is important to ensure your ID's are "repo.eclipse.org" as the Hudson instance is configured to use these IDs.

If you want to keep several snapshot versions use:

    <snapshotRepository>
      <uniqueVersion>true</uniqueVersion>
      ...

Hudson/Jenkins Job Setup

Using http://hudson.eclipse.org you will need to configure Maven to run the "deploy" goal.

There are 2 ways you might want to do this:

  1. Simply add the "deploy" goal as one of your Maven goals as part of your build
  2. Create separate jobs, one for building and one for deploying (if you want more control over when to deploy)


If you decided to go with creating separate jobs, your deploy job will need access to your build job's workspace, an easy way of making this work is to configure the build job, and the deploy job with the optional Use custom workspace configuration under Advanced project options.

Example:

Custom workspace.jpg

Replace <your build job project name> with the name of your project job, for example if your build job was named cbi-maven-plugins-build and your project cbi, then your Directory should be /jobs/genie.cbi/cbi-maven-plugins-build/workspace/. This setting should be configured in both your Build job and Deploy jobs.


Finally your deploy job should invoke an instance of Maven 3 with the "deploy" goal. The only additional option you need to ensure that's configured is to click Advanced and configure the Settings option and set it to Deploy to repo.eclipse.org. This custom settings file contains the necessary credentials in order for you to deploy to repo.eclipse.org.

Deploy settings.jpg

Update 29.03.2017: This is not longer necessary when you want to deploy to repo.eclipse.org or repo.locationtech.org. The credentials have been merged into the general Maven settings.xml file that all HIPPs/JIPPs are using.

Please note: a special settings.xml file is still necessary when deploying to OSSRH.

Deploying a jar to repo.eclipse.org

It is possible to use the Maven deploy:deploy-file goal to push a jar file into repo.eclipse.org via hudson.eclipse.org. For every jar you wish to push into repo.eclipse.org an associating pom.xml file is necessary.

The simplest pom.xml can be as follows:

<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>
  <groupId>org.eclipse.jdt</groupId>
  <artifactId>org.eclipse.jdt.core</artifactId>
  <version>3.9.0.v20130313-2254</version>
</project>

hudson.eclipse.org has access to the same /shared as build.eclipse.org so placing your files somewhere there will allow hudson to be able to find it.

Configuring Hudson for mvn deploy:deploy-file

There are 3 settings which need to be configured:

  1. Goals: deploy:deploy-file
  2. Properties:
    groupId=<groupId>
    artifactId=<artifactId>
    version=<version>
    packaging=jar
    file=/shared/path/to/file.jar
    repositoryId=repo.eclipse.org
    url=<Your project's repo URL to push jar into>
  3. POM File: /path/to/pom.xml

For example: Mvn-deploy-file.png


Note: You will also need to configure your settings file to use Deploy to repo.eclipse.org per instructions in the previous section for deploying artifacts.

Deploying to repo.eclipse.org with Gradle

If you are using Gradle in your build job, you can also deploy to repo.eclipse.org from your HIPP instance as described in the Gradle user guide.

Webmaster will need to setup the Gradle plugin in your HIPP and provide ~/.gradle/gradle.properties with the following two variables:

eclipseRepoUsername
eclipseRepoPassword

Please file a bug against Eclipse Foundation > Community > Hudson for that.

Back to the top