Skip to content

Commit

Permalink
Update plugins and switch to maven central publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrutishauser committed Oct 23, 2024
1 parent e3a67f5 commit 8efc72d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
git config --global user.name "GitHub Actions"
if: ${{ !startsWith(github.event_name, 'pull_request') }}
- name: Build with Maven
run: mvn -B -V -e verify
run: mvn -B -V -e clean verify
- name: Deploy Site
if: ${{ matrix.java == '1.8' && github.event_name != 'release' && !startsWith(github.event_name, 'pull_request') }}
run: mvn -B -e site-deploy
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
distribution: 'zulu'
java-version: 8
server-id: ossrh
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
Expand All @@ -39,21 +39,16 @@ jobs:
- name: Release
run: >
mvn -V -gs $GITHUB_WORKSPACE/git-settings.xml -B -e release:clean release:prepare &&
echo "::set-output name=RELEASED_VERSION::$(grep scm.tag= release.properties | cut -d'=' -f2 | cut -c2-)" &&
echo "RELEASED_VERSION=$(grep scm.tag= release.properties | cut -d'=' -f2 | cut -c2-)" >> $GITHUB_OUTPUT &&
mvn -gs $GITHUB_WORKSPACE/git-settings.xml -B -e release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ github.token }}
id: release
- name: Deploy to Maven Central
run: mvn -B -f target/checkout nexus-staging:release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Create Release Entry
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.release.outputs.RELEASED_VERSION }}
name: Parent ${{ steps.release.outputs.RELEASED_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The [parent Maven POM](https://jonasrutishauser.github.io/parent/) for my github projects.

[![GNU Lesser General Public License, Version 3, 29 June 2007](https://img.shields.io/github/license/jonasrutishauser/parent.svg?label=License)](http://www.gnu.org/licenses/lgpl-3.0.txt)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.jonasrutishauser/parent.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.jonasrutishauser%22%20a%3A%22parent%22)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.jonasrutishauser/parent.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.github.jonasrutishauser%22%20a%3A%22parent%22)
[![Build Status](https://img.shields.io/github/actions/workflow/status/jonasrutishauser/parent/ci.yml.svg?label=Build)](https://github.com/jonasrutishauser/parent/actions)

## Releasing
Expand Down
110 changes: 39 additions & 71 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.jonasrutishauser</groupId>
<groupId>io.github.jonasrutishauser</groupId>
<artifactId>parent</artifactId>
<version>21-SNAPSHOT</version>
<packaging>pom</packaging>
Expand All @@ -13,7 +13,7 @@
<licenses>
<license>
<name>GNU LGPL 3</name>
<url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
<url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
</license>
</licenses>

Expand Down Expand Up @@ -44,14 +44,6 @@
</ciManagement>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<site>
<id>github</id>
<url>${distributionManagement.site.url}</url>
Expand All @@ -64,6 +56,7 @@

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>

<site.path>/snapshot</site.path>

Expand All @@ -78,29 +71,27 @@
<url>https://jonasrutishauser.github.io/${root.artifactId}${site.path}</url>

<plugin.assembly.version>3.7.1</plugin.assembly.version>
<plugin.changes.version>2.12.1</plugin.changes.version>
<plugin.changelog.version>2.3</plugin.changelog.version>
<plugin.central-publishing.version>0.6.0</plugin.central-publishing.version>
<plugin.clean.version>3.4.0</plugin.clean.version>
<plugin.compiler.version>3.13.0</plugin.compiler.version>
<plugin.dependency.version>3.7.1</plugin.dependency.version>
<plugin.deploy.version>3.1.2</plugin.deploy.version>
<plugin.dependency.version>3.8.0</plugin.dependency.version>
<plugin.deploy.version>3.1.3</plugin.deploy.version>
<plugin.enforcer.version>3.5.0</plugin.enforcer.version>
<plugin.gpg.version>3.2.4</plugin.gpg.version>
<plugin.install.version>3.1.2</plugin.install.version>
<plugin.gpg.version>3.2.7</plugin.gpg.version>
<plugin.install.version>3.1.3</plugin.install.version>
<plugin.jacoco.version>0.8.12</plugin.jacoco.version>
<plugin.jar.version>3.4.2</plugin.jar.version>
<plugin.javadoc.version>3.7.0</plugin.javadoc.version>
<plugin.jxr.version>3.4.0</plugin.jxr.version>
<plugin.nexus-staging.version>1.7.0</plugin.nexus-staging.version>
<plugin.plugin.version>3.13.1</plugin.plugin.version>
<plugin.project-info-reports.version>3.6.1</plugin.project-info-reports.version>
<plugin.release.version>3.1.0</plugin.release.version>
<plugin.javadoc.version>3.10.1</plugin.javadoc.version>
<plugin.jxr.version>3.5.0</plugin.jxr.version>
<plugin.plugin.version>3.15.0</plugin.plugin.version>
<plugin.project-info-reports.version>3.8.0</plugin.project-info-reports.version>
<plugin.release.version>3.1.1</plugin.release.version>
<plugin.resources.version>3.3.1</plugin.resources.version>
<plugin.site.version>3.12.1</plugin.site.version>
<plugin.site.version>3.21.0</plugin.site.version>
<plugin.source.version>3.3.1</plugin.source.version>
<plugin.surefire.version>3.3.0</plugin.surefire.version>
<plugin.taglist.version>3.0.0</plugin.taglist.version>
<plugin.versions.version>2.17.0</plugin.versions.version>
<plugin.surefire.version>3.5.1</plugin.surefire.version>
<plugin.taglist.version>3.2.1</plugin.taglist.version>
<plugin.versions.version>2.17.1</plugin.versions.version>
<wagon.git.version>1.1.1</wagon.git.version>
</properties>

Expand Down Expand Up @@ -157,27 +148,27 @@
</requireMavenVersion>
<requireProperty>
<property>project.description</property>
<message>Project description must be specified (requirement for OSSRH).</message>
<message>Project description must be specified (requirement for maven central).</message>
</requireProperty>
<requireProperty>
<property>project.name</property>
<message>Project name must be specified (requirement for OSSRH).</message>
<message>Project name must be specified (requirement for maven central).</message>
</requireProperty>
<requireProperty>
<property>project.url</property>
<message>Project url must be specified (requirement for OSSRH).</message>
<message>Project url must be specified (requirement for maven central).</message>
</requireProperty>
<requireProperty>
<property>project.licenses</property>
<message>At least on license must be specified (requirement for OSSRH).</message>
<message>At least on license must be specified (requirement for maven central).</message>
</requireProperty>
<requireProperty>
<property>project.developers</property>
<message>At least one developer must be specified (requirement for OSSRH).</message>
<message>At least one developer must be specified (requirement for maven central).</message>
</requireProperty>
<requireProperty>
<property>project.scm.connection</property>
<message>scm section should be defined in project (requirement for OSSRH).</message>
<message>scm section should be defined in project (requirement for maven central).</message>
</requireProperty>
</rules>
</configuration>
Expand Down Expand Up @@ -206,14 +197,14 @@
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${plugin.nexus-staging.version}</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${plugin.central-publishing.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -317,14 +308,6 @@
<artifactId>maven-enforcer-plugin</artifactId>
<version>${plugin.enforcer.version}</version>
</plugin>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
<version>${plugin.changes.version}</version>
</plugin>
<plugin>
<artifactId>maven-changelog-plugin</artifactId>
<version>${plugin.changelog.version}</version>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>${plugin.jxr.version}</version>
Expand Down Expand Up @@ -370,7 +353,15 @@
<reporting>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<artifactId>maven-plugin-report-plugin</artifactId>
<version>${plugin.plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>report-no-fork</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
Expand Down Expand Up @@ -434,7 +425,7 @@
<reportSets>
<reportSet>
<reports>
<report>javadoc</report>
<report>javadoc-no-fork</report>
</reports>
</reportSet>
</reportSets>
Expand All @@ -460,29 +451,6 @@
</reportSet>
</reportSets>
</plugin>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>github-report</report>
</reports>
<configuration>
<includeOpenIssues>false</includeOpenIssues>
<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
</configuration>
</reportSet>
</reportSets>
</plugin>
<plugin>
<artifactId>maven-changelog-plugin</artifactId>
<configuration>
<displayFileDetailUrl>${project.scm.url}/blob/master/%FILE%</displayFileDetailUrl>
<displayChangeSetDetailUrl>${project.scm.url}/commit/</displayChangeSetDetailUrl>
<displayFileRevDetailUrl>${project.scm.url}/blob/%REV%/%FILE%</displayFileRevDetailUrl>
<range>365</range>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
Expand Down
13 changes: 8 additions & 5 deletions src/site/site.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/DECORATION/1.7.0"
<site xmlns="http://maven.apache.org/SITE/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.7.0 http://maven.apache.org/xsd/decoration-1.7.0.xsd">
xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">

<publishDate position="right" />
<version position="right" />

<body>
<links>
<item name="Maven" href="http://maven.apache.org/" />
<item name="Maven" href="https://maven.apache.org/" />
</links>
<breadcrumbs>
<item name="${project.name}" href="https://jonasrutishauser.github.io/${root.artifactId}${site.path}" />
</breadcrumbs>
<menu ref="modules" inherit="bottom" />
<menu ref="reports" inherit="bottom" />
</body>

<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.12.0</version>
<version>2.0.0-M11</version>
</skin>

<custom>
Expand All @@ -31,4 +34,4 @@
</fluidoSkin>
</custom>

</project>
</site>

0 comments on commit 8efc72d

Please sign in to comment.