From ae355e4660313b0b76d977b56615ee6ccf8f4648 Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Wed, 17 Sep 2025 00:18:17 +0200 Subject: [PATCH 1/8] add tycho maven build support for bnd This adds support building bnd with Eclipse Tycho 4.0.13 See https://tycho.eclipseprojects.io/doc/4.0.13/BndBuild.html e.g. build inside the repo root with: `mvn clean verify` Signed-off-by: Christoph Rueger --- .mvn/extensions.xml | 8 ++++++++ .mvn/maven.config | 1 + 2 files changed, 9 insertions(+) create mode 100644 .mvn/extensions.xml create mode 100644 .mvn/maven.config diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 0000000000..cb6e0d7535 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,8 @@ + + + + org.eclipse.tycho + tycho-build + ${tycho-version} + + \ No newline at end of file diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 0000000000..38315bb964 --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1 @@ +-Dtycho-version=4.0.13 \ No newline at end of file From 20785f9522fdf40dbf77ecdeb487e8c0bfd9cfea Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Wed, 17 Sep 2025 00:51:50 +0200 Subject: [PATCH 2/8] build all bundles mvn clean verify -fae -fae needed.to skip a current error in org.bndtools.p2 which will go away soon after PR 6808 Signed-off-by: Christoph Rueger --- .gitignore | 3 +++ cnf/pom.xml | 36 ++++++++++++++++++++++++++++++++++++ pom.xml => old_pom.xml | 0 3 files changed, 39 insertions(+) create mode 100644 cnf/pom.xml rename pom.xml => old_pom.xml (100%) diff --git a/.gitignore b/.gitignore index 0623caf0cf..45c9213ce9 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ Archive target/ *.code-workspace bndtools.test/workspace/ +_log/ +.polyglot* +.tycho* diff --git a/cnf/pom.xml b/cnf/pom.xml new file mode 100644 index 0000000000..9e5139d519 --- /dev/null +++ b/cnf/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + com.example.mygroup + configurator + 1.0.0-SNAPSHOT + pom + + + + + + + + + + + file-activation-example + + + someFile + + + + + + + + + + + ../maven-plugins + + \ No newline at end of file diff --git a/pom.xml b/old_pom.xml similarity index 100% rename from pom.xml rename to old_pom.xml From 13a1b154db5decc53b8a06613fed037f4549019b Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Wed, 17 Sep 2025 01:04:23 +0200 Subject: [PATCH 3/8] use old_pom.xml in CI Build we needed to rename /pom.xml to old_pom.xml because otherwise it will conflict / confuse tycho Signed-off-by: Christoph Rueger --- .github/scripts/ci-build.sh | 44 +++------------------------------ .github/scripts/ci-publish.sh | 43 ++------------------------------ .github/scripts/codeql-build.sh | 2 +- 3 files changed, 7 insertions(+), 82 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 4f98fd359d..35c967292b 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash set -ev -# this is importing the private key on the CI machine +# gpg key handling for github action build if [[ -n "${GPG_PRIVATE_KEY}" && -n "${GPG_PASSPHRASE}" ]]; then - echo -e "#\n# GPG - importing private key on local machine\n#\n" + echo "GPG environment variables validated successfully" echo "${GPG_PRIVATE_KEY}" | \ gpg --batch \ --yes \ @@ -16,45 +16,9 @@ if [[ -n "${GPG_PRIVATE_KEY}" && -n "${GPG_PASSPHRASE}" ]]; then export GPG_TTY=$(tty) fi -# verify that the GPG agent is working by signing and verifying a test message -# and configure MAVEN_SIGNING_ARGS to use the GPG key and passphrase for signing, or skip signing if not configured -if [[ -n "${GPG_KEY_ID}" && -n "${GPG_PASSPHRASE}" ]]; then - echo -e "#\n# GPG signing to configure and activate GPG agent\n#\n" - echo "test" | \ - gpg --batch \ - --yes \ - --local-user "${GPG_KEY_ID}" \ - --pinentry-mode loopback \ - --passphrase "${GPG_PASSPHRASE}" \ - --clearsign | \ - gpg --verify - echo -e "#\n# GPG signing to configure and activate GPG agent\n#\n" - MAVEN_SIGNING_ARGS=" -Dgpg.keyname=${GPG_KEY_ID} -Dgpg.passphraseEnvName=GPG_PASSPHRASE" -else - echo -e "#\n# GPG signing environment variables not configured, SKIPPING GPG signing\n#\n" - MAVEN_SIGNING_ARGS=" -Dgpg.skip=true" -fi - # build -echo -e "#\n# gradle and maven versions\n#\n" ./gradlew --no-daemon --version ./mvnw --version - -echo -e "#\n# build bnd and bndtools\n#\n" -./gradlew \ - --no-daemon \ - -Dmaven.repo.local=dist/m2 \ - -Dbnd.sonatype.release.description=${GITHUB_JOB}_${GITHUB_RUN_NUMBER} \ - --continue \ - build "$@" - -echo -e "#\n# build gradle plugins\n#\n" +./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :build "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:build - -echo -e "#\n# build maven plugins\n#\n" -./mvnw \ - -Dmaven.repo.local=dist/m2 \ - --batch-mode \ - --no-transfer-progress \ - $MAVEN_SIGNING_ARGS \ - install +./mvnw -f old_pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install diff --git a/.github/scripts/ci-publish.sh b/.github/scripts/ci-publish.sh index f3d7612be7..20196bb124 100755 --- a/.github/scripts/ci-publish.sh +++ b/.github/scripts/ci-publish.sh @@ -1,43 +1,4 @@ #!/usr/bin/env bash set -ev - -# Prepare GPG arguments for Maven and Gradle if environment variables are set -GPG_ARGS="" -GRADLE_GPG_ARGS="" -if [[ -n "${GPG_KEY_ID:-}" ]]; then - GPG_ARGS="-Dgpg.keyname=${GPG_KEY_ID}" - GRADLE_GPG_ARGS="-Psigning.gnupg.keyName=${GPG_KEY_ID}" - if [[ -n "${GPG_PASSPHRASE:-}" ]]; then - GRADLE_GPG_ARGS="${GRADLE_GPG_ARGS} -Psigning.gnupg.passphrase=${GPG_PASSPHRASE}" - fi -fi - -# Detect snapshot build: if #-snapshot is commented out in cnf/build.bnd, -# the build produces SNAPSHOT versions -IS_SNAPSHOT=false -if grep -qE '^#-snapshot:' cnf/build.bnd 2>/dev/null; then - IS_SNAPSHOT=true -fi - -# 1. publish gradle-plugins to dist/bundles -./gradlew --no-daemon -Dmaven.repo.local=dist/m2 ${GRADLE_GPG_ARGS} :gradle-plugins:publish "$@" - -# 2. publish maven-plugins to dist/bundles (enforce dist profile, and explicitly disable jfrog) -./mvnw -Dmaven.repo.local=dist/m2 --batch-mode -Pdist,\!jfrog -Dreleaserepo=file:dist/bundles ${GPG_ARGS} deploy -# publish again for jfrog (with env.CANONICAL=true, where jfrog profile is chosen) -./mvnw -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles ${GPG_ARGS} deploy - -# 3. publish bnd workspace to dist/bundles (and JFrog if CANONICAL) -./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish "$@" - -# 4. Upload to Sonatype Central Portal (separate from building) -if [[ -n "${SONATYPE_BEARER:-}" ]]; then - SONATYPE_OPTS="" - if [[ -n "${SONATYPE_PUBLISHING_TYPE:-}" ]]; then - SONATYPE_OPTS="--publishing-type ${SONATYPE_PUBLISHING_TYPE}" - fi - if [[ "${IS_SNAPSHOT}" == "true" ]]; then - SONATYPE_OPTS="${SONATYPE_OPTS} --snapshot" - fi - ./.github/scripts/sonatype-upload.sh ${SONATYPE_OPTS} dist/bundles -fi +./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish :gradle-plugins:publish "$@" +./mvnw -f old_pom.xml -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy diff --git a/.github/scripts/codeql-build.sh b/.github/scripts/codeql-build.sh index 64fe0d44c3..1e9e3d3439 100755 --- a/.github/scripts/codeql-build.sh +++ b/.github/scripts/codeql-build.sh @@ -4,4 +4,4 @@ set -ev ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue testClasses :dist:jarDependencies "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:testClasses -./mvnw -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile +./mvnw -f old_pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile From 78cecb1c38d3d25abd417bcdefe5bf555a557077 Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Wed, 17 Sep 2025 01:29:09 +0200 Subject: [PATCH 4/8] set -Djdk.xml.maxGeneralEntitySizeLimit to fix `JAXP00010003: The length of entity "[xml]" is "100,001" that exceeds the "100,000" limit set by "jdk.xml.maxGeneralEntitySizeLimit"` Signed-off-by: Christoph Rueger --- .github/scripts/ci-build.sh | 2 +- .github/scripts/ci-publish.sh | 2 +- .github/scripts/codeql-build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 35c967292b..983fbe729c 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -21,4 +21,4 @@ fi ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :build "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:build -./mvnw -f old_pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install +./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=500000 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install diff --git a/.github/scripts/ci-publish.sh b/.github/scripts/ci-publish.sh index 20196bb124..9a0e7e28b7 100755 --- a/.github/scripts/ci-publish.sh +++ b/.github/scripts/ci-publish.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -ev ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish :gradle-plugins:publish "$@" -./mvnw -f old_pom.xml -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy +./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=500000 -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy diff --git a/.github/scripts/codeql-build.sh b/.github/scripts/codeql-build.sh index 1e9e3d3439..999211181f 100755 --- a/.github/scripts/codeql-build.sh +++ b/.github/scripts/codeql-build.sh @@ -4,4 +4,4 @@ set -ev ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue testClasses :dist:jarDependencies "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:testClasses -./mvnw -f old_pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile +./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=500000 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile From e7d6c46e0055fa9a20a81da15c4009385d4e99eb Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Wed, 17 Sep 2025 05:31:06 +0200 Subject: [PATCH 5/8] more xml limits Signed-off-by: Christoph Rueger --- .github/scripts/ci-build.sh | 2 +- .github/scripts/ci-publish.sh | 2 +- .github/scripts/codeql-build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 983fbe729c..35362eeb8f 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -21,4 +21,4 @@ fi ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :build "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:build -./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=500000 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install +./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install diff --git a/.github/scripts/ci-publish.sh b/.github/scripts/ci-publish.sh index 9a0e7e28b7..49addf202b 100755 --- a/.github/scripts/ci-publish.sh +++ b/.github/scripts/ci-publish.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -ev ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish :gradle-plugins:publish "$@" -./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=500000 -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy +./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy diff --git a/.github/scripts/codeql-build.sh b/.github/scripts/codeql-build.sh index 999211181f..58950927f3 100755 --- a/.github/scripts/codeql-build.sh +++ b/.github/scripts/codeql-build.sh @@ -4,4 +4,4 @@ set -ev ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue testClasses :dist:jarDependencies "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:testClasses -./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=500000 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile +./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile From 69d76d67fd0e74fa0be1ddfde1cb0c2689be2db8 Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Wed, 17 Sep 2025 16:39:13 +0200 Subject: [PATCH 6/8] build maven-plugins/pom.xml explicitly this ensures that tycho is only used when building in root with `mvn clean verify` but not when building with `mvn -f maven-plugins/pom.xml` adjust CI build scripts to call `mvn -f maven-plugins/pom.xml` Signed-off-by: Christoph Rueger --- .github/scripts/ci-build.sh | 2 +- .github/scripts/ci-publish.sh | 2 +- .github/scripts/codeql-build.sh | 2 +- old_pom.xml | 23 ----------------------- 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 old_pom.xml diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 35362eeb8f..f9689295e9 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -21,4 +21,4 @@ fi ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :build "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:build -./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install +./mvnw -f maven-plugins/pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install diff --git a/.github/scripts/ci-publish.sh b/.github/scripts/ci-publish.sh index 49addf202b..f12d66d592 100755 --- a/.github/scripts/ci-publish.sh +++ b/.github/scripts/ci-publish.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -ev ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish :gradle-plugins:publish "$@" -./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy +./mvnw -f maven-plugins/pom.xml -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy diff --git a/.github/scripts/codeql-build.sh b/.github/scripts/codeql-build.sh index 58950927f3..b18933be0f 100755 --- a/.github/scripts/codeql-build.sh +++ b/.github/scripts/codeql-build.sh @@ -4,4 +4,4 @@ set -ev ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue testClasses :dist:jarDependencies "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:testClasses -./mvnw -f old_pom.xml -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0 -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile +./mvnw -f maven-plugins/pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile diff --git a/old_pom.xml b/old_pom.xml deleted file mode 100644 index c93df9181d..0000000000 --- a/old_pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - - biz.aQute.bnd - maven - 1.0.0 - Reactor to build the Maven projects. - Bnd Maven Reactor - pom - - - UTF-8 - true - true - - - - maven-plugins - - From 100966933c8a4bdfcac3244d9a5f9b9299a522b6 Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Fri, 21 Nov 2025 08:13:29 +0100 Subject: [PATCH 7/8] Update cnf/pom.xml Co-authored-by: Peter Kirschner Signed-off-by: Christoph Rueger --- cnf/pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cnf/pom.xml b/cnf/pom.xml index 9e5139d519..8df47c47e8 100644 --- a/cnf/pom.xml +++ b/cnf/pom.xml @@ -10,6 +10,18 @@ + + + bndtools-snapshots + https://bndtools.jfrog.io/artifactory/libs-snapshot/ + + true + + + false + + + From 7e3555f0668b1b3dd8ccb67f794d121803ccd3d3 Mon Sep 17 00:00:00 2001 From: Christoph Rueger Date: Sun, 22 Mar 2026 13:43:54 +0100 Subject: [PATCH 8/8] update to tycho 5.0.2 Signed-off-by: Christoph Rueger --- .github/scripts/ci-build.sh | 44 ++++++++++++++++++++++++++++++--- .github/scripts/ci-publish.sh | 43 ++++++++++++++++++++++++++++++-- .github/scripts/codeql-build.sh | 2 +- .mvn/maven.config | 2 +- cnf/pom.xml | 14 +---------- 5 files changed, 84 insertions(+), 21 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index f9689295e9..4f98fd359d 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash set -ev -# gpg key handling for github action build +# this is importing the private key on the CI machine if [[ -n "${GPG_PRIVATE_KEY}" && -n "${GPG_PASSPHRASE}" ]]; then - echo "GPG environment variables validated successfully" + echo -e "#\n# GPG - importing private key on local machine\n#\n" echo "${GPG_PRIVATE_KEY}" | \ gpg --batch \ --yes \ @@ -16,9 +16,45 @@ if [[ -n "${GPG_PRIVATE_KEY}" && -n "${GPG_PASSPHRASE}" ]]; then export GPG_TTY=$(tty) fi +# verify that the GPG agent is working by signing and verifying a test message +# and configure MAVEN_SIGNING_ARGS to use the GPG key and passphrase for signing, or skip signing if not configured +if [[ -n "${GPG_KEY_ID}" && -n "${GPG_PASSPHRASE}" ]]; then + echo -e "#\n# GPG signing to configure and activate GPG agent\n#\n" + echo "test" | \ + gpg --batch \ + --yes \ + --local-user "${GPG_KEY_ID}" \ + --pinentry-mode loopback \ + --passphrase "${GPG_PASSPHRASE}" \ + --clearsign | \ + gpg --verify + echo -e "#\n# GPG signing to configure and activate GPG agent\n#\n" + MAVEN_SIGNING_ARGS=" -Dgpg.keyname=${GPG_KEY_ID} -Dgpg.passphraseEnvName=GPG_PASSPHRASE" +else + echo -e "#\n# GPG signing environment variables not configured, SKIPPING GPG signing\n#\n" + MAVEN_SIGNING_ARGS=" -Dgpg.skip=true" +fi + # build +echo -e "#\n# gradle and maven versions\n#\n" ./gradlew --no-daemon --version ./mvnw --version -./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :build "$@" + +echo -e "#\n# build bnd and bndtools\n#\n" +./gradlew \ + --no-daemon \ + -Dmaven.repo.local=dist/m2 \ + -Dbnd.sonatype.release.description=${GITHUB_JOB}_${GITHUB_RUN_NUMBER} \ + --continue \ + build "$@" + +echo -e "#\n# build gradle plugins\n#\n" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:build -./mvnw -f maven-plugins/pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress install + +echo -e "#\n# build maven plugins\n#\n" +./mvnw \ + -Dmaven.repo.local=dist/m2 \ + --batch-mode \ + --no-transfer-progress \ + $MAVEN_SIGNING_ARGS \ + install diff --git a/.github/scripts/ci-publish.sh b/.github/scripts/ci-publish.sh index f12d66d592..c2d44329d6 100755 --- a/.github/scripts/ci-publish.sh +++ b/.github/scripts/ci-publish.sh @@ -1,4 +1,43 @@ #!/usr/bin/env bash set -ev -./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish :gradle-plugins:publish "$@" -./mvnw -f maven-plugins/pom.xml -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles deploy + +# Prepare GPG arguments for Maven and Gradle if environment variables are set +GPG_ARGS="" +GRADLE_GPG_ARGS="" +if [[ -n "${GPG_KEY_ID:-}" ]]; then + GPG_ARGS="-Dgpg.keyname=${GPG_KEY_ID}" + GRADLE_GPG_ARGS="-Psigning.gnupg.keyName=${GPG_KEY_ID}" + if [[ -n "${GPG_PASSPHRASE:-}" ]]; then + GRADLE_GPG_ARGS="${GRADLE_GPG_ARGS} -Psigning.gnupg.passphrase=${GPG_PASSPHRASE}" + fi +fi + +# Detect snapshot build: if #-snapshot is commented out in cnf/build.bnd, +# the build produces SNAPSHOT versions +IS_SNAPSHOT=false +if grep -qE '^#-snapshot:' cnf/build.bnd 2>/dev/null; then + IS_SNAPSHOT=true +fi + +# 1. publish gradle-plugins to dist/bundles +./gradlew --no-daemon -Dmaven.repo.local=dist/m2 ${GRADLE_GPG_ARGS} :gradle-plugins:publish "$@" + +# 2. publish maven-plugins to dist/bundles (enforce dist profile, and explicitly disable jfrog) +./mvnw -Dmaven.repo.local=dist/m2 --batch-mode -Pdist,\!jfrog -Dreleaserepo=file:dist/bundles ${GPG_ARGS} deploy +# publish again for jfrog (with env.CANONICAL=true, where jfrog profile is chosen) +./mvnw -Dmaven.repo.local=dist/m2 --batch-mode -Pdist -Dreleaserepo=file:dist/bundles ${GPG_ARGS} deploy + +# 3. publish bnd workspace to dist/bundles (and JFrog if CANONICAL) +./gradlew --no-daemon -Dmaven.repo.local=dist/m2 :publish "$@" + +# 4. Upload to Sonatype Central Portal (separate from building) +if [[ -n "${SONATYPE_BEARER:-}" ]]; then + SONATYPE_OPTS="" + if [[ -n "${SONATYPE_PUBLISHING_TYPE:-}" ]]; then + SONATYPE_OPTS="--publishing-type ${SONATYPE_PUBLISHING_TYPE}" + fi + if [[ "${IS_SNAPSHOT}" == "true" ]]; then + SONATYPE_OPTS="${SONATYPE_OPTS} --snapshot" + fi + ./.github/scripts/sonatype-upload.sh ${SONATYPE_OPTS} dist/bundles +fi \ No newline at end of file diff --git a/.github/scripts/codeql-build.sh b/.github/scripts/codeql-build.sh index b18933be0f..5367812062 100755 --- a/.github/scripts/codeql-build.sh +++ b/.github/scripts/codeql-build.sh @@ -4,4 +4,4 @@ set -ev ./mvnw --version ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue testClasses :dist:jarDependencies "$@" ./gradlew --no-daemon -Dmaven.repo.local=dist/m2 --continue :gradle-plugins:testClasses -./mvnw -f maven-plugins/pom.xml -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile +./mvnw -Dmaven.repo.local=dist/m2 --batch-mode --no-transfer-progress test-compile \ No newline at end of file diff --git a/.mvn/maven.config b/.mvn/maven.config index 38315bb964..a3c944e4cc 100644 --- a/.mvn/maven.config +++ b/.mvn/maven.config @@ -1 +1 @@ --Dtycho-version=4.0.13 \ No newline at end of file +-Dtycho-version=5.0.2 \ No newline at end of file diff --git a/cnf/pom.xml b/cnf/pom.xml index 8df47c47e8..267f236f13 100644 --- a/cnf/pom.xml +++ b/cnf/pom.xml @@ -3,25 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - com.example.mygroup + biz.aQute.bnd configurator 1.0.0-SNAPSHOT pom - - - bndtools-snapshots - https://bndtools.jfrog.io/artifactory/libs-snapshot/ - - true - - - false - - -