From d21aae6a70a926740e6448eda93e894efa2b2712 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 07:27:55 +0000 Subject: [PATCH 01/44] Update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.2.3 --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index f25578a..5ee5275 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.2 + 3.2.3 sign-artifacts From d1748a5779236e34017842ac8c2c759448261cad Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 16 Apr 2024 08:43:54 +0200 Subject: [PATCH 02/44] Update pom.xml Remove unused inception year in demo --- standard-maven-template-demo/pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 0a4432d..a401ade 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -9,8 +9,6 @@ 1.0.0-SNAPSHOT jar - 2022 - XDEV Software https://xdev.software From fd9656a52e736915f5867868bfb7e2bec09968db Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sat, 20 Apr 2024 02:15:22 +0000 Subject: [PATCH 03/44] Update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.2.4 --- standard-maven-template/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 5ee5275..f8facd6 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.3 + 3.2.4 sign-artifacts From 34acb7c46c304632c0a5dede676c5857d12a76f5 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sun, 21 Apr 2024 02:19:24 +0000 Subject: [PATCH 04/44] Update dependency maven-wrapper to v3.3.0 --- .mvn/wrapper/maven-wrapper.properties | 1 - mvnw | 428 +++++++++++--------------- mvnw.cmd | 301 ++++++++---------- 3 files changed, 306 insertions(+), 424 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 346d645..7f15621 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -15,4 +15,3 @@ # specific language governing permissions and limitations # under the License. distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/mvnw b/mvnw index 8d937f4..0830332 100755 --- a/mvnw +++ b/mvnw @@ -19,290 +19,232 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.2.0 -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir +# Apache Maven Wrapper startup batch script, version 3.3.0 # # 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 +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output # ---------------------------------------------------------------------------- -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 +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false +# OS specific support. +native_path() { printf %s\\n "$1"; } 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 - ;; +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; 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."; 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 +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + 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" + JAVACCMD="$JAVA_HOME/jre/sh/javac" else JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi 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." -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" - return 1 + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi 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 +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" done - printf '%s' "$(cd "$basedir" || exit 1; pwd)" + printf %x\\n $h } -# 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 +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 } -log() { - if [ "$MVNW_VERBOSE" = true ]; then - printf '%s\n' "$1" - fi +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl="${value-}" ;; + distributionSha256Sum) distributionSha256Sum="${value-}" ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_HOME="$HOME/.m2/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" } -BASE_DIR=$(find_maven_basedir "$(dirname "$0")") -if [ -z "$BASE_DIR" ]; then - exit 1; +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" fi -MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR -log "$MAVEN_PROJECTBASEDIR" +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac -########################################################################################## -# 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" +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT else - log "Couldn't find $wrapperJarPath, downloading it ..." + die "cannot create temp dir" +fi - if [ -n "$MVNW_REPOURL" ]; then - wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - else - wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.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" +mkdir -p -- "${MAVEN_HOME%/*}" - if $cygwin; then - wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") - fi +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" - 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 +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" 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 +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( new java.net.URL( args[0] ).openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true fi - elif command -v shasum > /dev/null; then - if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then - wrapperSha256Result=true + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true fi else - echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." - echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' 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 + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum 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") +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" -# 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 "$@" +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd index c4586b5..136e686 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -1,3 +1,4 @@ +<# : batch portion @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @@ -18,188 +19,128 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.2.0 -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir +@REM Apache Maven Wrapper startup batch script, version 3.3.0 @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 MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @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. -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. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -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. -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/3.2.0/maven-wrapper-3.2.0.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/3.2.0/maven-wrapper-3.2.0.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 "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) ) -IF NOT %WRAPPER_SHA_256_SUM%=="" ( - powershell -Command "&{"^ - "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ - "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ - " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ - " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ - " Write-Output '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% +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" From 29fd4deb26b6b013c857053364e1137556240c63 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 08:43:43 +0200 Subject: [PATCH 05/44] Standardize template-placeholder I --- .run/Run Demo.run.xml | 2 +- CONTRIBUTING.md | 4 ++-- README.md | 12 ++++++------ pom.xml | 6 +++--- standard-maven-template-demo/pom.xml | 4 ++-- standard-maven-template/pom.xml | 12 ++++++------ 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index 764b3b9..5fb2bc2 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -1,7 +1,7 @@ - standard-maven-template - standard-maven-template-demo + template-placeholder + template-placeholder-demo diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index a401ade..78b4a3e 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -5,7 +5,7 @@ 4.0.0 software.xdev - standard-maven-template-demo + template-placeholder-demo 1.0.0-SNAPSHOT jar @@ -27,7 +27,7 @@ software.xdev - standard-maven-template + template-placeholder ${project.version} diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index f8facd6..b72a766 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -5,17 +5,17 @@ 4.0.0 software.xdev - standard-maven-template + template-placeholder 1.0.0-SNAPSHOT jar - standard-maven-template - standard-maven-template - https://github.com/xdev-software/standard-maven-template + template-placeholder + template-placeholder + https://github.com/xdev-software/template-placeholder - https://github.com/xdev-software/standard-maven-template - scm:git:https://github.com/xdev-software/standard-maven-template.git + https://github.com/xdev-software/template-placeholder + scm:git:https://github.com/xdev-software/template-placeholder.git 2023 From 7bed85040287fc665c6f60e7fd19c6534b16f886 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 08:44:10 +0200 Subject: [PATCH 06/44] Standardize template-placeholder II --- .../pom.xml | 0 {standard-maven-template => template-placeholder}/pom.xml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {standard-maven-template-demo => template-placeholder-demo}/pom.xml (100%) rename {standard-maven-template => template-placeholder}/pom.xml (100%) diff --git a/standard-maven-template-demo/pom.xml b/template-placeholder-demo/pom.xml similarity index 100% rename from standard-maven-template-demo/pom.xml rename to template-placeholder-demo/pom.xml diff --git a/standard-maven-template/pom.xml b/template-placeholder/pom.xml similarity index 100% rename from standard-maven-template/pom.xml rename to template-placeholder/pom.xml From 9cdaa5e7b4eaddfcc80eb036c80ea5605d4d3fd4 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 09:05:45 +0200 Subject: [PATCH 07/44] Remove unused empty line --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0760da8..8da47a0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ ## Installation [Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation) - ## Support If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). From 843acf00d18caea236bd9a620a20d50e060449d4 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:16:36 +0200 Subject: [PATCH 08/44] Update .gitattributes --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitattributes b/.gitattributes index dfe0770..9c74e42 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,9 @@ # Auto detect text files and perform LF normalization * text=auto + +# Force sh files to have LF +*.sh text eol=lf + +# Force MVN Wrapper Linux files LF +mvnw text eol=lf +.mvn/wrapper/maven-wrapper.properties text eol=lf From 2fddb4f8d67802420c6fe5ab905874257474528c Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 29 Apr 2024 02:19:20 +0000 Subject: [PATCH 09/44] Update dependency com.puppycrawl.tools:checkstyle to v10.16.0 --- template-placeholder-demo/pom.xml | 2 +- template-placeholder/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 78b4a3e..863e7bb 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -90,7 +90,7 @@ com.puppycrawl.tools checkstyle - 10.15.0 + 10.16.0 diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b72a766..f05847e 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -230,7 +230,7 @@ com.puppycrawl.tools checkstyle - 10.15.0 + 10.16.0 From 80ca5915702edf25a92c75751418498dc8b09433 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 30 Apr 2024 11:20:37 +0200 Subject: [PATCH 10/44] Enable ``includeTestSourceDirectory`` Fix #48 --- template-placeholder-demo/pom.xml | 1 + template-placeholder/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 863e7bb..b319445 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -95,6 +95,7 @@ ../.config/checkstyle/checkstyle.xml + true diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index f05847e..881534d 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -235,6 +235,7 @@ ../.config/checkstyle/checkstyle.xml + true From 2afe2fce60b15901230c31f68854c54919611799 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 6 May 2024 16:35:52 +0200 Subject: [PATCH 11/44] Update CONTRIBUTING.md Add note about (stealthy) Sonarlint telemetry --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d241a28..71adf87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,6 +27,7 @@ You should have the following things installed: * Install the following plugins: * [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * You may consider disabling telemetry in the settings under ``Tools > Sonarlint -> About`` * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis * Import the project * Ensure that everything is encoded in ``UTF-8`` From 451d36f3e2427c999d371ab07438ccb1ccd738d4 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 9 May 2024 02:20:36 +0000 Subject: [PATCH 12/44] Update dependency org.apache.maven.plugins:maven-site-plugin to v4.0.0-M14 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 881534d..0bf57cb 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -90,7 +90,7 @@ org.apache.maven.plugins maven-site-plugin - 4.0.0-M13 + 4.0.0-M14 org.apache.maven.plugins From 5a2a8da2c515f0ceb7c0c66d8f95c0049bf35c45 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sun, 12 May 2024 02:22:20 +0000 Subject: [PATCH 13/44] Update dependency com.mycila:license-maven-plugin to v4.5 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 881534d..3b07391 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -103,7 +103,7 @@ com.mycila license-maven-plugin - 4.3 + 4.5 ${project.organization.url} From 8dbbdf91ff9f49dadba0277b776d3f79d6600ce1 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 13 May 2024 15:22:53 +0200 Subject: [PATCH 14/44] Ignore non resolveable links --- .github/.lycheeignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/.lycheeignore b/.github/.lycheeignore index 972ca61..dc88a07 100644 --- a/.github/.lycheeignore +++ b/.github/.lycheeignore @@ -1,2 +1,3 @@ # Ignorefile for broken link check localhost +mvnrepository.com From 97034e8c3c3edec50a154b6f895eec9d41b5ea3b Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Fri, 17 May 2024 09:01:17 +0200 Subject: [PATCH 15/44] Slight rewording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71adf87..7f1156e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ We would absolutely love to get the community involved, and we welcome any form ### Ways to help * **Report bugs**
Create an issue or send a pull request * **Send pull requests**
If you want to contribute code, check out the development instructions below. - * However when contributing new features, please first discuss the change you wish to make via issue with the owners of this repository before making a change. Otherwise your work might be rejected and your effort was pointless. + * However when contributing larger new features, please first discuss the change you wish to make via issue with the owners of this repository before making it.
Otherwise your work might be rejected and your effort was pointless. We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). From 69604577dc40e6d61d57b4868839194bf16aaf02 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sun, 26 May 2024 02:24:16 +0000 Subject: [PATCH 16/44] Update dependency maven to v3.9.7 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 7f15621..f800e78 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip From f22a35b6327ac7f8c9af16da8b377c5a6770dc5f Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 27 May 2024 02:21:47 +0000 Subject: [PATCH 17/44] Update dependency com.puppycrawl.tools:checkstyle to v10.17.0 --- template-placeholder-demo/pom.xml | 2 +- template-placeholder/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index b319445..f40d02e 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -90,7 +90,7 @@ com.puppycrawl.tools checkstyle - 10.16.0 + 10.17.0 diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b9369a7..36e4236 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -230,7 +230,7 @@ com.puppycrawl.tools checkstyle - 10.16.0 + 10.17.0 From 457533698cb76fa8c50b82b99365e23737b843f0 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 27 May 2024 11:05:40 +0200 Subject: [PATCH 18/44] Only run sonar workflow when secret is present Fixes https://github.com/xdev-software/standard-maven-template/issues/57 --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 1c9b0f8..061abbd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -27,7 +27,7 @@ jobs: sonar: name: SonarCloud Scan runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && secrets.SONAR_TOKEN != '' }} steps: - uses: actions/checkout@v4 with: From 403faee28d7778d19d589fa22e5f502bf4e8ed87 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 27 May 2024 16:08:06 +0200 Subject: [PATCH 19/44] Secrets are not available in if So let's startup a job before and check it there... You know because efficient design --- .github/workflows/sonar.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 061abbd..917868b 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -24,10 +24,22 @@ env: SONARCLOUD_HOST: https://sonarcloud.io jobs: + token-check: + runs-on: ubuntu-latest + outputs: + hasToken: ${{ steps.check-token.outputs.has }} + steps: + - id: check-token + run: | + [ -z $SONAR_TOKEN ] && echo "has=false" || echo "has=true" >> "$GITHUB_OUTPUT" + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + sonar: name: SonarCloud Scan runs-on: ubuntu-latest - if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && secrets.SONAR_TOKEN != '' }} + needs: token-check + if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && needs.token-check.outputs.hasToken }} steps: - uses: actions/checkout@v4 with: From d562e83d8ff58946f6ef75dcc86ab6ac9c139928 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Tue, 28 May 2024 02:21:58 +0000 Subject: [PATCH 20/44] Update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.7.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 36e4236..7a44509 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -205,7 +205,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh From bef3a777eee48445b3c7c806da17ba7df91d156c Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 08:23:59 +0200 Subject: [PATCH 21/44] Don't run sonar token check when not required --- .github/workflows/sonar.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 917868b..7824917 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -26,6 +26,7 @@ env: jobs: token-check: runs-on: ubuntu-latest + if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }} outputs: hasToken: ${{ steps.check-token.outputs.has }} steps: @@ -35,11 +36,10 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - sonar: - name: SonarCloud Scan + sonar-scan: runs-on: ubuntu-latest needs: token-check - if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && needs.token-check.outputs.hasToken }} + if: ${{ needs.token-check.outputs.hasToken }} steps: - uses: actions/checkout@v4 with: From 8d48e75a2b3bc9535431421a4cd8bfb19c517530 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 08:47:01 +0200 Subject: [PATCH 22/44] Compact/Flatten pom on release --- template-placeholder/pom.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 36e4236..d832697 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -179,6 +179,23 @@ ossrh + + org.codehaus.mojo + flatten-maven-plugin + 1.6.0 + + ossrh + + + + flatten + process-resources + + flatten + + + + org.apache.maven.plugins maven-gpg-plugin From a16ac0640bc49566cf4ecfcbcfb3d0c35db03c9f Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 14:09:40 +0200 Subject: [PATCH 23/44] Standardize job names --- .github/workflows/release.yml | 16 ++++++++-------- .github/workflows/test-deploy.yml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ad042f..a1e3e8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ permissions: pull-requests: write jobs: - check_code: # Validates the code + check-code: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -45,9 +45,9 @@ jobs: exit 1 fi - prepare_release: + prepare-release: runs-on: ubuntu-latest - needs: [check_code] + needs: [check-code] outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: @@ -106,9 +106,9 @@ jobs: ``` - publish_central: # Publish the code to central + publish-maven: runs-on: ubuntu-latest - needs: [prepare_release] + needs: [prepare-release] steps: - uses: actions/checkout@v4 @@ -139,7 +139,7 @@ jobs: publish-pages: runs-on: ubuntu-latest - needs: [prepare_release] + needs: [prepare-release] steps: - uses: actions/checkout@v4 @@ -166,9 +166,9 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site - after_release: + after-release: runs-on: ubuntu-latest - needs: [publish_central] + needs: [publish-maven] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index cdd96cc..9c07de2 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -7,7 +7,7 @@ env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} jobs: - publish_central: # Publish the code to central + publish-maven: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 4de451fa872278bcc682a234014fce0c08e8df88 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 14:11:12 +0200 Subject: [PATCH 24/44] Substitute using repo name --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1e3e8b..9a3c5da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,8 +93,8 @@ jobs: release_name: v${{ steps.version.outputs.release }} commitish: master body: | - ## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) - See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. + ## [Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) + See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. ## Installation Add the following lines to your pom: From 21769fcb17f890c24d9db4909552aa431b0ba947 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 28 May 2024 14:11:53 +0200 Subject: [PATCH 25/44] Normalize workflow names --- .github/workflows/{checkBuild.yml => check-build.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{checkBuild.yml => check-build.yml} (100%) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/check-build.yml similarity index 100% rename from .github/workflows/checkBuild.yml rename to .github/workflows/check-build.yml diff --git a/README.md b/README.md index 8da47a0..eccf80b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder) -[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/checkBuild.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder) # template-placeholder From 7ab86667b9fe51602690b0df081c47848195a834 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sat, 1 Jun 2024 02:28:02 +0000 Subject: [PATCH 26/44] Update dependency org.apache.maven.plugins:maven-site-plugin to v4.0.0-M15 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index a1a300d..7a5c2dc 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -90,7 +90,7 @@ org.apache.maven.plugins maven-site-plugin - 4.0.0-M14 + 4.0.0-M15 org.apache.maven.plugins From 3b682e831f3f596ed23ba3ff2a643ea4ac6301fd Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Sat, 1 Jun 2024 02:28:04 +0000 Subject: [PATCH 27/44] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.7.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index a1a300d..0046bdb 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -143,7 +143,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs From 3feccd234eb90229ff4887db845e87a37d0df9f7 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 6 Jun 2024 02:21:49 +0000 Subject: [PATCH 28/44] Update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.4.0 --- pom.xml | 2 +- template-placeholder-demo/pom.xml | 2 +- template-placeholder/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5da2110..8fc5ca9 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.4.0 true diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index f40d02e..326f855 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -85,7 +85,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.4.0 com.puppycrawl.tools diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 539a8a0..fb307dd 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -242,7 +242,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.4.0 com.puppycrawl.tools From 03dd57153ee758d4354a4fad9663e974dfb14e24 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 17 Jun 2024 02:25:02 +0000 Subject: [PATCH 29/44] Update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index fb307dd..5030ab1 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -95,7 +95,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.5.0 + 3.6.0 From 7313ce9b3960ac6cbca4f6b5e16d211463164bf8 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Tue, 18 Jun 2024 02:23:41 +0000 Subject: [PATCH 30/44] Update dependency maven to v3.9.8 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index f800e78..e56bc18 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip From 43ddc48eac02aeaea23d332fd4c88bebf9e0c4f8 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:56:51 +0200 Subject: [PATCH 31/44] Attach demo to parent --- template-placeholder-demo/pom.xml | 39 +++++-------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 326f855..1af633c 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -4,7 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - software.xdev + + software.xdev + template-placeholder-root + 1.0.0-SNAPSHOT + + template-placeholder-demo 1.0.0-SNAPSHOT jar @@ -77,36 +82,4 @@ - - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.4.0 - - - com.puppycrawl.tools - checkstyle - 10.17.0 - - - - ../.config/checkstyle/checkstyle.xml - true - - - - - check - - - - - - - - From 3bc085a454ffefea389f3d3519e13445d97b60ef Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:57:26 +0200 Subject: [PATCH 32/44] Reconfigure root and add pmd --- pom.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8fc5ca9..3a04c7a 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,11 @@ template-placeholder-demo + + UTF-8 + UTF-8 + + Apache License, Version 2.0 @@ -29,7 +34,6 @@ - checkstyle @@ -37,12 +41,67 @@ org.apache.maven.plugins maven-checkstyle-plugin 3.4.0 + + + com.puppycrawl.tools + checkstyle + 10.17.0 + + + + .config/checkstyle/checkstyle.xml + true + + + + + check + + + +
+ + + + + pmd + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.23.0 - true + true + + .config/pmd/ruleset.xml + + + + net.sourceforge.pmd + pmd-core + 7.2.0 + + + net.sourceforge.pmd + pmd-java + 7.2.0 + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 3.4.0 + + + From f5240c0ba9f96827abdd6c76d072883bda47edec Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:57:44 +0200 Subject: [PATCH 33/44] Add pmd to published module --- template-placeholder/pom.xml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 5030ab1..05a241f 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -265,5 +265,45 @@ + + pmd + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.23.0 + + true + + ../.config/pmd/ruleset.xml + + + + + net.sourceforge.pmd + pmd-core + 7.2.0 + + + net.sourceforge.pmd + pmd-java + 7.2.0 + + + + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 3.4.0 + + + + From 11c6f7e9bd7a831a0929da58d4143406f95eeede Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:59:00 +0200 Subject: [PATCH 34/44] Add pmd to check-build workflow --- .github/workflows/check-build.yml | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index fa9b7f5..2ac6530 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -70,7 +70,7 @@ jobs: path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar if-no-files-found: error - code-style: + checkstyle: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} @@ -91,3 +91,40 @@ jobs: - name: Run Checkstyle run: ./mvnw -B checkstyle:check -P checkstyle -T2C + + pmd: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + + strategy: + matrix: + java: [17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Run PMD + run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C + + - name: Run CPD (Copy Paste Detector) + run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C + + - name: Upload report + if: always() + uses: actions/upload-artifact@v4 + with: + name: pmd-report + if-no-files-found: ignore + path: | + target/site/*.html + target/site/css/** + target/site/images/logos/maven-feather.png + target/site/images/external.png From d979ab94bb0a290219aef5cfbd97625843b93a8d Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 19 Jun 2024 08:41:49 +0200 Subject: [PATCH 35/44] PMD: printFailingErrors --- pom.xml | 1 + template-placeholder/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 3a04c7a..e41a6a2 100644 --- a/pom.xml +++ b/pom.xml @@ -73,6 +73,7 @@ 3.23.0 true + true .config/pmd/ruleset.xml diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 05a241f..b743ae7 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -275,6 +275,7 @@ 3.23.0 true + true ../.config/pmd/ruleset.xml From 6a258c70a5b6a423ca90196e79f0b37a2a2302b3 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:02:41 +0200 Subject: [PATCH 36/44] Remove duplicate in .gitignore --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index d0e81bf..116a656 100644 --- a/.gitignore +++ b/.gitignore @@ -39,11 +39,6 @@ buildNumber.properties # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* - -# bin / compiled stuff -target/ - - # JRebel **/resources/rebel.xml **/resources/rebel-remote.xml From f2290e689466bac63811f4ca96b6069ec1f9c8ee Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 08:34:54 +0200 Subject: [PATCH 37/44] Ignore project internal depenedencies --- renovate.json5 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11a77b2..11024f4 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,4 +1,14 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "rebaseWhen": "behind-base-branch" + "rebaseWhen": "behind-base-branch", + "packageRules": [ + { + "description": "Ignore project internal dependencies", + "packagePattern": "^software.xdev:template-placeholder", + "datasources": [ + "maven" + ], + "enabled": false + } + ] } From c3a248e8e0e6170f9d4d41c3f23e1ba92655d915 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:11:03 +0200 Subject: [PATCH 38/44] Update pom.xml --- template-placeholder/pom.xml | 91 ------------------------------------ 1 file changed, 91 deletions(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 9792ba5..a3b0bf2 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -5,19 +5,6 @@ 4.0.0 software.xdev -<<<<<<<< HEAD:template-placeholder/pom.xml - template-placeholder - 1.0.0-SNAPSHOT - jar - - template-placeholder - template-placeholder - https://github.com/xdev-software/template-placeholder - - - https://github.com/xdev-software/template-placeholder - scm:git:https://github.com/xdev-software/template-placeholder.git -======== thread-origin-agent 1.1.1-SNAPSHOT jar @@ -29,7 +16,6 @@ https://github.com/xdev-software/thread-origin-agent scm:git:https://github.com/xdev-software/thread-origin-agent.git ->>>>>>>> develop:thread-origin-agent/pom.xml 2019 @@ -154,22 +140,8 @@ org.apache.maven.plugins -<<<<<<<< HEAD:template-placeholder/pom.xml - maven-javadoc-plugin - 3.7.0 - - - attach-javadocs - verify - - jar - - - -======== maven-assembly-plugin 3.7.1 ->>>>>>>> develop:thread-origin-agent/pom.xml jar-with-dependencies @@ -193,69 +165,6 @@ -<<<<<<<< HEAD:template-placeholder/pom.xml - ossrh - - - - org.codehaus.mojo - flatten-maven-plugin - 1.6.0 - - ossrh - - - - flatten - process-resources - - flatten - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.4 - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 - true - - ossrh - https://s01.oss.sonatype.org/ - - 30 - true - - - - - - -======== ->>>>>>>> develop:thread-origin-agent/pom.xml checkstyle From b621788f591451224bdd4f201bb2eb468ea11180 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:11:18 +0200 Subject: [PATCH 39/44] Delete pom.xml --- thread-origin-agent/pom.xml | 330 ------------------------------------ 1 file changed, 330 deletions(-) delete mode 100644 thread-origin-agent/pom.xml diff --git a/thread-origin-agent/pom.xml b/thread-origin-agent/pom.xml deleted file mode 100644 index 9792ba5..0000000 --- a/thread-origin-agent/pom.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - 4.0.0 - - software.xdev -<<<<<<<< HEAD:template-placeholder/pom.xml - template-placeholder - 1.0.0-SNAPSHOT - jar - - template-placeholder - template-placeholder - https://github.com/xdev-software/template-placeholder - - - https://github.com/xdev-software/template-placeholder - scm:git:https://github.com/xdev-software/template-placeholder.git -======== - thread-origin-agent - 1.1.1-SNAPSHOT - jar - - thread-origin-agent - thread-origin-agent - https://github.com/xdev-software/thread-origin-agent - - - https://github.com/xdev-software/thread-origin-agent - scm:git:https://github.com/xdev-software/thread-origin-agent.git ->>>>>>>> develop:thread-origin-agent/pom.xml - - - 2019 - - - XDEV Software - https://xdev.software - - - - - XDEV Software - XDEV Software - https://xdev.software - - - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - 17 - ${javaVersion} - - UTF-8 - UTF-8 - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - - - org.javassist - javassist - 3.30.2-GA - - - - - - - - org.apache.maven.plugins - maven-site-plugin - 4.0.0-M15 - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.6.0 - - - - - - com.mycila - license-maven-plugin - 4.5 - - - ${project.organization.url} - - - -
com/mycila/maven/plugin/license/templates/APACHE-2.txt
- - src/main/java/** - src/test/java/** - -
-
-
- - - first - - format - - process-sources - - -
- - - org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 - - ${maven.compiler.release} - - -proc:none - - - - - - org.apache.maven.plugins -<<<<<<<< HEAD:template-placeholder/pom.xml - maven-javadoc-plugin - 3.7.0 - - - attach-javadocs - verify - - jar - - - -======== - maven-assembly-plugin - 3.7.1 ->>>>>>>> develop:thread-origin-agent/pom.xml - - - jar-with-dependencies - - false - - src/main/resources/META-INF/MANIFEST.MF - - - - - make-assembly - package - - single - - - - -
-
- - -<<<<<<<< HEAD:template-placeholder/pom.xml - ossrh - - - - org.codehaus.mojo - flatten-maven-plugin - 1.6.0 - - ossrh - - - - flatten - process-resources - - flatten - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.4 - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 - true - - ossrh - https://s01.oss.sonatype.org/ - - 30 - true - - - - - - -======== ->>>>>>>> develop:thread-origin-agent/pom.xml - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.4.0 - - - com.puppycrawl.tools - checkstyle - 10.17.0 - - - - ../.config/checkstyle/checkstyle.xml - true - - - - - check - - - - - - - - - pmd - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.23.0 - - true - true - - ../.config/pmd/ruleset.xml - - - - - net.sourceforge.pmd - pmd-core - 7.2.0 - - - net.sourceforge.pmd - pmd-java - 7.2.0 - - - - - - - - - - org.apache.maven.plugins - maven-jxr-plugin - 3.4.0 - - - - - -
From abe0940e8dbbc7293931692846ec248a4ff332f8 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:11:32 +0200 Subject: [PATCH 40/44] Move to resync --- {template-placeholder => thread-origin-agent}/pom.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {template-placeholder => thread-origin-agent}/pom.xml (100%) diff --git a/template-placeholder/pom.xml b/thread-origin-agent/pom.xml similarity index 100% rename from template-placeholder/pom.xml rename to thread-origin-agent/pom.xml From 01e97735a81e686a00346655ab0dc2d4d64c5cc5 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:12:06 +0200 Subject: [PATCH 41/44] Fix name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2e4432..9fbcaa6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/thread-origin-agent/checkBuild.yml?branch=develop)](https://github.com/xdev-software/thread-origin-agent/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/thread-origin-agent/check-build.yml?branch=develop)](https://github.com/xdev-software/thread-origin-agent/actions/workflows/check-build.yml?query=branch%3Adevelop) # Thread Origin Agent From d3cc878ac1fde1aac75aa18cd24b813ad652a8b7 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:13:43 +0200 Subject: [PATCH 42/44] Fill in template --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11024f4..c091599 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -4,7 +4,7 @@ "packageRules": [ { "description": "Ignore project internal dependencies", - "packagePattern": "^software.xdev:template-placeholder", + "packagePattern": "^software.xdev:thread-origin-agent", "datasources": [ "maven" ], From c87c4737410d014e707a7f43af62fa5caaecc637 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:14:19 +0200 Subject: [PATCH 43/44] Consistent naming --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b032d04..7ac4484 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,7 +99,7 @@ jobs: ## Installation Download the javaagent from the assets section below and [attach it to your java application](https://github.com/xdev-software/thread-origin-agent#usage). - publish_assets: + publish-assets: runs-on: ubuntu-latest needs: [prepare-release] steps: @@ -158,7 +158,7 @@ jobs: after-release: runs-on: ubuntu-latest - needs: [publish_assets] + needs: [publish-assets] steps: - uses: actions/checkout@v4 From fca3d8ea836f6bce6a42857a902d0102127799c0 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 09:16:06 +0200 Subject: [PATCH 44/44] Update ThreadOriginTransformer.java --- .../xdev/tools/threadoriginagent/ThreadOriginTransformer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/thread-origin-agent/src/main/java/software/xdev/tools/threadoriginagent/ThreadOriginTransformer.java b/thread-origin-agent/src/main/java/software/xdev/tools/threadoriginagent/ThreadOriginTransformer.java index b513400..7a2aa23 100644 --- a/thread-origin-agent/src/main/java/software/xdev/tools/threadoriginagent/ThreadOriginTransformer.java +++ b/thread-origin-agent/src/main/java/software/xdev/tools/threadoriginagent/ThreadOriginTransformer.java @@ -130,6 +130,7 @@ public static void premain(final String agentArgument, final Instrumentation ins log("Retransformed loaded classes; " + success + "x successful, " + unmodifiable + "x unmodifiable"); } + @SuppressWarnings({"PMD.CognitiveComplexity", "PMD.NPathComplexity"}) @Override public byte[] transform( final ClassLoader loader,