klausbetz / apple-identity-provider-keycloak

An extension for Keycloak, that enables web-based sign in with Apple and token exchange
Apache License 2.0
193 stars 27 forks source link

jitpack.io distribution #28

Closed EvgeniGordeev closed 1 year ago

EvgeniGordeev commented 1 year ago

It seems to be pretty straightforward to push the artifact to the github based maven repository - https://jitpack.io/#klausbetz/apple-identity-provider-keycloak/1.4.0.

First build failed https://jitpack.io/com/github/klausbetz/apple-identity-provider-keycloak/1.4.0/build.log:

Build starting...
Start: Tue Jan 17 18:54:24 UTC 2023 f52ae56bcf69
Git:
1.4.0-0-g09a2721
commit 09a2721e425bcfe54eba298cb2925c857608fd1c
Author: Klaus Betz 
Date:   Fri Dec 9 12:35:52 2022 +0100

    feat(#22): support id-token exchange (#23)

Init SDKMan
Found gradle
Gradle build script
Found gradle version: 7.4.2.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Downloading https://services.gradle.org/distributions/gradle-7.4.2-bin.zip
.10%.20%.30%.40%.50%.60%.70%.80%.90%.100%

------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------

Build time:   2022-03-31 15:25:29 UTC
Revision:     540473b8118064efcc264694cbcaa4b677f61041

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          1.8.0_292 (Private Build 25.292-b10)
OS:           Linux 4.14.63-xxxx-std-ipv6-64 amd64

0m3.129s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Getting tasks: ./gradlew tasks --all
Tasks: 
Found javadoc task

 ⚠️   WARNING:
 Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
 See the documentation and examples: https://docs.jitpack.io

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
/home/jitpack/build/build.gradle has component: java
Running: ./gradlew clean -Pgroup=com.github.klausbetz -Pversion=1.4.0 -xtest publishToMavenLocal
> Task :clean UP-TO-DATE
> Task :compileJava FAILED
2 actionable tasks: 1 executed, 1 up-to-date
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> invalid source release: 11

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Archive: at.klausbetz:apple-identity-provider:1.4.0
Publication: at.klausbetz:apple-identity-provider:1.4.0
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
Found artifact: at.klausbetz:apple-identity-provider:1.4.0
2023-01-17T18:54:39.969509875Z
Exit code: 0

⚠️ ERROR: No build artifacts found
Expected artifacts in: $HOME/.m2/repository/at/klausbetz/apple-identity-provider/1.4.0
EvgeniGordeev commented 1 year ago

For our corporate usage we import the project to internal gitlab and deploy it to our internal repository by tweaking build.gradle:


plugins {
    id 'java'
    id 'org.hibernate.build.maven-repo-auth' version '3.0.3' // use mvn settings.xml for nexus auth
    id 'maven-publish'
}

group 'at.klausbetz'

test {
    useJUnitPlatform()
}

java {
    withSourcesJar()
}

publishing {
    publications {
        myJava(MavenPublication) {
            from components.java
        }
    }

    repositories {
        maven {
            name 'nexus-releases'
            url "https://example.com/repository/maven-releases/"
        }
    }
}
klausbetz commented 1 year ago

This could be a great improvement!

Would you like to create a pull-request? I'd be more than happy to see you contribute to this extension 😄

EvgeniGordeev commented 1 year ago

@klausbetz PR is ready. The dependency in Maven will look like

    <dependency>
        <groupId>com.github.klausbetz</groupId>
        <artifactId>apple-identity-provider-keycloak</artifactId>
        <version>1.5.0</version>
    </dependency>

For custom group id see https://jitpack.io/docs/#custom-domain-name.

I added a job for tags only - as soon as you create a release this job is proactively initiating a jitpack build.

klausbetz commented 1 year ago

Closed with #36