Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ jobs:
java-version: ${{ matrix.java }}
cache: maven
- name: Build and test
run: mvn -B verify
run: mvn -B install
- name: Build shaded artifact
run: mvn -B -f shaded/pom.xml package
27 changes: 27 additions & 0 deletions .github/workflows/publish-shaded.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish shaded artifact

on:
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Publish shaded artifact
run: mvn -B -f shaded/pom.xml deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build/
.classpath
.project
.settings/
dependency-reduced-pom.xml
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ defaults now point to JsoupHtmlParser and JsoupYadisHtmlParser.
The CyberNekoDOM* parsers and OpenID4JavaDOMParser were removed;
custom parser configurations must use the new classes.

Added a shaded openid4java-shaded 2.0.0 artifact for Jenkins plugins,
with Guice, Guava, HttpClient 5, jsoup and the injection APIs relocated
under org.openid4java.shaded.*.

Upgraded the test-only JDOM dependency from 1.0 to JDOM 2.

Replaced deprecated reflective instantiation and boxed constructors,
Expand Down
12 changes: 12 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ Using the library:

The core dependencies are resolved transitively by Maven.

For Jenkins plugins, use the shaded artifact:

<dependency>
<groupId>com.amarulasolutions</groupId>
<artifactId>openid4java-shaded</artifactId>
<version>2.0.0</version>
</dependency>

Its third-party packages are relocated under org.openid4java.shaded.*;
commons-codec is an external dependency and slf4j-api is provided by
the runtime (Jenkins provides it).

The Spring JDBC and Ehcache integrations are optional. Add spring-jdbc
or ehcache explicitly when using JdbcConsumerAssociationStore,
JdbcServerAssociationStore, JdbcNonceVerifier or EhcacheNonceVerifier.
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ The following specifications are supported:
Artifacts are published to GitHub Packages. See [INSTALL](INSTALL) for
the repository and authentication setup.

# Jenkins shaded artifact #

For Jenkins plugins and other environments that need a single JAR with
relocated third-party dependencies:

```
<dependency>
<groupId>com.amarulasolutions</groupId>
<artifactId>openid4java-shaded</artifactId>
<version>2.0.0</version>
</dependency>
```

Guice, Guava, HttpClient 5, jsoup and the injection APIs are relocated
under `org.openid4java.shaded.*`. `commons-codec` remains an external
dependency and `slf4j-api` is provided by the runtime (Jenkins provides
it). The shaded artifact is published to GitHub Packages; see
[INSTALL](INSTALL).

# What is OpenID? #

OpenID starts with the concept that anyone can identify themselves on the
Expand Down
137 changes: 137 additions & 0 deletions shaded/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.amarulasolutions</groupId>
<artifactId>openid4java-shaded</artifactId>
<version>2.0.0</version>
<packaging>jar</packaging>

<name>OpenID4Java Shaded</name>
<description>
Shaded OpenID4Java 2.0.0 for environments that need a single
self-contained JAR with its third-party dependencies relocated.
</description>
<url>https://github.com/amarula/openid4java</url>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<openid4java.version>2.0.0</openid4java.version>
</properties>

<repositories>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/amarula/openid4java</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.amarulasolutions</groupId>
<artifactId>openid4java</artifactId>
<version>${openid4java.version}</version>
</dependency>
<!-- Kept outside the shaded JAR so the host can provide them. -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<artifactSet>
<excludes>
<exclude>commons-logging:commons-logging</exclude>
<exclude>commons-codec:commons-codec</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.ehcache:ehcache</exclude>
<exclude>org.springframework:*</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>org.openid4java.shaded.google</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.hc</pattern>
<shadedPattern>org.openid4java.shaded.apache.hc</shadedPattern>
</relocation>
<relocation>
<pattern>org.jsoup</pattern>
<shadedPattern>org.openid4java.shaded.jsoup</shadedPattern>
</relocation>
<relocation>
<pattern>jakarta.inject</pattern>
<shadedPattern>org.openid4java.shaded.jakarta.inject</shadedPattern>
</relocation>
<relocation>
<pattern>org.aopalliance</pattern>
<shadedPattern>org.openid4java.shaded.aopalliance</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/amarula/openid4java</url>
</repository>
</distributionManagement>
</project>
Loading
Loading