Skip to content

Commit

Permalink
Switch to maven-assembly-plugin, build jar with dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikos410 committed May 4, 2023
1 parent d67b978 commit 8097915
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ jobs:
path: ~/.m2/repository
key: ${{ hashFiles('**/pom.xml') }}

- name: Build
run: mvn --batch-mode clean package

- name: Determine version
id: project-version
run: echo "project-version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT

- name: Build
run: mvn --batch-mode clean package

- name: Create Checksum
run: |
sha256sum target/keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}.jar > keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}.jar.sha256
sha256sum target/keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}-jar-with-dependencies.jar > keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}-jar-with-dependencies.jar.sha256
- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand All @@ -45,7 +46,9 @@ jobs:
if-no-files-found: error
path: |
target/keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}.jar
target/keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}-jar-with-dependencies.jar
keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}.jar.sha256
keycloak-ipaddress-authenticator-${{ steps.project-version.outputs.project-version }}-jar-with-dependencies.jar.sha256
create_release:
name: Create Release
Expand Down
24 changes: 16 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.keycloak</groupId>
<artifactId>keycloak-ipaddress-authenticator</artifactId>
<version>${keycloak.version}_0</version>
<version>${keycloak.version}_1</version>
<name>Keycloak IP-Address Authenticator</name>

<properties>
Expand Down Expand Up @@ -55,13 +55,21 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 8097915

Please sign in to comment.