Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to Maven Central repository #2

Merged
merged 36 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6fffb88
change groupId from fairdevkit to fairdatateam
dennisvang Oct 10, 2024
9696e56
rename fairdevkit subfolder to fairdatateam
dennisvang Oct 11, 2024
e7d2543
remove nexus deployment from ci.yml workflow
dennisvang Oct 11, 2024
964213d
add maven-publish workflow
dennisvang Oct 11, 2024
964c3f3
tidy poms
dennisvang Oct 11, 2024
44034e7
switch pom distributionManagement repo back to github packages
dennisvang Oct 11, 2024
4944b4f
replace shorthand mvn options in workflows by verbose options
dennisvang Oct 11, 2024
56ca12e
DRY project version
dennisvang Oct 11, 2024
3cf544b
add flatten-maven-plugin to parent pom
dennisvang Oct 11, 2024
f9e5af6
gitignore .flattened-pom.xml files generated by flatten-maven-plugin
dennisvang Oct 11, 2024
d32bbcc
tidy pom...
dennisvang Oct 11, 2024
979fe7b
fix temporary repo url in pom
dennisvang Oct 11, 2024
8a1060c
generic Maven repository url based on environment variable
dennisvang Oct 14, 2024
d74606d
explicit version for flatten-maven-plugin
dennisvang Oct 14, 2024
78010f7
simplify maven-ci workflow using setup-java cache
dennisvang Oct 14, 2024
4604835
rename packages according to org.fairdatateam namespace
dennisvang Oct 22, 2024
01afd70
DRY groupId and artifactId in pom files
dennisvang Oct 22, 2024
d626b89
add pom plugins for publishing, javadoc, sources, and gpg
dennisvang Oct 22, 2024
9075ef9
simplify maven-gpg-plugin config in pom
dennisvang Oct 23, 2024
ade17c3
add gpg variables to maven-ci workflow
dennisvang Oct 23, 2024
b1da66f
add scm, developers, name, description, and url to pom
dennisvang Oct 23, 2024
ccb149f
adapt maven-publish workflow to use maven central portal
dennisvang Oct 23, 2024
28a31c4
remove workflow permissions and use server-id maven
dennisvang Oct 23, 2024
ffd1b69
use mvn batch mode in publish workflow
dennisvang Oct 23, 2024
ad8201c
revert workflow server-id to central
dennisvang Oct 23, 2024
9bbff86
override groupId using env var in workflow
dennisvang Oct 23, 2024
d951924
remove -SNAPSHOT from version and bump to 0.1.3dev0
dennisvang Oct 23, 2024
c4dac50
fix typo in workflow
dennisvang Oct 23, 2024
62862a7
hardcode groupid for fork
dennisvang Oct 24, 2024
0d15eeb
note about maven central validation
dennisvang Oct 25, 2024
789a46e
remove dry groupid and artifactid
dennisvang Oct 25, 2024
dd52fb3
update changelog
dennisvang Oct 25, 2024
251931f
fix orphan groupid reference
dennisvang Oct 25, 2024
fa2638b
bump version to 0.2.0dev0
dennisvang Oct 25, 2024
de311f3
change groupId to org.fairdatateam.rdf, hardcode github repo url, and…
dennisvang Oct 28, 2024
188e93a
skip GPG signing in maven-ci workflow
dennisvang Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Maven CI

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# temurin LTS versions
version: [17, 21]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.version }}
distribution: 'temurin'
cache: maven

- name: Maven build (skip gpg signing)
run: mvn --batch-mode --update-snapshots --fail-fast -Dgpg.skip tidy:check com.mycila:license-maven-plugin:check com.github.spotbugs:spotbugs-maven-plugin:check verify
37 changes: 37 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven
# https://github.com/actions/setup-java
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
# using java 17 for now, to match original
# todo: migrate to java 21 (LTS)
java-version: 17
distribution: 'temurin'
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central Portal
# visit https://central.sonatype.com/publishing/deployments in case of validation issues
run: mvn --batch-mode deploy
env:
GROUP_ID: ${{ vars.GROUP_ID }}
# https://central.sonatype.org/publish/generate-portal-token/
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

[Unreleased]: https://github.com/fairdevkit/rdf-resource-resolver/compare/master...HEAD

## [0.2.0] - 2024 Oct 28

### Changed (backward incompatible)

- changed package namespace from `nl.dtls` to `org.fairdatateam`
- changed `groupId` to `org.fairdatateam.rdf`

[Unreleased]: https://github.com/fairdatateam/rdf-resource-resolver/compare/master...HEAD
[0.2.0]: https://github.com/fairdatateam/rdf-resource-resolver-fork/releases/tag/0.2.0
147 changes: 137 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
SOFTWARE.

-->
<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">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.fairdevkit</groupId>
<groupId>org.fairdatateam.rdf</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<version>0.1.2-SNAPSHOT</version>
<version>${revision}</version>
<packaging>pom</packaging>

