vymalo / keycloak-webhook

Event-based Webhook plugin for Keycloak
https://blog.ssegning.com
MIT License
29 stars 6 forks source link

How can i build "keycloak-webhook-0.4.0-all.jar" from source? #17

Closed daominah closed 8 months ago

daominah commented 10 months ago

I am trying to update the code to use an APIKey instead of Authorization username password. I not familiar with Kotlin, Gradle or Java, I can edit some lines of code but how to build a jar file is completely new for me. It would be very nice if you can add a Dockerfile that build jar files from sources. I try to do it like the following Dockerfile but only got "keycloak-webhook-0.4.0.jar", missing ""keycloak-webhook-0.4.0-all.jar"".

FROM gradle:jdk17
ENV APP_HOME=/usr/app
WORKDIR $APP_HOME
COPY build.gradle.kts settings.gradle.kts $APP_HOME
COPY gradle $APP_HOME/gradle
COPY --chown=gradle:gradle . /home/gradle/src
USER root
RUN chown -R gradle /home/gradle/src
RUN gradle build || return 0
COPY . .
RUN gradle clean build

ENV OUT_LIST=/output_jar.txt
RUN echo "$APP_HOME/build/libs/" >> $OUT_LIST
RUN ls -l $APP_HOME/build/libs/ >> $OUT_LIST
Scot-Survivor commented 9 months ago

Building with gradle should be as simple as on Linux ./gradlew build Or gradlew.bat build in windows

valid-var commented 8 months ago

Building with gradle should be as simple as on Linux ./gradlew build Or gradlew.bat build in windows

This actually only creates small version, which apparently does not work, unlike -all version in release

valid-var commented 8 months ago

I found the solution ./gradlew shadowJar builds *-all jar

stephane-segning commented 8 months ago

Thank you @valid-var for your answer. And yes, it's the correct one. You should use ./gradlew shadowJar to build.