diff --git a/bom/application/pom.xml b/bom/application/pom.xml index d9de2ea8b9cfd..ac9c943e96443 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -46,13 +46,13 @@ 2.1 2.0.1 4.0.2 - 2.13.8 + 2.13.9 3.13.4 4.2.0 4.0.0 4.0.12 2.14.1 - 6.9.2 + 6.9.3 4.6.2 2.2.1 1.0.13 @@ -121,7 +121,7 @@ 2.3.230 42.7.7 - 3.5.5 + 3.5.6 8.3.0 13.2.0.jre11 1.6.7 @@ -190,7 +190,7 @@ 1.1.4 1.28.0 1.14.0 - 2.13.1 + 2.13.2 2.0.1.Final 2.25.1 1.3.1.Final @@ -3728,6 +3728,11 @@ bcpg-jdk18on ${bouncycastle.version} + + org.bouncycastle + bcmail-jdk18on + ${bouncycastle.version} + org.bouncycastle bc-fips @@ -4398,58 +4403,10 @@ io.smallrye - smallrye-fault-tolerance - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-api - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-apiimpl - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-autoconfig-core - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-core - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-context-propagation - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-kotlin - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-mutiny - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-standalone - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-tracing-propagation - ${smallrye-fault-tolerance.version} - - - io.smallrye - smallrye-fault-tolerance-vertx + smallrye-fault-tolerance-bom ${smallrye-fault-tolerance.version} + pom + import io.smallrye diff --git a/devtools/project-core-extension-codestarts/pom.xml b/devtools/project-core-extension-codestarts/pom.xml index fe69edbe8eafb..eb8f3bb962548 100644 --- a/devtools/project-core-extension-codestarts/pom.xml +++ b/devtools/project-core-extension-codestarts/pom.xml @@ -17,6 +17,25 @@ ${project.basedir}/../gradle gradlew + + + + org.jboss.logmanager + log4j-jboss-logmanager + test + + + org.junit.jupiter + junit-jupiter + test + + + org.assertj + assertj-core + test + + + @@ -30,47 +49,21 @@ - org.apache.maven.plugins - maven-jar-plugin + maven-resources-plugin - - gradle-wrapper/.gradle/** - + UTF-8 - org.codehaus.mojo - exec-maven-plugin - - - generate-gradle-wrapper - prepare-package - - ${gradle-wrapper.path}/${gradle.executable} - - - -Xmx512m - - - init - --type - basic - --no-daemon - --overwrite - - target/classes/gradle-wrapper - true - - - exec - - - + maven-surefire-plugin + + + ${gradle-wrapper.version} + + @@ -87,5 +80,136 @@ gradlew.bat + + install-gradle-wrapper + + + installGradleWrapper + + + + + + org.codehaus.mojo + exec-maven-plugin + + + init-gradle-project + generate-sources + + ${gradle-wrapper.path}/${gradle.executable} + + + -Xmx512m + + + init + --type + basic + --no-daemon + --overwrite + + ${project.build.directory}/gradle-wrapper + true + + + exec + + + + install-gradle-wrapper + generate-sources + + ${gradle-wrapper.path}/${gradle.executable} + + + -Xmx512m + + + wrapper + --gradle-version + ${gradle-wrapper.version} + --no-daemon + + ${project.build.directory}/gradle-wrapper + true + + + exec + + + + + + maven-resources-plugin + + + copy-gradle-wrapper + generate-sources + + copy-resources + + + ${project.build.outputDirectory}/codestarts/quarkus/tooling/gradle-wrapper/base/ + + + ${project.build.directory}/gradle-wrapper/ + + gradle/wrapper/** + gradlew + gradlew.bat + + false + + + + + + + + + + + copy-gradle-wrapper + + + !installGradleWrapper + + + + + + maven-resources-plugin + + + copy-gradle-wrapper + generate-sources + + copy-resources + + + ${project.build.outputDirectory}/codestarts/quarkus/tooling/gradle-wrapper/base/ + + + ${gradle-wrapper.path} + + gradle/wrapper/** + gradlew + gradlew.bat + + false + + + + + + + + + diff --git a/independent-projects/tools/base-codestarts/src/main/filtered/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml b/devtools/project-core-extension-codestarts/src/main/filtered/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/filtered/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/filtered/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml diff --git a/independent-projects/tools/base-codestarts/src/main/filtered/codestarts/quarkus/tooling/maven-wrapper/codestart.yml b/devtools/project-core-extension-codestarts/src/main/filtered/codestarts/quarkus/tooling/maven-wrapper/codestart.yml similarity index 100% rename from independent-projects/tools/base-codestarts/src/main/filtered/codestarts/quarkus/tooling/maven-wrapper/codestart.yml rename to devtools/project-core-extension-codestarts/src/main/filtered/codestarts/quarkus/tooling/maven-wrapper/codestart.yml diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/base/..gitignore b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/base/..gitignore new file mode 100644 index 0000000000000..a19c3c0c8bda7 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/base/..gitignore @@ -0,0 +1,64 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see https://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Eclipse +.project +.classpath +.settings/ +bin/ + +# IntelliJ +.idea +*.ipr +*.iml +*.iws + +# NetBeans +nb-configuration.xml + +# Visual Studio Code +.vscode +.factorypath + +# OSX +.DS_Store + +# Vim +*.swp +*.swo + +# patch +*.orig +*.rej + +# Gradle +.gradle/ +build/ + +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +release.properties diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/base/README.tpl.qute.md b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/base/README.tpl.qute.md new file mode 100644 index 0000000000000..f324e37b0c3ef --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/base/README.tpl.qute.md @@ -0,0 +1,3 @@ +# {extension.full-name} + +This is a Quarkus Extension for ... diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/codestart.yml new file mode 100644 index 0000000000000..df2127ecb1b4d --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-extension/tooling/git/codestart.yml @@ -0,0 +1,4 @@ +name: git +ref: git +type: tooling + diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/base/jbang b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/base/jbang new file mode 100755 index 0000000000000..8651f46005bd1 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/base/jbang @@ -0,0 +1,239 @@ +#!/usr/bin/env bash + +# +# To run this script remotely type this in your shell +# (where ... are the arguments you want to pass to JBang): +# curl -Ls https://sh.jbang.dev | bash -s - ... +# + +# The Java version to install when it's not installed on the system yet +javaVersion=${JBANG_DEFAULT_JAVA_VERSION:-17} + +absolute_path() { + # if the given path to the jbang launcher is absolute (i.e. it is either starting with / or a + # 'letter:/' when using gitbash on windows) it is returned unchanged, otherwise we construct an absolute path + [[ $1 = /* ]] || [[ $1 =~ ^[A-z]:/ ]] && echo "$1" || echo "$PWD/${1#./}" +} + +resolve_symlink() { + if [[ $OSTYPE != darwin* ]]; then minusFarg="-f"; fi + sym_resolved=$(readlink ${minusFarg} "$1") + + if [[ -n $sym_resolved ]]; then + echo "$sym_resolved" + else + echo "$1" + fi +} + +download() { + if [ -x "$(command -v curl)" ]; then + curl -sLf -o "$2" "$1" + retval=$? + elif [ -x "$(command -v wget)" ]; then + wget -q -O "$2" "$1" + retval=$? + else + echo "Error: curl or wget not found, please make sure one of them is installed" 1>&2 + exit 1 + fi +} + +unpack() { + if [[ "$1" == *.tar.gz ]]; then + gzip -cd "$1" | tar xf - -C "$2" + retval=$? + if [[ $os == mac && $retval -eq 0 ]]; then + mv "$TDIR/jdks/$javaVersion.tmp/"*/Contents/Home/* "$TDIR/jdks/$javaVersion.tmp/" + retval=$? + else + mv "$TDIR/jdks/$javaVersion.tmp/"*/* "$TDIR/jdks/$javaVersion.tmp/" + fi + else + unzip -qq -o "$1" -d "$2" + retval=$? + mv "$TDIR/jdks/$javaVersion.tmp/"*/* "$TDIR/jdks/$javaVersion.tmp/" + fi +} + +javacInPath() { + [[ -x "$(command -v javac)" && ( $os != "mac" || $(/usr/libexec/java_home &> /dev/null) ) ]] +} + +abs_jbang_dir=$(dirname "$(resolve_symlink "$(absolute_path "$0")")") + +# todo might vary by os so can be overwritten below +libc_type=glibc +file_type=tar.gz + +case "$(uname -s)" in + Linux*) + os=linux + if [ -f /etc/alpine-release ]; then + os=alpine-linux + javaVersion=16 + fi + ;; + Darwin*) + os=mac + libc_type=libc;; + CYGWIN*|MINGW*|MSYS*) + os=windows + libc_type=c_std_lib + file_type=zip;; + AIX) + os=aix;; + *) + os= +esac + +case "$(uname -m)" in + i?86) + arch=x32;; + x86_64|amd64) + arch=x64;; + aarch64) + arch=aarch64;; + armv7l) + arch=arm;; + ppc64le) + arch=ppc64le;; + s390x) + arch=s390x;; + arm64) + if [ "$os" = "mac" ]; then + arch=arm64 + ## force use of 17 as 11 not yet available https://github.com/adoptium/adoptium/issues/96 + javaVersion=17 + else + arch=arm64 + fi + ;; + *) + ## AIX gives a machine ID for `uname -m` but it only supports ppc64 + if [ "$os" = "aix" ]; then + arch=ppc64 + else + arch= + fi + ;; +esac + +## when using cygwin fall out to just running the bat file. +if [[ $os == windows && -f "$abs_jbang_dir/jbang.cmd" && "$(uname -s)" == CYGWIN* ]]; then + cmd /c "$(cygpath -m "$abs_jbang_dir"/jbang.cmd)" "$@" + exit $? +fi + +if [[ -z "$JBANG_JDK_VENDOR" ]]; then + if [[ "$javaVersion" -eq 8 || "$javaVersion" -eq 11 || "$javaVersion" -eq 17 || "$javaVersion" -eq 21 ]]; then + distro="temurin"; + else + distro="aoj"; fi +else + distro=$JBANG_JDK_VENDOR +fi +if [[ -z "$JBANG_JDK_RELEASE" ]]; then release="ga"; else release="$JBANG_JDK_RELEASE"; fi + +if [[ -z "$JBANG_DIR" ]]; then JBDIR="$HOME/.jbang"; else JBDIR="$JBANG_DIR"; fi +if [[ -z "$JBANG_CACHE_DIR" ]]; then TDIR="$JBDIR/cache"; else TDIR="$JBANG_CACHE_DIR"; fi + +## resolve application jar path from script location +if [ -f "$abs_jbang_dir/jbang.jar" ]; then + jarPath=$abs_jbang_dir/jbang.jar +elif [ -f "$abs_jbang_dir/.jbang/jbang.jar" ]; then + jarPath=$abs_jbang_dir/.jbang/jbang.jar +else + if [[ ! -f "$JBDIR/bin/jbang.jar" || ! -f "$JBDIR/bin/jbang" ]]; then + echo "Downloading JBang..." 1>&2 + mkdir -p "$TDIR/urls" + jburl="https://github.com/jbangdev/jbang/releases/latest/download/jbang.tar" + download $jburl "$TDIR/urls/jbang.tar" + if [ $retval -ne 0 ]; then echo "Error downloading JBang" 1>&2; exit $retval; fi + echo "Installing JBang..." 1>&2 + rm -rf "$TDIR/urls/jbang" + tar xf "$TDIR/urls/jbang.tar" -C "$TDIR/urls" + if [ $retval -ne 0 ]; then echo "Error installing JBang" 1>&2; exit $retval; fi + mkdir -p "$JBDIR/bin" + rm -f "$JBDIR/bin/jbang" "$JBDIR/bin"/jbang.* + cp -f "$TDIR/urls/jbang/bin"/* "$JBDIR/bin" + fi + "$JBDIR"/bin/jbang "$@" + exit $? +fi +if [ -f "$jarPath.new" ]; then + # a new jbang version was found, we replace the old one with it + mv "$jarPath.new" "$jarPath" +fi + +# Find/get a JDK +unset JAVA_EXEC +if [[ -n "$JAVA_HOME" ]]; then + # Determine if a (working) JDK is available in JAVA_HOME + if [ -x "$(command -v "$JAVA_HOME"/bin/javac)" ]; then + JAVA_EXEC="$JAVA_HOME/bin/java" + else + echo "JAVA_HOME is set but does not seem to point to a valid Java JDK" 1>&2 + fi +fi +if [[ -z "$JAVA_EXEC" ]]; then + # Determine if a (working) JDK is available on the PATH + if javacInPath; then + unset JAVA_HOME + JAVA_EXEC="java" + elif [ -x "$JBDIR/currentjdk/bin/javac" ]; then + export JAVA_HOME="$JBDIR/currentjdk" + JAVA_EXEC="$JBDIR/currentjdk/bin/java" + else + export JAVA_HOME="$TDIR/jdks/$javaVersion" + JAVA_EXEC="$JAVA_HOME/bin/java" + # Check if we installed a JDK before + if [ ! -d "$TDIR/jdks/$javaVersion" ]; then + # If not, download and install it + if [[ $os == "" ]]; then + echo "Unable to download JDK, unsupported Operating System: $(uname -s)" 1>&2 + exit 1 + fi + if [[ $arch == "" ]]; then + echo "Unable to download JDK, unsupported Architecture: $(uname -m)" 1>&2 + exit 1 + fi + mkdir -p "$TDIR/jdks" + echo "Downloading JDK $javaVersion. Be patient, this can take several minutes..." 1>&2 + jdkurl="https://api.foojay.io/disco/v2.0/directuris?distro=$distro&javafx_bundled=false&libc_type=$libc_type&archive_type=$file_type&operating_system=$os&package_type=jdk&version=$javaVersion&release_status=$release&architecture=$arch&latest=available" + download "$jdkurl" "$TDIR/bootstrap-jdk.$file_type" + if [ $retval -ne 0 ]; then echo "Error downloading JDK" 1>&2; exit $retval; fi + echo "Installing JDK $javaVersion..." 1>&2 + rm -rf "$TDIR/jdks/$javaVersion.tmp/" + mkdir -p "$TDIR/jdks/$javaVersion.tmp" + unpack "$TDIR/bootstrap-jdk.$file_type" "$TDIR/jdks/$javaVersion.tmp" + if [ $retval -ne 0 ]; then + # Check if the JDK was installed properly + javac -version > /dev/null 2>&1 + retval=$? + fi + if [ $retval -ne 0 ]; then echo "Error installing JDK" 1>&2; exit $retval; fi + # Activate the downloaded JDK giving it its proper name + mv "$TDIR/jdks/$javaVersion.tmp" "$TDIR/jdks/$javaVersion" + # Set the current JDK + ${JAVA_EXEC} -classpath "${jarPath}" dev.jbang.Main jdk default $javaVersion + fi + fi +fi + +## https://stackoverflow.com/questions/1668649/how-to-keep-quotes-in-bash-arguments +## attempt to ensure each argument keeps its original quoting + +## run it using command substitution to have just the user process once jbang is done +export JBANG_RUNTIME_SHELL=bash +export JBANG_STDIN_NOTTY=$([ -t 0 ] && echo "false" || echo "true") +output=$(CLICOLOR_FORCE=1 ${JAVA_EXEC} ${JBANG_JAVA_OPTIONS} -classpath "${jarPath}" dev.jbang.Main "$@") +err=$? +if [ $err -eq 255 ]; then + eval "exec $output" +elif [ -n "$output" ]; then + echo "$output" + exit $err +else + exit $err +fi diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/base/jbang.cmd b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/base/jbang.cmd new file mode 100644 index 0000000000000..ab24f90807987 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/base/jbang.cmd @@ -0,0 +1,87 @@ +@echo off +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION + +rem The Java version to install when it's not installed on the system yet +if "%JBANG_DEFAULT_JAVA_VERSION%"=="" (set javaVersion=11) else (set javaVersion=%JBANG_DEFAULT_JAVA_VERSION%) + +if "%JBANG_DIR%"=="" (set JBDIR=%userprofile%\.jbang) else (set JBDIR=%JBANG_DIR%) +if "%JBANG_CACHE_DIR%"=="" (set TDIR=%JBDIR%\cache) else (set TDIR=%JBANG_CACHE_DIR%) + +rem resolve application jar path from script location and convert to windows path when using cygwin +if exist "%~dp0jbang.jar" ( + set jarPath=%~dp0jbang.jar +) else if exist "%~dp0.jbang\jbang.jar" ( + set jarPath=%~dp0.jbang\jbang.jar +) else ( + if not exist "%JBDIR%\bin\jbang.jar" ( + powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -Command "%~dp0jbang.ps1 version" > nul + if !ERRORLEVEL! NEQ 0 ( exit /b %ERRORLEVEL% ) + ) + call "%JBDIR%\bin\jbang.cmd" %* + exit /b %ERRORLEVEL% +) +if exist "%jarPath%.new" ( + rem a new jbang version was found, we replace the old one with it + copy /y "%jarPath%.new" "%jarPath%" > nul 2>&1 + del /f /q "%jarPath%.new" +) + +rem Find/get a JDK +set JAVA_EXEC= +if not "%JAVA_HOME%"=="" ( + rem Determine if a (working) JDK is available in JAVA_HOME + if exist "%JAVA_HOME%\bin\javac.exe" ( + set JAVA_EXEC="%JAVA_HOME%\bin\java.exe" + ) else ( + echo JAVA_HOME is set but does not seem to point to a valid Java JDK 1>&2 + ) +) +if "!JAVA_EXEC!"=="" ( + rem Determine if a (working) JDK is available on the PATH + where javac > nul 2>&1 + if !errorlevel! equ 0 ( + set JAVA_HOME= + set JAVA_EXEC=java.exe + ) else if exist "%JBDIR%\currentjdk\bin\javac" ( + set JAVA_HOME=%JBDIR%\currentjdk + set JAVA_EXEC=%JBDIR%\currentjdk\bin\java + ) else ( + set JAVA_HOME=%TDIR%\jdks\%javaVersion% + set JAVA_EXEC=!JAVA_HOME!\bin\java.exe + rem Check if we installed a JDK before + if not exist "%TDIR%\jdks\%javaVersion%" ( + rem If not, download and install it + echo powershell -NoProfile -ExecutionPolicy Bypass -NonInteractive -Command "%~dp0jbang.ps1 jdk install %JBANG_DEFAULT_JAVA_VERSION%" + if !ERRORLEVEL! NEQ 0 ( exit /b %ERRORLEVEL% ) + rem Set the current JDK + !JAVA_EXEC! -classpath "%jarPath%" dev.jbang.Main jdk default "%javaVersion%" + ) + ) +) + +if not exist "%TDIR%" ( mkdir "%TDIR%" ) +set tmpfile=%TDIR%\%RANDOM%.jbang.tmp +rem execute jbang and pipe to temporary random file +set JBANG_RUNTIME_SHELL=cmd +2>nul >nul timeout /t 0 && (set JBANG_STDIN_NOTTY=false) || (set JBANG_STDIN_NOTTY=true) +set "CMD=!JAVA_EXEC!" +SETLOCAL DISABLEDELAYEDEXPANSION +%CMD% > "%tmpfile%" %JBANG_JAVA_OPTIONS% -classpath "%jarPath%" dev.jbang.Main %* +set ERROR=%ERRORLEVEL% +rem catch errorlevel straight after; rem or FOR /F swallow would have swallowed the errorlevel + +if %ERROR% EQU 255 ( + rem read generated java command by jang, delete temporary file and execute. + for %%A in ("%tmpfile%") do for /f "usebackq delims=" %%B in (%%A) do ( + set "OUTPUT=%%B" + goto :break + ) +:break + del /f /q "%tmpfile%" + %OUTPUT% + exit /b %ERRORLEVEL% +) else ( + type "%tmpfile%" + del /f /q "%tmpfile%" + exit /b %ERROR% +) diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/codestart.yml new file mode 100644 index 0000000000000..f74c6c6c37ef8 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus-jbang/tooling/jbang-wrapper/codestart.yml @@ -0,0 +1,5 @@ +name: jbang-wrapper +type: tooling +output-strategy: + "jbang": "executable" + "jbang.cmd": "executable" \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/.dockerignore.tpl.qute b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/.dockerignore.tpl.qute new file mode 100644 index 0000000000000..cbc0ab2aa6fa6 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/.dockerignore.tpl.qute @@ -0,0 +1,5 @@ +* +!{buildtool.build-dir}/*-runner +!{buildtool.build-dir}/*-runner.jar +!{buildtool.build-dir}/lib/* +!{buildtool.build-dir}/quarkus-app/* \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute new file mode 100644 index 0000000000000..760c3c59565da --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute @@ -0,0 +1,101 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# {#insert quarkusbuild /} +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.{type} -t quarkus/{project.artifact-id}-{type} . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id}-{type} +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id}-{type} +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") - Be aware that this will override +# the default JVM options, use `JAVA_OPTS_APPEND` to append options +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +{#if dockerfile.jvm.from-template} +FROM {#eval dockerfile.jvm.from-template /} +{#else if dockerfile.jvm.from} +FROM {dockerfile.jvm.from} +{#else} +FROM registry.access.redhat.com/ubi8/openjdk-{java.version}:1.23 +{/if} + +ENV LANGUAGE='en_US:en' + +{#insert copy /} + +EXPOSE 8080 +USER 185 +{#if java.version == '11'} +ENV AB_JOLOKIA_OFF="" +{/if} +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.jvm b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.jvm new file mode 100644 index 0000000000000..bcd1e2e6f711a --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.jvm @@ -0,0 +1,11 @@ +{#include Dockerfile-layout type='jvm'} + {#quarkusbuild}{buildtool.cli} {buildtool.cmd.package}{/quarkusbuild} + {#copy} +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 {buildtool.build-dir}/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 {buildtool.build-dir}/quarkus-app/*.jar /deployments/ +COPY --chown=185 {buildtool.build-dir}/quarkus-app/app/ /deployments/app/ +COPY --chown=185 {buildtool.build-dir}/quarkus-app/quarkus/ /deployments/quarkus/ + {/copy} +{/include} + diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.legacy-jar b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.legacy-jar new file mode 100644 index 0000000000000..a1c61bb037cc3 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.legacy-jar @@ -0,0 +1,7 @@ +{#include Dockerfile-layout type='legacy-jar'} + {#quarkusbuild}{buildtool.cli} {buildtool.cmd.package-legacy-jar}{/quarkusbuild} + {#copy} +COPY {buildtool.build-dir}/lib/* /deployments/lib/ +COPY {buildtool.build-dir}/*-runner.jar /deployments/quarkus-run.jar + {/copy} +{/include} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native new file mode 100644 index 0000000000000..2a448888294a6 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native @@ -0,0 +1,29 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# {buildtool.cli} {buildtool.cmd.package-native} +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/{project.artifact-id} . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id} +# +# The ` {dockerfile.native.from}` base image is based on UBI 9. +# To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`. +### +FROM {dockerfile.native.from} +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root --chmod=0755 {buildtool.build-dir}/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native-micro b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native-micro new file mode 100644 index 0000000000000..fd6707f19dffa --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/src/main/docker/Dockerfile.tpl.qute.native-micro @@ -0,0 +1,32 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# {buildtool.cli} {buildtool.cmd.package-native} +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/{project.artifact-id} . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/{project.artifact-id} +# +# The `{dockerfile.native-micro.from}` base image is based on UBI 9. +# To use UBI 8, switch to `quay.io/quarkus/quarkus-micro-image:2.0`. +### +FROM {dockerfile.native-micro.from} +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root --chmod=0755 {buildtool.build-dir}/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml new file mode 100644 index 0000000000000..df807e43d53c9 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml @@ -0,0 +1,10 @@ +name: tooling-dockerfiles +type: tooling +language: + base: + data: + dockerfile: + native: + from: registry.access.redhat.com/ubi8/ubi-minimal:8.10 + native-micro: + from: quay.io/quarkus/quarkus-micro-image:2.0 diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/github-action/base/.github/workflows/ci.tpl.qute.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/github-action/base/.github/workflows/ci.tpl.qute.yml new file mode 100644 index 0000000000000..12bce94bde7b5 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/github-action/base/.github/workflows/ci.tpl.qute.yml @@ -0,0 +1,34 @@ +## A basic GitHub Actions workflow for your Quarkus application. + +name: CI build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - name: Set up JDK {java.version} + uses: actions/setup-java@v4 + with: + java-version: {java.version} + distribution: temurin + {#if buildtool.cli.contains('gradle')} + cache: gradle + {#else} + cache: maven + {/if} + + {#if buildtool.cli.contains('gradle')} + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + {/if} + - name: Build + run: {buildtool.cli} {buildtool.cmd.build-ci} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/github-action/codestart.yml b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/github-action/codestart.yml new file mode 100644 index 0000000000000..f06f313d8cca1 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/github-action/codestart.yml @@ -0,0 +1,2 @@ +name: tooling-github-action +type: tooling diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/.gitkeep b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/..gitignore b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/..gitignore new file mode 100644 index 0000000000000..e72f5e8b737c2 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/..gitignore @@ -0,0 +1 @@ +maven-wrapper.jar diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/MavenWrapperDownloader.tpl.qute.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/MavenWrapperDownloader.tpl.qute.java new file mode 100644 index 0000000000000..14242f890974b --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/MavenWrapperDownloader.tpl.qute.java @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.IOException; +import java.io.InputStream; +import java.net.Authenticator; +import java.net.PasswordAuthentication; +import java.net.URI; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.ThreadLocalRandom; + +public final class MavenWrapperDownloader { + private static final String WRAPPER_VERSION = "{maven.wrapper-version}"; + + private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE")); + + public static void main(String[] args) { + log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION); + + if (args.length != 2) { + System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing"); + System.exit(1); + } + + try { + log(" - Downloader started"); + final URL wrapperUrl = URI.create(args[0]).toURL(); + final String jarPath = args[1].replace("..", ""); // Sanitize path + final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize(); + downloadFileFromURL(wrapperUrl, wrapperJarPath); + log("Done"); + } catch (IOException e) { + System.err.println("- Error downloading: " + e.getMessage()); + if (VERBOSE) { + e.printStackTrace(); + } + System.exit(1); + } + } + + private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath) + throws IOException { + log(" - Downloading to: " + wrapperJarPath); + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + final String username = System.getenv("MVNW_USERNAME"); + final char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + Path temp = wrapperJarPath + .getParent() + .resolve(wrapperJarPath.getFileName() + "." + + Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp"); + try (InputStream inStream = wrapperUrl.openStream()) { + Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING); + Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING); + } finally { + Files.deleteIfExists(temp); + } + log(" - Downloader complete"); + } + + private static void log(String msg) { + if (VERBOSE) { + System.out.println(msg); + } + } + +} diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/maven-wrapper.tpl.qute.properties b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/maven-wrapper.tpl.qute.properties new file mode 100644 index 0000000000000..b035f81874146 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/.mvn/wrapper/maven-wrapper.tpl.qute.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion={maven.wrapper-version} +distributionType=source +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/{maven.version}/apache-maven-{maven.version}-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/{maven.wrapper-version}/maven-wrapper-{maven.wrapper-version}.jar \ No newline at end of file diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/mvnw.tpl.qute b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/mvnw.tpl.qute new file mode 100755 index 0000000000000..600b9f50bc36d --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/mvnw.tpl.qute @@ -0,0 +1,332 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version {maven.wrapper-version} +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ]; then + + if [ -f /usr/local/etc/mavenrc ]; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ]; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ]; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false +darwin=false +mingw=false +case "$(uname)" in +CYGWIN*) cygwin=true ;; +MINGW*) mingw=true ;; +Darwin*) + darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)" + export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home" + export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ]; then + if [ -r /etc/gentoo-release ]; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin; then + [ -n "$JAVA_HOME" ] \ + && JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] \ + && CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] \ + && JAVA_HOME="$( + cd "$JAVA_HOME" || ( + echo "cannot cd into $JAVA_HOME." >&2 + exit 1 + ) + pwd + )" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "$javaExecutable" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin; then + javaHome="$(dirname "$javaExecutable")" + javaExecutable="$(cd "$javaHome" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "$javaExecutable")" + fi + javaHome="$(dirname "$javaExecutable")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ]; then + if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$( + \unset -f command 2>/dev/null + \command -v java + )" + fi +fi + +if [ ! -x "$JAVACMD" ]; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ]; then + echo "Warning: JAVA_HOME environment variable is not set." >&2 +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ]; then + echo "Path not specified to find_maven_basedir" >&2 + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ]; do + if [ -d "$wdir"/.mvn ]; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "$\{wdir}" ]; then + wdir=$( + cd "$wdir/.." || exit 1 + pwd + ) + fi + # end of workaround + done + printf '%s' "$( + cd "$basedir" || exit 1 + pwd + )" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' <"$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1 +fi + +MAVEN_PROJECTBASEDIR=$\{MAVEN_BASEDIR:-"$BASE_DIR"} +export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/{maven.wrapper-version}/maven-wrapper-{maven.wrapper-version}.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/{maven.wrapper-version}/maven-wrapper-{maven.wrapper-version}.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in wrapperUrl) + wrapperUrl="$safeValue" + break + ;; + esac + done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget >/dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl >/dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in wrapperSha256Sum) + wrapperSha256Sum=$value + break + ;; + esac +done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum >/dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c >/dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c >/dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] \ + && JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] \ + && CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] \ + && MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=$\{MAVEN_PROJECTBASEDIR}" \ + $\{WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/mvnw.tpl.qute.cmd b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/mvnw.tpl.qute.cmd new file mode 100644 index 0000000000000..0fcacfb859760 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/base/mvnw.tpl.qute.cmd @@ -0,0 +1,206 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version {maven.wrapper-version} +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. >&2 +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. >&2 +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. >&2 +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. >&2 +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/{maven.wrapper-version}/maven-wrapper-{maven.wrapper-version}.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/{maven.wrapper-version}/maven-wrapper-{maven.wrapper-version}.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash;"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/codestarts/tooling/wrapper/GradleWrapperVersionTest.java b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/codestarts/tooling/wrapper/GradleWrapperVersionTest.java new file mode 100644 index 0000000000000..ca02f7652ec17 --- /dev/null +++ b/devtools/project-core-extension-codestarts/src/test/java/io/quarkus/codestarts/tooling/wrapper/GradleWrapperVersionTest.java @@ -0,0 +1,34 @@ +package io.quarkus.codestarts.tooling.wrapper; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Properties; + +import org.junit.jupiter.api.Test; + +public class GradleWrapperVersionTest { + + /** + * Assert that the bundled Gradle wrapper version matches ${gradle-wrapper.version} POM property value. + */ + @Test + public void testBundledGradleWrapperVersion() { + final Path wrapperPropsPath = Path + .of("target/classes/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.properties"); + assertThat(wrapperPropsPath).exists(); + + final Properties wrapperProps = new Properties(); + try (BufferedReader reader = Files.newBufferedReader(wrapperPropsPath)) { + wrapperProps.load(reader); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + assertThat(wrapperProps).hasEntrySatisfying("distributionUrl", + value -> assertThat(value.toString()).contains("gradle-" + System.getProperty("gradle-wrapper.version"))); + } +} diff --git a/docs/src/main/asciidoc/rest-client.adoc b/docs/src/main/asciidoc/rest-client.adoc index 5f12ff09309c0..d587834b2235e 100644 --- a/docs/src/main/asciidoc/rest-client.adoc +++ b/docs/src/main/asciidoc/rest-client.adoc @@ -1861,8 +1861,6 @@ To enable logging, add the `quarkus.rest-client.logging.scope` property to your As HTTP messages can have large bodies, we limit the amount of body characters logged. The default limit is `100`, you can change it by specifying `quarkus.rest-client.logging.body-limit`. -NOTE: REST Client is logging the traffic with level DEBUG and does not alter logger properties. You may need to adjust your logger configuration to use this feature. - These configuration properties work globally for all clients injected by CDI. If you want configure logging for a specific declarative client, you should do it by specifying named "client" properties, also known as `quarkus.rest-client."client".logging.*` properties. @@ -1874,9 +1872,6 @@ quarkus.rest-client.logging.scope=request-response quarkus.rest-client.logging.body-limit=50 quarkus.rest-client.extensions-api.scope=all - -quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG -quarkus.log.console.level=DEBUG ---- [TIP] diff --git a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc index 98bbaa5acbddc..9a096e7c146d2 100644 --- a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc @@ -603,7 +603,7 @@ testImplementation("io.quarkus:quarkus-junit5") The preferred approach for integration testing against Keycloak is xref:security-openid-connect-dev-services.adoc[Dev Services for Keycloak]. `Dev Services for Keycloak` will start and initialize a test container. -Then, it will create a `quarkus` realm and a `quarkus-app` client (`secret` secret) and add `alice` (`admin` and `user` roles) and `bob` (`user` role) users, where all of these properties can be customized. +Then, it will create a `quarkus` realm and a `quarkus-app` client with `secret` as the client secret. It will also add two users: `alice` with both `admin` and `user` roles, and `bob` with the `user` role. All of these properties can be customized. First, add the following dependency, which provides a utility class `io.quarkus.test.keycloak.client.KeycloakTestClient` that you can use in tests for acquiring the access tokens: @@ -626,7 +626,7 @@ testImplementation("io.quarkus:quarkus-test-keycloak-server") Next, prepare your `application.properties` configuration file. You can start with an empty `application.properties` file because `Dev Services for Keycloak` registers `quarkus.oidc.auth-server-url` and points it to the running test container, `quarkus.oidc.client-id=quarkus-app`, and `quarkus.oidc.credentials.secret=secret`. -However, if you have already configured the required `quarkus-oidc` properties, then you only need to associate `quarkus.oidc.auth-server-url` with the `prod` profile for `Dev Services for Keycloak`to start a container, as shown in the following example: +However, if you have already configured the required `quarkus-oidc` properties, then you only need to associate `quarkus.oidc.auth-server-url` with the `prod` profile for `Dev Services for Keycloak` to start a container, as shown in the following example: [source,properties] ---- diff --git a/docs/src/main/asciidoc/security-openid-connect-providers.adoc b/docs/src/main/asciidoc/security-openid-connect-providers.adoc index 0d1e3c81f5246..1467eb1661596 100644 --- a/docs/src/main/asciidoc/security-openid-connect-providers.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-providers.adoc @@ -25,7 +25,7 @@ The configuration of such providers can become complex, very technical and diffi `quarkus.oidc.provider` configuration property has been introduced to refer to well-known OpenID Connect and OAuth2 providers. This property can be used to refer to a provider such as `github` with only a minimum number of customizations required, typically, an account specific `client id`, `client secret` and some properties have to be set to complete the configuration. -This property can be used in `application.properties`, in xref:security-openid-connect-multitenancy.adoc[multi-tenant] set-ups if more than one provider has to be configured (for example, see https://docs.quarkiverse.io/quarkus-renarde/dev/security.html#_using_oidc_for_login[Quarkus Renarde security documentation]), in custom xref:security-openid-connect-multitenancy.adoc#tenant-config-resolver[TenantConfigResolvers] if the tenant configurations are created dynamically. +This property can be used in `application.properties` and in custom xref:security-openid-connect-multitenancy.adoc#tenant-config-resolver[TenantConfigResolvers] if the tenant configurations are created dynamically. == Well Known Providers diff --git a/docs/src/main/asciidoc/upx.adoc b/docs/src/main/asciidoc/upx.adoc index 63f84d7d81949..0475289a419ce 100644 --- a/docs/src/main/asciidoc/upx.adoc +++ b/docs/src/main/asciidoc/upx.adoc @@ -38,7 +38,7 @@ If you want to force compression to take place in a container, you can set `quar If you are not in one of these cases, the compression fails. Setting `quarkus.native.compression.container-image` results in the compression to run in a container. -If you want to set the variable, but not run the compression in a container, set `quakrus.native.compression.container-build` explicitly to `false`. +If you want to set the variable, but not run the compression in a container, set `quarkus.native.compression.container-build` explicitly to `false`. [IMPORTANT] .`WORKDIR` for the image used for compression diff --git a/docs/src/main/asciidoc/web.adoc b/docs/src/main/asciidoc/web.adoc index 76b7e803e9a0d..6b753a137cd84 100644 --- a/docs/src/main/asciidoc/web.adoc +++ b/docs/src/main/asciidoc/web.adoc @@ -83,9 +83,9 @@ Here is a simple example of a Qute template: === Model-View-Controller (MVC) -The MVC approach is also made very easy with Quarkus thanks to https://docs.quarkiverse.io/quarkus-renarde/dev/index.html[the Renarde extension], a Rails-like framework using Qute. +The MVC approach is also made very easy with Quarkus thanks to Qute. -Associated with the https://docs.quarkiverse.io/quarkus-web-bundler/dev/[Web Bundler extension], the road is open to build modern web applications for all your needs. Here is what a simple Renarde controller looks like: +Associated with the https://docs.quarkiverse.io/quarkus-web-bundler/dev/[Web Bundler extension], the road is open to build modern web applications for all your needs. .src/main/java/rest/Todos.java [source,java] @@ -155,7 +155,7 @@ public class Todos extends Controller { } ---- -NOTE: Check out https://www.youtube.com/watch?v=JNmHNSmK180[Quarkus Insights Episode #178]. First part is a hands-on demonstration of creating a CMS with Renarde. You can also give it a try using https://github.com/quarkusio/quarkus-web-lab[the web-lab repo]). +NOTE: Check out https://www.youtube.com/watch?v=JNmHN5mK180[Quarkus Insights Episode #178]. You can also give it a try using https://github.com/quarkusio/quarkus-web-lab[the web-lab repo]. == Single Page Applications diff --git a/extensions/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java b/extensions/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java index e89345a573a41..25f4ae4ae2e1d 100644 --- a/extensions/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java +++ b/extensions/agroal/runtime-dev/src/main/java/io/quarkus/agroal/runtime/dev/ui/DatabaseInspector.java @@ -441,6 +441,9 @@ private boolean isAllowedDatabase(AgroalDataSource ads) { return true; } + if (ads == null) + return false; + try { AgroalDataSourceConfiguration configuration = ads.getConfiguration(); String jdbcUrl = configuration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcUrl(); @@ -452,7 +455,7 @@ private boolean isAllowedDatabase(AgroalDataSource ads) { return true; } - String cleanUrl = jdbcUrl.replace("jdbc:", ""); + String cleanUrl = jdbcUrl.replace("jdbc:", "").replaceFirst(";", "?").replace(";", "&"); URI uri = new URI(cleanUrl); String host = uri.getHost(); diff --git a/extensions/devservices/keycloak/src/main/java/io/quarkus/devservices/keycloak/KeycloakDevServicesProcessor.java b/extensions/devservices/keycloak/src/main/java/io/quarkus/devservices/keycloak/KeycloakDevServicesProcessor.java index 8238f14659e3c..abd94bf7c1b9f 100644 --- a/extensions/devservices/keycloak/src/main/java/io/quarkus/devservices/keycloak/KeycloakDevServicesProcessor.java +++ b/extensions/devservices/keycloak/src/main/java/io/quarkus/devservices/keycloak/KeycloakDevServicesProcessor.java @@ -543,7 +543,7 @@ protected void configure() { if (useSharedNetwork) { if (keycloakX) { - addEnv(KEYCLOAK_QUARKUS_HOSTNAME, "http://" + hostName + ":" + KEYCLOAK_PORT); + addEnv(KEYCLOAK_QUARKUS_HOSTNAME, (isHttps() ? "https://" : "http://") + hostName + ":" + KEYCLOAK_PORT); } else { addEnv(KEYCLOAK_WILDFLY_FRONTEND_URL, "http://localhost:" + fixedExposedPort.getAsInt()); } diff --git a/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/PageBuilder.java b/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/PageBuilder.java index c1d7e3abd469c..bfad5e5136e58 100644 --- a/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/PageBuilder.java +++ b/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/PageBuilder.java @@ -111,6 +111,12 @@ public T namespace(String namespace) { return (T) this; } + @SuppressWarnings("unchecked") + public T namespaceLabel(String namespaceLabel) { + this.namespaceLabel = namespaceLabel; + return (T) this; + } + @SuppressWarnings("unchecked") public T internal() { return this.internal(null); diff --git a/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/DevUIProcessor.java b/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/DevUIProcessor.java index 75582a2c13974..01d12c5a8d081 100644 --- a/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/DevUIProcessor.java +++ b/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/DevUIProcessor.java @@ -889,7 +889,6 @@ void getAllExtensions(List cardPageBuildItems, for (PageBuilder pageBuilder : footerPageBuilders) { pageBuilder.namespace(deploymentOnlyExtension.getNamespace()); pageBuilder.extension(deploymentOnlyExtension.getName()); - pageBuilder.internal(); Page page = pageBuilder.build(); deploymentOnlyExtension.addFooterPage(page); } @@ -913,7 +912,6 @@ void getAllExtensions(List cardPageBuildItems, for (PageBuilder pageBuilder : settingPageBuilders) { pageBuilder.namespace(deploymentOnlyExtension.getNamespace()); pageBuilder.extension(deploymentOnlyExtension.getName()); - pageBuilder.internal(); Page page = pageBuilder.build(); deploymentOnlyExtension.addSettingPage(page); } @@ -937,7 +935,6 @@ void getAllExtensions(List cardPageBuildItems, for (PageBuilder pageBuilder : unlistedPageBuilders) { pageBuilder.namespace(deploymentOnlyExtension.getNamespace()); pageBuilder.extension(deploymentOnlyExtension.getName()); - pageBuilder.internal(); Page page = pageBuilder.build(); deploymentOnlyExtension.addUnlistedPage(page); } diff --git a/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/MCPProcessor.java b/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/MCPProcessor.java index 3d0d3c259425d..a9c9e1387a39d 100644 --- a/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/MCPProcessor.java +++ b/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/MCPProcessor.java @@ -36,6 +36,7 @@ void createMCPPage(BuildProducer settingPageProducer, mcpSettingTab.addPage(Page.webComponentPageBuilder() .namespace(NS_MCP) + .internal("Dev MCP") .title("Dev MCP") .icon("font-awesome-solid:robot") .componentLink("qwc-dev-mcp-setting.js")); @@ -45,11 +46,13 @@ void createMCPPage(BuildProducer settingPageProducer, mcpOtherPages.addPage(Page.webComponentPageBuilder() .namespace(NS_MCP) + .internal("Dev MCP") .title("Tools") .icon("font-awesome-solid:screwdriver-wrench") .componentLink("qwc-dev-mcp-tools.js")); mcpOtherPages.addPage(Page.webComponentPageBuilder() .namespace(NS_MCP) + .internal("Dev MCP") .title("Resources") .icon("font-awesome-solid:file-invoice") .componentLink("qwc-dev-mcp-resources.js")); diff --git a/extensions/devui/resources/src/main/resources/dev-ui/qwc/qwc-extensions.js b/extensions/devui/resources/src/main/resources/dev-ui/qwc/qwc-extensions.js index ecf800ba5ed65..52eb2d048f4a1 100644 --- a/extensions/devui/resources/src/main/resources/dev-ui/qwc/qwc-extensions.js +++ b/extensions/devui/resources/src/main/resources/dev-ui/qwc/qwc-extensions.js @@ -233,7 +233,7 @@ export class QwcExtensions extends observeState(LitElement) { let logoUrl = this._getLogoUrl(extension); return html` > constraintViolations = validator.validate(new MyNonEntity()); + if (constraintViolations.size() != 1) { + return "ko"; + } + if (!constraintViolations.iterator().next().getPropertyPath().toString().equals("name")) { + return "ko"; + } + return "ok"; + } + + @Path("/value") + @GET + public String value() { + Set> constraintViolations = validator.validateValue(MyNonEntity.class, "name", null); + if (constraintViolations.size() != 1) { + return "ko"; + } + if (!constraintViolations.iterator().next().getPropertyPath().toString().equals("name")) { + return "ko"; + } + return "ok"; + } + + public static class MyNonEntity { + @NotNull + public String name; + } +} diff --git a/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/validation/JPATestValidationOfNonEntitiesTestCase.java b/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/validation/JPATestValidationOfNonEntitiesTestCase.java new file mode 100644 index 0000000000000..a8de475f2fdda --- /dev/null +++ b/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/validation/JPATestValidationOfNonEntitiesTestCase.java @@ -0,0 +1,33 @@ +package io.quarkus.hibernate.orm.validation; + +import static org.hamcrest.Matchers.is; + +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.hibernate.orm.MyEntity; +import io.quarkus.test.QuarkusUnitTest; +import io.restassured.RestAssured; + +public class JPATestValidationOfNonEntitiesTestCase { + + @RegisterExtension + static QuarkusUnitTest runner = new QuarkusUnitTest() + .withApplicationRoot((jar) -> jar + .addClasses(MyEntity.class, JPATestValidationOfNonEntitiesResource.class) + .addAsResource("application.properties") + .addAsResource(new StringAsset(""), "import.sql")); // define an empty import.sql file + + @Test + public void testValueValidation() { + RestAssured.given().when().get("validation/nonentity/value").then() + .body(is("ok")); + } + + @Test + public void testBeanValidation() { + RestAssured.given().when().get("validation/nonentity/bean").then() + .body(is("ok")); + } +} diff --git a/extensions/hibernate-orm/runtime-dev/src/main/java/io/quarkus/hibernate/orm/dev/ui/HibernateOrmDevJsonRpcService.java b/extensions/hibernate-orm/runtime-dev/src/main/java/io/quarkus/hibernate/orm/dev/ui/HibernateOrmDevJsonRpcService.java index c78a52c5e541e..e6c0ce4d64ffa 100644 --- a/extensions/hibernate-orm/runtime-dev/src/main/java/io/quarkus/hibernate/orm/dev/ui/HibernateOrmDevJsonRpcService.java +++ b/extensions/hibernate-orm/runtime-dev/src/main/java/io/quarkus/hibernate/orm/dev/ui/HibernateOrmDevJsonRpcService.java @@ -305,23 +305,25 @@ private boolean isAllowedDatabase(AgroalDataSource ads) { return true; } + if (ads == null) + return false; + AgroalDataSourceConfiguration configuration = ads.getConfiguration(); String jdbcUrl = configuration.connectionPoolConfiguration().connectionFactoryConfiguration().jdbcUrl(); - try { - if (jdbcUrl.startsWith("jdbc:h2:mem:") || jdbcUrl.startsWith("jdbc:h2:file:") - || jdbcUrl.startsWith("jdbc:h2:tcp://localhost") - || (allowedHost != null && !allowedHost.isBlank() - && jdbcUrl.startsWith("jdbc:h2:tcp://" + allowedHost)) - || jdbcUrl.startsWith("jdbc:derby:memory:")) { - return true; - } + if (jdbcUrl.startsWith("jdbc:h2:mem:") || jdbcUrl.startsWith("jdbc:h2:file:") + || jdbcUrl.startsWith("jdbc:h2:tcp://localhost") + || (allowedHost != null && !allowedHost.isBlank() + && jdbcUrl.startsWith("jdbc:h2:tcp://" + allowedHost)) + || jdbcUrl.startsWith("jdbc:derby:memory:")) { + return true; + } - String cleanUrl = jdbcUrl.replace("jdbc:", ""); - URI uri = new URI(cleanUrl); + String cleanUrl = jdbcUrl.replace("jdbc:", "").replaceFirst(";", "?").replace(";", "&"); + try { + URI uri = new URI(cleanUrl); String host = uri.getHost(); - return host != null && ((host.equals("localhost") || host.equals("127.0.0.1") || host.equals("::1")) || (allowedHost != null && !allowedHost.isBlank() && host.equalsIgnoreCase(allowedHost))); diff --git a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/PersistenceUnitUtil.java b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/PersistenceUnitUtil.java index ec237c1e50bb0..446c2325672e6 100644 --- a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/PersistenceUnitUtil.java +++ b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/PersistenceUnitUtil.java @@ -25,6 +25,14 @@ public static boolean isDefaultPersistenceUnit(String name) { return DEFAULT_PERSISTENCE_UNIT_NAME.equals(name); } + public static Annotation qualifier(String persistenceUnitName) { + if (isDefaultPersistenceUnit(persistenceUnitName)) { + return Default.Literal.INSTANCE; + } else { + return new PersistenceUnit.PersistenceUnitLiteral(persistenceUnitName); + } + } + public static InjectableInstance singleExtensionInstanceForPersistenceUnit(Class beanType, String persistenceUnitName, Annotation... additionalQualifiers) { diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/MultiplePersistenceUnitsDefaultDisabledTest.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/MultiplePersistenceUnitsDefaultDisabledTest.java deleted file mode 100644 index 076840ad58822..0000000000000 --- a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/MultiplePersistenceUnitsDefaultDisabledTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package io.quarkus.hibernate.reactive.multiplepersistencenunits; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import jakarta.inject.Inject; -import jakarta.transaction.Transactional; - -import org.hibernate.reactive.mutiny.Mutiny; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; - -import io.quarkus.arc.Arc; -import io.quarkus.hibernate.orm.PersistenceUnit; -import io.quarkus.hibernate.reactive.multiplepersistencenunits.model.config.DefaultEntity; -import io.quarkus.hibernate.reactive.multiplepersistencenunits.model.config.inventory.Plane; -import io.quarkus.hibernate.reactive.multiplepersistencenunits.model.config.user.User; -import io.quarkus.test.QuarkusUnitTest; - -public class MultiplePersistenceUnitsDefaultDisabledTest { - - @RegisterExtension - static QuarkusUnitTest runner = new QuarkusUnitTest() - .withApplicationRoot((jar) -> jar - .addClass(DefaultEntity.class) - .addClass(User.class) - .addClass(Plane.class) - .addAsResource("application-multiple-persistence-units-default-disabled.properties", - "application.properties")); - - @Inject - @PersistenceUnit("users") - Mutiny.SessionFactory usersEntityManager; - - @Inject - @PersistenceUnit("inventory") - Mutiny.SessionFactory inventoryEntityManager; - - @Test - @Transactional - public void defaultEntityManagerNotCreated() { - assertNotNull(usersEntityManager); - assertNotNull(inventoryEntityManager); - - Mutiny.SessionFactory defaultEntityManager = Arc.container().instance(Mutiny.SessionFactory.class).get(); - assertThat(defaultEntityManager).isNull(); - } -} diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/BaseMultiplePersistenceUnitTest.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/BaseMultiplePersistenceUnitTest.java new file mode 100644 index 0000000000000..075138de77089 --- /dev/null +++ b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/BaseMultiplePersistenceUnitTest.java @@ -0,0 +1,23 @@ +package io.quarkus.hibernate.reactive.multiplepersistenceunits; + +import org.hibernate.reactive.mutiny.Mutiny; + +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.inventory.Plane; +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.user.User; +import io.smallrye.mutiny.Uni; + +public class BaseMultiplePersistenceUnitTest { + protected Uni fetchPlane(Mutiny.SessionFactory sessionFactory) { + return sessionFactory + .withTransaction(session -> session.createQuery("select p from Plane p where p.name = :name", Plane.class) + .setParameter("name", "plane") + .getSingleResult()); + } + + protected Uni fetchUser(Mutiny.SessionFactory sessionFactory) { + return sessionFactory + .withTransaction(session -> session.createQuery("select u from User u where u.name = :name", User.class) + .setParameter("name", "user") + .getSingleResult()); + } +} diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/MultiplePersistenceUnitsDefaultDisabledTest.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/MultiplePersistenceUnitsDefaultDisabledTest.java new file mode 100644 index 0000000000000..10aaf44348ebe --- /dev/null +++ b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/MultiplePersistenceUnitsDefaultDisabledTest.java @@ -0,0 +1,76 @@ +package io.quarkus.hibernate.reactive.multiplepersistenceunits; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import jakarta.inject.Inject; +import jakarta.transaction.Transactional; + +import org.hibernate.reactive.mutiny.Mutiny; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.arc.Arc; +import io.quarkus.hibernate.orm.PersistenceUnit; +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.DefaultEntity; +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.inventory.Plane; +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.user.User; +import io.quarkus.test.QuarkusUnitTest; +import io.quarkus.test.vertx.RunOnVertxContext; +import io.quarkus.test.vertx.UniAsserter; +import io.smallrye.mutiny.Uni; + +public class MultiplePersistenceUnitsDefaultDisabledTest extends BaseMultiplePersistenceUnitTest { + + @RegisterExtension + static QuarkusUnitTest runner = new QuarkusUnitTest() + .withApplicationRoot((jar) -> jar + .addClass(DefaultEntity.class) + .addClass(User.class) + .addClass(Plane.class) + .addAsResource("application-multiple-persistence-units-default-disabled.properties", + "application.properties")); + @Inject + @PersistenceUnit("users") + Mutiny.SessionFactory usersEntityManager; + + @Inject + @PersistenceUnit("inventory") + Mutiny.SessionFactory inventoryEntityManager; + + @Test + public void defaultEntityManagerNotCreated() { + assertNotNull(usersEntityManager); + assertNotNull(inventoryEntityManager); + + Mutiny.SessionFactory defaultEntityManager = Arc.container().instance(Mutiny.SessionFactory.class).get(); + assertThat(defaultEntityManager).isNull(); + } + + @Test + @Transactional + @RunOnVertxContext + public void createEntityAndRefetch(UniAsserter uniAsserter) { + assertNotNull(usersEntityManager); + assertNotNull(inventoryEntityManager); + + User userEntity = new User("user"); + Plane inventoryEntity = new Plane("plane"); + + Uni resultUnit = usersEntityManager.withTransaction(s -> s.persist(userEntity)) + .flatMap(a -> inventoryEntityManager.withTransaction(s -> s.persist(inventoryEntity))) + .flatMap(a -> { + Uni fetchedUser = fetchUser(usersEntityManager); + Uni fetchedPlane = fetchPlane(inventoryEntityManager); + + return Uni.combine().all().unis(fetchedUser, fetchedPlane).asTuple() + .map(tuple -> tuple.getItem1().getName() + " " + tuple.getItem2().getName()); + + }); + + uniAsserter.assertThat(() -> resultUnit, t -> { + assertEquals("user plane", t); + }); + } +} diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/MultiplePersistenceUnitsTest.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/MultiplePersistenceUnitsTest.java new file mode 100644 index 0000000000000..157be3bb5949e --- /dev/null +++ b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/MultiplePersistenceUnitsTest.java @@ -0,0 +1,62 @@ +package io.quarkus.hibernate.reactive.multiplepersistenceunits; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import jakarta.inject.Inject; +import jakarta.transaction.Transactional; + +import org.hibernate.reactive.mutiny.Mutiny; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.hibernate.orm.PersistenceUnit; +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.inventory.Plane; +import io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.user.User; +import io.quarkus.test.QuarkusUnitTest; +import io.quarkus.test.vertx.RunOnVertxContext; +import io.quarkus.test.vertx.UniAsserter; +import io.smallrye.mutiny.Uni; + +public class MultiplePersistenceUnitsTest extends BaseMultiplePersistenceUnitTest { + + @RegisterExtension + static QuarkusUnitTest runner = new QuarkusUnitTest() + .withApplicationRoot((jar) -> jar + .addClass(User.class) + .addClass(Plane.class) + .addAsResource("application-multiple-persistence-units-with-default.properties", + "application.properties")); + @Inject + Mutiny.SessionFactory defaultEntityManager; + + @Inject + @PersistenceUnit("inventory") + Mutiny.SessionFactory inventoryEntityManager; + + @Test + @Transactional + @RunOnVertxContext + public void createEntityAndRefetch(UniAsserter uniAsserter) { + assertNotNull(defaultEntityManager); + assertNotNull(inventoryEntityManager); + + User userEntity = new User("user"); + Plane inventoryEntity = new Plane("plane"); + + Uni resultUnit = this.defaultEntityManager.withTransaction(s -> s.persist(userEntity)) + .flatMap(a -> inventoryEntityManager.withTransaction(s -> s.persist(inventoryEntity))) + .flatMap(a -> { + Uni fetchedUser = fetchUser(defaultEntityManager); + Uni fetchedPlane = fetchPlane(inventoryEntityManager); + + return Uni.combine().all().unis(fetchedUser, fetchedPlane).asTuple() + .map(tuple -> tuple.getItem1().getName() + " " + tuple.getItem2().getName()); + + }); + + uniAsserter.assertThat(() -> resultUnit, t -> { + assertEquals("user plane", t); + }); + } +} diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/DefaultEntity.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/DefaultEntity.java similarity index 90% rename from extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/DefaultEntity.java rename to extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/DefaultEntity.java index a5283c46d8459..a4a2e2c663624 100644 --- a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/DefaultEntity.java +++ b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/DefaultEntity.java @@ -1,4 +1,4 @@ -package io.quarkus.hibernate.reactive.multiplepersistencenunits.model.config; +package io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/inventory/Plane.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/inventory/Plane.java similarity index 74% rename from extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/inventory/Plane.java rename to extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/inventory/Plane.java index 866f6d3dd35f0..b2923d80264bc 100644 --- a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/inventory/Plane.java +++ b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/inventory/Plane.java @@ -1,8 +1,7 @@ -package io.quarkus.hibernate.reactive.multiplepersistencenunits.model.config.inventory; +package io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.inventory; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; import jakarta.persistence.Id; @Entity @@ -20,7 +19,7 @@ public Plane(String name) { } @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "planeSeq") + @GeneratedValue public long getId() { return id; } diff --git a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/user/User.java b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/user/User.java similarity index 76% rename from extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/user/User.java rename to extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/user/User.java index beb87db79a781..735d3e21d7444 100644 --- a/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistencenunits/model/config/user/User.java +++ b/extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/multiplepersistenceunits/model/config/user/User.java @@ -1,8 +1,7 @@ -package io.quarkus.hibernate.reactive.multiplepersistencenunits.model.config.user; +package io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.user; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; @@ -22,7 +21,7 @@ public User(String name) { } @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "userSeq") + @GeneratedValue public long getId() { return id; } diff --git a/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-default-disabled.properties b/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-default-disabled.properties index 9b3ceccebda52..e2a4aa9f493ad 100644 --- a/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-default-disabled.properties +++ b/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-default-disabled.properties @@ -16,4 +16,4 @@ quarkus.hibernate-orm."users".packages=io.quarkus.hibernate.reactive.multipleper quarkus.hibernate-orm."inventory".schema-management.strategy=drop-and-create quarkus.hibernate-orm."inventory".datasource=inventory -quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.inventory \ No newline at end of file +quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.inventory diff --git a/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-with-default.properties b/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-with-default.properties new file mode 100644 index 0000000000000..a3827f32987f6 --- /dev/null +++ b/extensions/hibernate-reactive/deployment/src/test/resources/application-multiple-persistence-units-with-default.properties @@ -0,0 +1,18 @@ +quarkus.datasource.reactive=true +quarkus.datasource.reactive.url=${postgres.reactive.url} +quarkus.datasource.db-kind=postgresql +quarkus.datasource.username=hibernate_orm_test +quarkus.datasource.password=hibernate_orm_test + +quarkus.hibernate-orm.schema-management.strategy=drop-and-create +quarkus.hibernate-orm.packages=io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.user + +quarkus.datasource."inventory".reactive=true +quarkus.datasource."inventory".reactive.url=${postgres.reactive.url} +quarkus.datasource."inventory".db-kind=postgresql +quarkus.datasource."inventory".username=hibernate_orm_test +quarkus.datasource."inventory".password=hibernate_orm_test + +quarkus.hibernate-orm."inventory".datasource=inventory +quarkus.hibernate-orm."inventory".schema-management.strategy=drop-and-create +quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.reactive.multiplepersistenceunits.model.config.inventory diff --git a/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java b/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java index ba031ae12a4c2..7edd51b47c794 100644 --- a/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java +++ b/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/FastBootHibernateReactivePersistenceProvider.java @@ -17,6 +17,7 @@ import jakarta.persistence.spi.PersistenceUnitInfo; import jakarta.persistence.spi.ProviderUtil; +import org.hibernate.SessionFactory; import org.hibernate.boot.registry.StandardServiceInitiator; import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; @@ -257,13 +258,21 @@ private EntityManagerFactoryBuilder getEntityManagerFactoryBuilderOrNull(String final Object cdiBeanManager = Arc.container().beanManager(); final Object validatorFactory = Arc.container().instance("quarkus-hibernate-validator-factory").get(); + // See if there's an injectable Blocking (ORM) SessionFactory with the same name. + // In that case, migration has already been executed so no need to execute it twice + InjectableInstance instance = Arc.container().select( + org.hibernate.SessionFactory.class, + PersistenceUnitUtil.qualifier(persistenceUnitName)); + boolean blockingSessionFactoryExists = instance != null && instance.isResolvable() + && instance.getHandle().getBean().isActive(); + return new FastBootReactiveEntityManagerFactoryBuilder( persistenceUnit, metadata /* Uses the StandardServiceRegistry references by this! */, standardServiceRegistry /* Mostly ignored! (yet needs to match) */, runtimeSettings, validatorFactory, cdiBeanManager, recordedState.getMultiTenancyStrategy(), - PersistenceUnitsHolder.getPersistenceUnitDescriptors().size() == 1, + !blockingSessionFactoryExists, recordedState.getBuildTimeSettings().getSource().getBuiltinFormatMapperBehaviour(), recordedState.getBuildTimeSettings().getSource().getJsonFormatterCustomizationCheck()); } diff --git a/extensions/hibernate-validator/runtime/src/main/java/io/quarkus/hibernate/validator/runtime/HibernateValidatorRecorder.java b/extensions/hibernate-validator/runtime/src/main/java/io/quarkus/hibernate/validator/runtime/HibernateValidatorRecorder.java index 698a2fa7b3c94..2e1ab67c95811 100644 --- a/extensions/hibernate-validator/runtime/src/main/java/io/quarkus/hibernate/validator/runtime/HibernateValidatorRecorder.java +++ b/extensions/hibernate-validator/runtime/src/main/java/io/quarkus/hibernate/validator/runtime/HibernateValidatorRecorder.java @@ -306,6 +306,11 @@ static final class DelegatingTraversableResolver implements TraversableResolver @Override public boolean isReachable(Object entity, Path.Node traversableProperty, Class rootBeanType, Path pathToTraversableObject, ElementType elementType) { + if (entity == null) { + // The entity can be null if we are validating values, as that's when the validation context does not have the root object, + // In other cases we shouldn't even reach the traversable resolver when the validated bean/entity is null. + return true; + } return attributeLoadedPredicate.test(entity, traversableProperty.getName()); } diff --git a/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java b/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java index 707cd73ca97c3..6ea7ef031c57a 100644 --- a/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java +++ b/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java @@ -82,8 +82,6 @@ import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem; import io.quarkus.deployment.builditem.NativeImageFeatureBuildItem; -import io.quarkus.deployment.builditem.SystemPropertyBuildItem; -import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageSecurityProviderBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; @@ -135,6 +133,11 @@ NativeImageFeatureBuildItem nativeImageFeature() { return new NativeImageFeatureBuildItem(DisableLoggingFeature.class); } + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(Feature.INFINISPAN_CLIENT); + } + /** * Sets up additional properties for use when proto stream marshaller is in use */ @@ -171,18 +174,14 @@ private static void initMarshaller(String clientName, Optional marshalle InfinispanPropertiesBuildItem setup(ApplicationArchivesBuildItem applicationArchivesBuildItem, BuildProducer reflectiveClass, BuildProducer hotDeployment, - BuildProducer systemProperties, - BuildProducer feature, BuildProducer additionalBeans, BuildProducer sslNativeSupport, BuildProducer nativeImageSecurityProviders, - BuildProducer nativeImageConfig, BuildProducer infinispanClientNames, MarshallingBuildItem marshallingBuildItem, BuildProducer resourceBuildItem, CombinedIndexBuildItem applicationIndexBuildItem) throws ClassNotFoundException, IOException { - feature.produce(new FeatureBuildItem(Feature.INFINISPAN_CLIENT)); additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(InfinispanClientProducer.class)); additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(CacheInvalidateAllInterceptor.class)); additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(CacheResultInterceptor.class)); @@ -250,10 +249,10 @@ InfinispanPropertiesBuildItem setup(ApplicationArchivesBuildItem applicationArch } } properties.putAll(marshallingBuildItem.getProperties()); - Collection initializerClasses = index.getAllKnownImplementors(DotName.createSimple( + Collection initializerClasses = index.getAllKnownImplementations(DotName.createSimple( SerializationContextInitializer.class.getName())); initializerClasses - .addAll(index.getAllKnownImplementors(DotName.createSimple(GeneratedSchema.class.getName()))); + .addAll(index.getAllKnownImplementations(DotName.createSimple(GeneratedSchema.class.getName()))); Set initializers = new HashSet<>(initializerClasses.size()); for (ClassInfo ci : initializerClasses) { @@ -369,7 +368,7 @@ private static String getContents(String fileName) { * @return string containing the contents of the file */ private static String getContents(InputStream stream) { - try (Scanner scanner = new Scanner(stream, "UTF-8")) { + try (Scanner scanner = new Scanner(stream, StandardCharsets.UTF_8)) { return scanner.useDelimiter("\\A").next(); } } @@ -486,7 +485,7 @@ void registerServiceBinding(Capabilities capabilities, BuildProducer log) { log.produce(new LogCategoryBuildItem("org.apache.kafka.clients", Level.WARNING)); log.produce(new LogCategoryBuildItem("org.apache.kafka.common.utils", Level.WARNING)); log.produce(new LogCategoryBuildItem("org.apache.kafka.common.metrics", Level.WARNING)); + log.produce(new LogCategoryBuildItem("org.apache.kafka.common.config", Level.WARNING)); log.produce(new LogCategoryBuildItem("org.apache.kafka.common.telemetry", Level.WARNING)); } diff --git a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java index dd1884bab1d23..cd6dae1c84821 100644 --- a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java +++ b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxHttpServerMetrics.java @@ -12,6 +12,7 @@ import io.micrometer.core.instrument.LongTaskTimer; import io.micrometer.core.instrument.Meter.MeterProvider; import io.micrometer.core.instrument.MeterRegistry; +import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; import io.micrometer.core.instrument.Timer; import io.micrometer.core.instrument.binder.http.Outcome; @@ -56,19 +57,18 @@ public class VertxHttpServerMetrics extends VertxTcpServerMetrics VertxHttpServerMetrics(MeterRegistry registry, HttpBinderConfiguration config, OpenTelemetryContextUnwrapper openTelemetryContextUnwrapper, HttpServerOptions httpServerOptions) { - super(registry, "http.server", null); + super(registry, "http.server", commonTags(httpServerOptions)); this.config = config; this.openTelemetryContextUnwrapper = openTelemetryContextUnwrapper; - activeRequests = new LongAdder(); + + Tags commonTags = commonTags(httpServerOptions); + Gauge.Builder activeRequestsBuilder = Gauge .builder(config.getHttpServerActiveRequestsName(), activeRequests, LongAdder::doubleValue) .tag("url.scheme", httpServerOptions.isSsl() ? "https" : "http"); - // we add a port tag (the one the application should actually bind to on the network host, - // not the public one which we can't know easily) only if it's not random - if (httpServerOptions.getPort() > 0) { - activeRequestsBuilder - .tag("server.port", "" + httpServerOptions.getPort()); + for (Tag commonTag : commonTags) { + activeRequestsBuilder.tag(commonTag.getKey(), commonTag.getValue()); } activeRequestsBuilder.register(registry); @@ -89,6 +89,16 @@ public class VertxHttpServerMetrics extends VertxTcpServerMetrics // not dev-mode changeable -----ˆ } + private static Tags commonTags(HttpServerOptions httpServerOptions) { + Tags result = Tags.empty(); + // we add a port tag (the one the application should actually bind to on the network host, + // not the public one which we can't know easily) only if it's not random + if (httpServerOptions.getPort() > 0) { + result = result.and("server.port", "" + httpServerOptions.getPort()); + } + return result; + } + private List resolveHttpServerMetricsTagsContributors() { final List httpServerMetricsTagsContributors; ArcContainer arcContainer = Arc.container(); diff --git a/extensions/observability-devservices/testcontainers/src/main/resources/grafana-dashboard-opentelemetry-logging.json b/extensions/observability-devservices/testcontainers/src/main/resources/grafana-dashboard-opentelemetry-logging.json index 796784e15fa52..47e15d7cc2047 100644 --- a/extensions/observability-devservices/testcontainers/src/main/resources/grafana-dashboard-opentelemetry-logging.json +++ b/extensions/observability-devservices/testcontainers/src/main/resources/grafana-dashboard-opentelemetry-logging.json @@ -228,7 +228,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{service_name=~\"$service_name\"} | severity_text=~\"$log_level\" |~ \"(?i)$searchable_pattern\" | line_format `{{date \"2006-01-02 12:04:05\" __timestamp__ | alignLeft 21}} {{alignLeft 30 .service_name}} {{upper .detected_level | alignLeft 9}} {{__line__}}`", + "expr": "{service_name=~\"$service_name\"} | severity_text=~\"$log_level\" |~ \"(?i)$searchable_pattern\" | line_format \"{{date \\\"2006-01-02 15:04:05.000\\\" .__time__ | alignLeft 24}} {{alignLeft 30 .service_name}} {{upper .detected_level | alignLeft 9}} {{__line__}}\"", "hide": false, "queryType": "range", "refId": "A" diff --git a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java index b033b9aa27379..3d47ce155d30a 100644 --- a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java +++ b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/properties/ResourcePropertiesProvider.java @@ -16,7 +16,6 @@ import org.jboss.jandex.MethodInfo; import io.quarkus.rest.data.panache.deployment.utils.ResourceName; -import io.quarkus.security.Authenticated; public class ResourcePropertiesProvider { @@ -27,7 +26,7 @@ public class ResourcePropertiesProvider { io.quarkus.rest.data.panache.MethodProperties.class.getName()); private static final List ANNOTATIONS_TO_COPY = List.of(RolesAllowed.class.getPackageName(), - Authenticated.class.getPackageName(), + "io.quarkus.security.Authenticated", // To also support `@EndpointDisabled` if used "io.quarkus.resteasy.reactive.server"); diff --git a/extensions/reactive-streams-operators/smallrye-reactive-streams-operators/deployment/src/main/java/io/quarkus/smallrye/reactivestreamoperators/deployment/SmallRyeReactiveStreamsOperatorsProcessor.java b/extensions/reactive-streams-operators/smallrye-reactive-streams-operators/deployment/src/main/java/io/quarkus/smallrye/reactivestreamoperators/deployment/SmallRyeReactiveStreamsOperatorsProcessor.java index 3655e015d3428..95fe0ef8aff04 100644 --- a/extensions/reactive-streams-operators/smallrye-reactive-streams-operators/deployment/src/main/java/io/quarkus/smallrye/reactivestreamoperators/deployment/SmallRyeReactiveStreamsOperatorsProcessor.java +++ b/extensions/reactive-streams-operators/smallrye-reactive-streams-operators/deployment/src/main/java/io/quarkus/smallrye/reactivestreamoperators/deployment/SmallRyeReactiveStreamsOperatorsProcessor.java @@ -14,9 +14,12 @@ public class SmallRyeReactiveStreamsOperatorsProcessor { @BuildStep - public void build(BuildProducer serviceProvider, - BuildProducer feature) { - feature.produce(new FeatureBuildItem(Feature.SMALLRYE_REACTIVE_STREAMS_OPERATORS)); + FeatureBuildItem feature() { + return new FeatureBuildItem(Feature.SMALLRYE_REACTIVE_STREAMS_OPERATORS); + } + + @BuildStep + public void build(BuildProducer serviceProvider) { serviceProvider.produce(new ServiceProviderBuildItem(ReactiveStreamsEngine.class.getName(), Engine.class.getName())); serviceProvider.produce(new ServiceProviderBuildItem(ReactiveStreamsFactory.class.getName(), ReactiveStreamsFactoryImpl.class.getName())); diff --git a/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java b/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java index 30b741b486c11..0c65b29035fe2 100644 --- a/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java +++ b/extensions/scheduler/deployment/src/main/java/io/quarkus/scheduler/deployment/SchedulerProcessor.java @@ -366,7 +366,7 @@ public List unremovableBeans() { @BuildStep @Record(RUNTIME_INIT) - public FeatureBuildItem build( + public void build( SchedulerRecorder recorder, BuildProducer syntheticBeans, List scheduledMethods, @@ -415,7 +415,10 @@ public String apply(String name) { .supplier(recorder.createContext(scheduledMetadata, !schedulerForcedStartItems.isEmpty(), discoveredImplementations.getAutoImplementation())) .done()); + } + @BuildStep + FeatureBuildItem feature() { return new FeatureBuildItem(Feature.SCHEDULER); } diff --git a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java index 73792fb638ebf..bb67e5e6aa477 100644 --- a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java +++ b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java @@ -161,6 +161,11 @@ public class SmallRyeOpenApiProcessor { private static final String MANAGEMENT_ENABLED = "quarkus.smallrye-openapi.management.enabled"; + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(Feature.SMALLRYE_OPENAPI); + } + @BuildStep void contributeClassesToIndex(BuildProducer additionalIndexedClasses) { // contribute additional JDK classes to the index, because SmallRye OpenAPI will check if some @@ -321,7 +326,7 @@ void handler(LaunchModeBuildItem launch, // quarkus.http.cors.enabled=true // quarkus.http.cors.origins Optional maybeCors = c.getOptionalValue("quarkus.http.cors.enabled", Boolean.class); - if (!maybeCors.isPresent() || !maybeCors.get().booleanValue()) { + if (maybeCors.isEmpty() || !maybeCors.get()) { // We need to set quarkus.http.cors.enabled=true systemProperties.produce(new SystemPropertyBuildItem("quarkus.http.cors.enabled", "true")); } @@ -496,30 +501,27 @@ private Optional getAutoSecurityFilter(List { - switch (securityInfo.getSecurityModel()) { - case jwt: - return new AutoBearerTokenSecurityFilter( - config.securitySchemeName(), - config.securitySchemeDescription(), - config.getValidSecuritySchemeExtensions(), - config.jwtSecuritySchemeValue(), - config.jwtBearerFormat()); - case oauth2: - return new AutoBearerTokenSecurityFilter( - config.securitySchemeName(), - config.securitySchemeDescription(), - config.getValidSecuritySchemeExtensions(), - config.oauth2SecuritySchemeValue(), - config.oauth2BearerFormat()); - case basic: - return new AutoBasicSecurityFilter( - config.securitySchemeName(), - config.securitySchemeDescription(), - config.getValidSecuritySchemeExtensions(), - config.basicSecuritySchemeValue()); - case oidc: + return switch (securityInfo.getSecurityModel()) { + case jwt -> new AutoBearerTokenSecurityFilter( + config.securitySchemeName(), + config.securitySchemeDescription(), + config.getValidSecuritySchemeExtensions(), + config.jwtSecuritySchemeValue(), + config.jwtBearerFormat()); + case oauth2 -> new AutoBearerTokenSecurityFilter( + config.securitySchemeName(), + config.securitySchemeDescription(), + config.getValidSecuritySchemeExtensions(), + config.oauth2SecuritySchemeValue(), + config.oauth2BearerFormat()); + case basic -> new AutoBasicSecurityFilter( + config.securitySchemeName(), + config.securitySchemeDescription(), + config.getValidSecuritySchemeExtensions(), + config.basicSecuritySchemeValue()); + case oidc -> // This needs to be a filter in runtime as the config we use to autoconfigure is in runtime - return securityInfo.getOpenIDConnectInformation() + securityInfo.getOpenIDConnectInformation() .map(info -> { AutoUrl openIdConnectUrl = new AutoUrl( config.oidcOpenIdConnectUrl().orElse(null), @@ -533,9 +535,8 @@ private Optional getAutoSecurityFilter(List null; + }; }) .filter(Objects::nonNull) .findFirst(); @@ -676,7 +677,7 @@ private static Stream> getMethods( .stream() // drop methods that specify the annotation directly .filter(method -> !method.hasDeclaredAnnotation(annotation.name())) - .filter(method -> isValidOpenAPIMethodForAutoAdd(method)) + .filter(SmallRyeOpenApiProcessor::isValidOpenAPIMethodForAutoAdd) .map(method -> { final ClassInfo resourceClass; @@ -814,16 +815,13 @@ private static boolean isOpenAPIEndpoint(MethodInfo method) { } private static List getMethods(ClassInfo declaringClass, IndexView index) { - List methods = new ArrayList<>(); - methods.addAll(declaringClass.methods()); + List methods = new ArrayList<>(declaringClass.methods()); // Check if the method overrides a method from an interface for (Type interfaceType : declaringClass.interfaceTypes()) { ClassInfo interfaceClass = index.getClassByName(interfaceType.name()); if (interfaceClass != null) { - for (MethodInfo interfaceMethod : interfaceClass.methods()) { - methods.add(interfaceMethod); - } + methods.addAll(interfaceClass.methods()); } } @@ -889,8 +887,7 @@ private void handleOperation(Operation operation, ClassInfo classInfo, MethodInf } @BuildStep - public void build(BuildProducer feature, - BuildProducer resourceBuildItemBuildProducer, + public void build(BuildProducer resourceBuildItemBuildProducer, BuildProducer nativeImageResources, BuildProducer openApiDocumentProducer, OpenApiFilteredIndexViewBuildItem openApiFilteredIndexViewBuildItem, @@ -905,8 +902,6 @@ public void build(BuildProducer feature, FilteredIndexView index = openApiFilteredIndexViewBuildItem.getIndex(); Config config = ConfigProvider.getConfig(); - feature.produce(new FeatureBuildItem(Feature.SMALLRYE_OPENAPI)); - List urlIgnorePatterns = ignoreStaticDocumentBuildItems.stream() .map(IgnoreStaticDocumentBuildItem::getUrlIgnorePattern) .toList(); @@ -917,7 +912,7 @@ public void build(BuildProducer feature, .withApplicationClassLoader(loader) .withScannerClassLoader(loader) .enableModelReader(true) - .enableStandardStaticFiles(Boolean.FALSE.equals(smallRyeOpenApiConfig.ignoreStaticDocument())) + .enableStandardStaticFiles(!smallRyeOpenApiConfig.ignoreStaticDocument()) .withResourceLocator(path -> { URL locator = loader.getResource(path); if (locator == null || shouldIgnore(urlIgnorePatterns, locator.toString())) { @@ -1095,9 +1090,7 @@ private InputStream loadAdditionalDocsModel(SmallRyeOpenApiConfig openApiConfig, .enableAnnotationScan(false) .enableStandardFilter(false); - return openApiConfig.additionalDocsDirectory() - .map(Collection::stream) - .orElseGet(Stream::empty) + return openApiConfig.additionalDocsDirectory().stream().flatMap(Collection::stream) .map(path -> getResourceFiles(path, target)) .flatMap(Collection::stream) .filter(path -> path.endsWith(".json") || path.endsWith(".yaml") || path.endsWith(".yml")) diff --git a/independent-projects/arc/pom.xml b/independent-projects/arc/pom.xml index 5ad6fefb46f13..6884ee3506e98 100644 --- a/independent-projects/arc/pom.xml +++ b/independent-projects/arc/pom.xml @@ -49,7 +49,7 @@ 3.6.1.Final 2.9.4 1.6.Final - 2.13.8 + 2.13.9 3.27.4 5.13.4 diff --git a/independent-projects/bootstrap/pom.xml b/independent-projects/bootstrap/pom.xml index 19336784660e9..f044da1e65155 100644 --- a/independent-projects/bootstrap/pom.xml +++ b/independent-projects/bootstrap/pom.xml @@ -70,7 +70,7 @@ 1.26 2.0 3.5.1 - 2.13.8 + 2.13.9 1.5.3 9.0.0 1.1.0 diff --git a/independent-projects/junit5-virtual-threads/pom.xml b/independent-projects/junit5-virtual-threads/pom.xml index 295179a04ed77..3f05d106a08eb 100644 --- a/independent-projects/junit5-virtual-threads/pom.xml +++ b/independent-projects/junit5-virtual-threads/pom.xml @@ -42,7 +42,7 @@ 3.2.1 3.5.2 3.4.0 - 2.13.8 + 2.13.9 5.13.4 3.27.4 diff --git a/independent-projects/qute/pom.xml b/independent-projects/qute/pom.xml index f3e8f25bca223..4877d7c9f374e 100644 --- a/independent-projects/qute/pom.xml +++ b/independent-projects/qute/pom.xml @@ -43,7 +43,7 @@ 3.4.0 1.9.0 3.6.1.Final - 2.13.8 + 2.13.9 2.9.4 diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml index 9b4ac48d9b313..e2ccb2d2d4876 100644 --- a/independent-projects/resteasy-reactive/pom.xml +++ b/independent-projects/resteasy-reactive/pom.xml @@ -56,7 +56,7 @@ 3.1.0 2.9.4 - 2.13.8 + 2.13.9 4.5.21 5.5.6 1.0.0.Final diff --git a/independent-projects/tools/base-codestarts/pom.xml b/independent-projects/tools/base-codestarts/pom.xml index ff19b9d2abbf7..0d85f6cccfedf 100644 --- a/independent-projects/tools/base-codestarts/pom.xml +++ b/independent-projects/tools/base-codestarts/pom.xml @@ -13,12 +13,13 @@ quarkus-devtools-base-codestarts Quarkus - Dev tools - Base Codestarts - - ${maven.multiModuleProjectDirectory}/devtools/gradle - gradlew - - + src/main/resources @@ -28,104 +29,15 @@ true - - - org.codehaus.mojo - exec-maven-plugin - - - init-gradle-project - generate-sources - - ${gradle-wrapper.path}/${gradle.executable} - - - -Xmx512m - - - init - --type - basic - --no-daemon - --overwrite - - ${project.build.directory}/gradle-wrapper - true - - - exec - - - - install-gradle-wrapper - generate-sources - - ${gradle-wrapper.path}/${gradle.executable} - - - -Xmx512m - - - wrapper - --gradle-version - ${gradle-wrapper.version} - --no-daemon - - ${project.build.directory}/gradle-wrapper - true - - - exec - - - - - - maven-resources-plugin - - - copy-gradle-wrapper - generate-sources - - copy-resources - - - UTF-8 - ${project.build.outputDirectory}/codestarts/quarkus/tooling/gradle-wrapper/base/ - - - ${project.build.directory}/gradle-wrapper/ - - gradle/wrapper/** - gradlew - gradlew.bat - - false - - - - - - - + + + + maven-resources-plugin + + UTF-8 + + + + - - - - windows - - - windows - - - - gradlew.bat - - - - diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.jar b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000..8bdaf60c75ab8 Binary files /dev/null and b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.jar differ diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.properties b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000..ca025c83a7cc5 --- /dev/null +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradlew b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradlew new file mode 100755 index 0000000000000..ef07e0162b183 --- /dev/null +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradlew.bat b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradlew.bat new file mode 100644 index 0000000000000..5eed7ee845284 --- /dev/null +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/base/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml new file mode 100644 index 0000000000000..cd6f8b5497871 --- /dev/null +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/gradle-wrapper/codestart.yml @@ -0,0 +1,12 @@ +name: tooling-gradle-wrapper +type: tooling +output-strategy: + "gradlew": "executable" +language: + base: + data: + gradle: + version: 8.14 + shared-data: + buildtool: + cli: ./gradlew diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/codestart.yml new file mode 100644 index 0000000000000..c7fc80559c5c0 --- /dev/null +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/maven-wrapper/codestart.yml @@ -0,0 +1,13 @@ +name: tooling-maven-wrapper +type: tooling +output-strategy: + "mvnw": "executable" +language: + base: + data: + maven: + version: 3.9.11 + wrapper-version: 3.3.2 + shared-data: + buildtool: + cli: ./mvnw diff --git a/integration-tests/gradle/src/main/resources/included-build/included/settings.gradle b/integration-tests/gradle/src/main/resources/included-build/included/settings.gradle index eea3a9087fd7a..8a420738c0b8a 100644 --- a/integration-tests/gradle/src/main/resources/included-build/included/settings.gradle +++ b/integration-tests/gradle/src/main/resources/included-build/included/settings.gradle @@ -18,5 +18,3 @@ pluginManagement { includeBuild 'nested' rootProject.name = 'included' - -include ':nested:included-quarkus' diff --git a/pom.xml b/pom.xml index 3a2197ef67e2f..6cac74895cda5 100644 --- a/pom.xml +++ b/pom.xml @@ -78,8 +78,8 @@ 1.0.1 3.1.3.Final 9.0.1.Final - 8.1.0.Final - 7.1.0.Final + 8.1.2.Final + 7.1.1.Final 1.69.1