Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
daominah opened this issue Dec 5, 2023 · 4 comments
Closed

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

daominah opened this issue Dec 5, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@daominah
Copy link

daominah commented Dec 5, 2023

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
@daominah daominah added the enhancement New feature or request label Dec 5, 2023
@Scot-Survivor
Copy link

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

@valid-var
Copy link
Contributor

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
Copy link
Contributor

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

@stephane-segning
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants