Skip to content

Commit

Permalink
Merge pull request #2 from dennisvang/issue1-maven-central
Browse files Browse the repository at this point in the history
Publish to Maven Central repository
  • Loading branch information
luizbonino authored Nov 4, 2024
2 parents 4b4a345 + 188e93a commit 9ee2669
Show file tree
Hide file tree
Showing 16 changed files with 228 additions and 67 deletions.
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

0 comments on commit 9ee2669

Please sign in to comment.