<name>rdf-resource-resolver</name>
<description>Takes a resource identifier and attempts to resolve the resource's content.</description>
<url>https://github.com/FAIRDataTeam/rdf-resource-resolver</url>
<licenses>
<license>
<name>MIT License</name>
Expand All @@ -40,20 +43,37 @@
</license>
</licenses>

<developers>
<developer>
<name>dennisvang</name>
<url>https://github.com/dennisvang</url>
</developer>
<developer>
<name>Kees Burger</name>
<url>https://github.com/kburger</url>
</developer>
<developer>
<name>Marek Suchánek</name>
<url>https://github.com/MarekSuchanek</url>
</developer>
</developers>

<modules>
<module>rdf-resource-resolver-api</module>
<module>rdf-resource-resolver-core</module>
</modules>

<distributionManagement>
<repository>
<id>nexus-snapshots</id>
<name>Nexus Snapshots</name>
<url>https://nexus.internal.fairdatapoint.org/repository/maven-snapshots/</url>
</repository>
</distributionManagement>
<scm>
<connection>scm:git:https://github.com/FAIRDataTeam/rdf-resource-resolver.git</connection>
<developerConnection>scm:git:ssh://github.com/FAIRDataTeam/rdf-resource-resolver.git</developerConnection>
<url>https://github.com/FAIRDataTeam/rdf-resource-resolver</url>
</scm>

<properties>
<!-- project version -->
<!-- https://maven.apache.org/maven-ci-friendly.html#multi-module-setup -->
<revision>0.2.0</revision>

<!-- project settings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand All @@ -64,6 +84,7 @@
<!-- compile dependency version management -->
<slf4j.version>1.7.30</slf4j.version>
<rdf4j.version>3.7.0</rdf4j.version>
<flatten.version>1.6.0</flatten.version>
<!-- provided dependency version management -->
<spotbugs.version>4.2.3</spotbugs.version>
<!-- test dependency version management -->
Expand Down Expand Up @@ -102,6 +123,7 @@

<build>
<testSourceDirectory>src/test/groovy</testSourceDirectory>
<!-- TODO: the repo does not have any tests, so why do we have plugins for surefire, gmavenplus, groovy, spock, ...? -->
<pluginManagement>
<plugins>
<plugin>
Expand Down Expand Up @@ -149,6 +171,111 @@
</licenseSets>
</configuration>
</plugin>
<plugin><!-- required for deploying projects with ${revision} -->
<!-- https://maven.apache.org/maven-ci-friendly.html#install-deploy -->
<!-- https://www.mojohaus.org/flatten-maven-plugin/usage.html -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<!-- enable flattening -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<!-- ensure proper cleanup -->
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- the following plugins are required for publishing to maven central -->
<!-- https://central.sonatype.org/publish/publish-portal-maven/ -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>false</autoPublish>
</configuration>
</plugin>
<!-- https://central.sonatype.org/publish/publish-maven/#gpg-signed-components -->
<!-- https://maven.apache.org/plugins/maven-gpg-plugin/usage.html -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<bestPractices>true</bestPractices>
<!-- set gpg.keyname via command line if necessary (default: first found) -->
</configuration>
</execution>
</executions>
</plugin>
<!-- https://central.sonatype.org/publish/publish-maven/#javadoc-and-sources-attachments -->
<!-- https://maven.apache.org/plugins/maven-source-plugin/ -->
<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<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>
<version>3.10.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<!-- override groupId property if GROUP_ID environment variable is found -->
<activation>
<property>
<name>env.GROUP_ID</name>
</property>
</activation>
<properties>
<groupId>${env.GROUP_ID}</groupId>
</properties>
</profile>
</profiles>
</project>
6 changes: 3 additions & 3 deletions rdf-resource-resolver-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
SOFTWARE.

-->
<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">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.fairdevkit</groupId>
<groupId>org.fairdatateam.rdf</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<version>0.1.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>rdf-resource-resolver-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.api;
package org.fairdatateam.rdf.resolver.api;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.api;
package org.fairdatateam.rdf.resolver.api;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
* API types for the RDF resolver library.
*/
@javax.annotation.ParametersAreNonnullByDefault
package com.github.fairdevkit.rdf.resolver.api;
package org.fairdatateam.rdf.resolver.api;
8 changes: 4 additions & 4 deletions rdf-resource-resolver-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
SOFTWARE.

-->
<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">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.fairdevkit</groupId>
<groupId>org.fairdatateam.rdf</groupId>
<artifactId>rdf-resource-resolver</artifactId>
<version>0.1.2-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>rdf-resource-resolver-core</artifactId>

<dependencies>
<!-- compile -->
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.fairdatateam.rdf</groupId>
<artifactId>rdf-resource-resolver-api</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.fairdevkit.rdf.resolver.core;
package org.fairdatateam.rdf.resolver.core;

import com.github.fairdevkit.rdf.resolver.api.ResolverStrategy;
import org.fairdatateam.rdf.resolver.api.ResolverStrategy;
import java.io.IOException;
import java.io.InputStream;
import java.net.http.HttpClient;
Expand Down
Loading