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 "MicroProfile/Maven"

(Explained which and how we use Maven repositories)
m (Fix typo)
(2 intermediate revisions by one other user not shown)
Line 10: Line 10:
 
   </li>
 
   </li>
 
  <li>
 
  <li>
   Create an issue to request access to the org.eclipse.microprofile artifact group prefix and mention that you're a committer to the MicroProfile project. Asa reference, here's the [https://issues.sonatype.org/browse/OSSRH-32787 original Jira for the group prefix]. Link your new Jira issue to the original for reference.
+
   Create an issue to request access to the org.eclipse.microprofile artifact group prefix and mention that you're a committer to the MicroProfile project. As a reference, here's the [https://issues.sonatype.org/browse/OSSRH-32787 original Jira for the group prefix]. Link your new Jira issue to the original for reference.
 
   </li>
 
   </li>
 
</ol>
 
</ol>
  
== Eclipse releases repository ==
+
== Sonatype OSS releases repository ==
  
The [https://repo.eclipse.org/content/repositories/microprofile-snapshots Eclipse MicroProfile releases repository] is also available but no longer used since we use the Maven Central repository instead. Sometimes non-final versions like milestones or candidate releases were deployed to this repository instead of Maven Central. This apprach is considered obsolete now and all non-snapshot releases should be published to Maven Central.
+
For projects using the new release process, you should release against Sonatype. Inheriting from the microprofile-parent will set this up for you, as long as you don't declare a repository section.  Otherwise, the repository looks like:
  
= Snapshot repository =
+
    <distributionManagement>
 +
        <repository>
 +
            <id>ossrh</id>
 +
            <name>Sonatype OSSRH - Release Staging Area</name>
 +
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
 +
        </repository>
 +
        <snapshotRepository>
 +
            <id>ossrh</id>
 +
            <name>Sonatype OSSRH Snapshots</name>
 +
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
 +
            <uniqueVersion>true</uniqueVersion>
 +
        </snapshotRepository>
 +
    </distributionManagement>
  
For daily snapshots, the [https://repo.eclipse.org/content/repositories/microprofile-snapshots/ Eclipse MicroProfile snapshot repository] is used. Jenkins snapshot jobs are set to deploy to this repository automatically.
+
The Jenkins server is setup to be able to push to this repository.  A committer would still need to login to Sonatype OSS to release the repository when its ready to be released.
  
All the artifacts are automatically accessible through the global [https://repo.eclipse.org/content/repositories/snapshots/ Eclipse snapshot repository]. You can add it to maven configuration with the following snippet. As the url, you can also use https://repo.eclipse.org/content/repositories/microprofile-snapshots/ to limit the scope only to MicroProfile artifacts.
+
== Required POM Configuration ==
 +
 
 +
The following release profile should be present in all poms to be released via Jenkins
  
 
<pre>
 
<pre>
         <repositories>
+
         <profile>
             <repository>
+
             <id>release</id>
                 <id>eclipse.microprofile</id>
+
            <build>
                <name>Eclipse MicroProfile Repository</name>
+
                 <plugins>
                <url>https://repo.eclipse.org/content/repositories/snapshots/</url>
+
                    <plugin>
                <releases>
+
                        <groupId>org.sonatype.plugins</groupId>
                     <enabled>false</enabled>
+
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                </releases>
+
                        <version>1.6.3</version>
                <snapshots>
+
                        <extensions>true</extensions>
                     <enabled>true</enabled>
+
                        <configuration>
                 </snapshots>
+
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
             </repository>
+
                            <serverId>ossrh</serverId>
         </repositories>
+
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
 +
                        </configuration>
 +
                    </plugin>
 +
                     <plugin>
 +
                        <groupId>org.apache.maven.plugins</groupId>
 +
                        <artifactId>maven-source-plugin</artifactId>
 +
                        <executions>
 +
                            <execution>
 +
                                <id>attach-sources</id>
 +
                                <goals>
 +
                                    <goal>jar-no-fork</goal>
 +
                                </goals>
 +
                            </execution>
 +
                        </executions>
 +
                     </plugin>
 +
                    <plugin>
 +
                        <groupId>org.apache.maven.plugins</groupId>
 +
                        <artifactId>maven-javadoc-plugin</artifactId>
 +
                        <executions>
 +
                            <execution>
 +
                                <id>attach-javadocs</id>
 +
                                <goals>
 +
                                    <goal>jar</goal>
 +
                                </goals>
 +
                            </execution>
 +
                        </executions>
 +
                    </plugin>
 +
                    <plugin>
 +
                        <groupId>org.apache.maven.plugins</groupId>
 +
                        <artifactId>maven-gpg-plugin</artifactId>
 +
                        <version>1.6</version>
 +
                        <executions>
 +
                            <execution>
 +
                                <id>sign-artifacts</id>
 +
                                <phase>verify</phase>
 +
                                <goals>
 +
                                    <goal>sign</goal>
 +
                                </goals>
 +
                            </execution>
 +
                        </executions>
 +
                    </plugin>
 +
                 </plugins>
 +
             </build>
 +
         </profile>
 
</pre>
 
</pre>
 +
 +
= Sonatype Snapshot Repository =
 +
 +
For all builds, the [https://oss.sonatype.org/content/repositories/snapshots/ Sonatype OSS snapshot repository] is used.

Revision as of 04:47, 19 September 2020

Releases repository

For releases, including milestone and candidate releases, the Maven Central repository is used. There's a common Jenkins job MicroProfile Releases to release any MicroProfile feature.

After a release is uploaded from Jenkins but before a release is published in Maven Central, usually a manual approval is required in Sonatype Nexus. Every committer is eligible to have access to the Sonatype Nexus with permission for the org.eclipse.microprofile artifact group prefix. If you are a committer and don't have access, do the following steps:

  1. Register yourself in the public Sonatype Jira to get an account for both Sonatype Jira and Nexus
  2. Create an issue to request access to the org.eclipse.microprofile artifact group prefix and mention that you're a committer to the MicroProfile project. As a reference, here's the original Jira for the group prefix. Link your new Jira issue to the original for reference.

Sonatype OSS releases repository

For projects using the new release process, you should release against Sonatype. Inheriting from the microprofile-parent will set this up for you, as long as you don't declare a repository section. Otherwise, the repository looks like:

   <distributionManagement>
       <repository>
           <id>ossrh</id>
           <name>Sonatype OSSRH - Release Staging Area</name>
           <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
       </repository>
       <snapshotRepository>
           <id>ossrh</id>
           <name>Sonatype OSSRH Snapshots</name>
           <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
           <uniqueVersion>true</uniqueVersion>
       </snapshotRepository>
   </distributionManagement>

The Jenkins server is setup to be able to push to this repository. A committer would still need to login to Sonatype OSS to release the repository when its ready to be released.

Required POM Configuration

The following release profile should be present in all poms to be released via Jenkins

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                         <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.3</version>
                        <extensions>true</extensions>
                        <configuration>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <serverId>ossrh</serverId>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

Sonatype Snapshot Repository

For all builds, the Sonatype OSS snapshot repository is used.

Back to the top