From f2153e51679a1e06e25bf5c2dee6953717d59ca0 Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Thu, 19 Feb 2026 03:15:21 +0100 Subject: [PATCH 1/3] add format-java.sh using eclips format.xml --- mvn/format-java.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 mvn/format-java.sh diff --git a/mvn/format-java.sh b/mvn/format-java.sh new file mode 100644 index 0000000..7993aee --- /dev/null +++ b/mvn/format-java.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -euo pipefail + +# Calculate script directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +FORMATTER_CONFIG="$DIR/../eclipse/synventis-code-formatter.xml" + +# Help message +function show_help { + echo "Usage: $0 [options] [maven-args]" + echo "" + echo "Formats Java code using the Synventis code formatter." + echo "" + echo "Options:" + echo " -h, --help Show this help message" + echo "" + echo "All other arguments are passed to the Maven command." +} + +# Parse arguments for help +for arg in "$@"; do + case $arg in + -h|--help) + show_help + exit 0 + ;; + esac +done + +# Check if formatter config exists +if [ ! -f "$FORMATTER_CONFIG" ]; then + echo "Error: Formatter config file not found at $FORMATTER_CONFIG" + exit 1 +fi + +mvn net.revelc.code.formatter:formatter-maven-plugin:2.23.0:format \ + -Dformatter.configFile="$FORMATTER_CONFIG" \ + -Dencoding=UTF-8 \ + -Dproject.build.sourceEncoding=UTF-8 \ + "$@" From 3c01168d97d804464c98bace4223e57990bf189f Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sat, 21 Feb 2026 03:38:59 +0100 Subject: [PATCH 2/3] adjust splitLine to 120 --- eclipse/synventis-code-formatter.xml | 1104 +++++++++++++++++--------- 1 file changed, 744 insertions(+), 360 deletions(-) diff --git a/eclipse/synventis-code-formatter.xml b/eclipse/synventis-code-formatter.xml index b0d2848..99da26d 100644 --- a/eclipse/synventis-code-formatter.xml +++ b/eclipse/synventis-code-formatter.xml @@ -1,365 +1,749 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 39cd8a8ed46ae89e2c898f685546e1e5dd2603d6 Mon Sep 17 00:00:00 2001 From: Fabian Pichler Date: Sun, 22 Feb 2026 02:58:43 +0100 Subject: [PATCH 3/3] correct configfile cli param --- mvn/format-java.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mvn/format-java.sh b/mvn/format-java.sh index 7993aee..837753b 100644 --- a/mvn/format-java.sh +++ b/mvn/format-java.sh @@ -4,6 +4,7 @@ set -euo pipefail # Calculate script directory DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" FORMATTER_CONFIG="$DIR/../eclipse/synventis-code-formatter.xml" +echo "Formater-config: $FORMATTER_CONFIG" # Help message function show_help { @@ -33,8 +34,13 @@ if [ ! -f "$FORMATTER_CONFIG" ]; then exit 1 fi +echo "`pwd`" + mvn net.revelc.code.formatter:formatter-maven-plugin:2.23.0:format \ - -Dformatter.configFile="$FORMATTER_CONFIG" \ - -Dencoding=UTF-8 \ + -Dconfigfile="$FORMATTER_CONFIG" \ + -Dlineending=LF \ + -Dmaven.compiler.source=21 \ + -Dmaven.compiler.target=21 \ + -Dformatter.overrideConfigCompilerVersion=true \ -Dproject.build.sourceEncoding=UTF-8 \ "$@"