Skip to content

Commit

Permalink
HSEARCH-5094 Disable build scan and build cache for irrelevant Maven …
Browse files Browse the repository at this point in the history
…executions
  • Loading branch information
yrodiere committed Mar 1, 2024
1 parent 0a69997 commit 63a5c66
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,11 @@ stage('Default build') {
usernameVariable: 'SONARCLOUD_ORGANIZATION',
passwordVariable: 'SONARCLOUD_TOKEN'
)]) {
// We don't want to use the build cache or build scans for this execution
def miscMavenArgs = '-Dscan=false -Dno-build-cache'
sh """ \
mvn sonar:sonar \
${miscMavenArgs} \
-Dsonar.organization=\${SONARCLOUD_ORGANIZATION} \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.token=\${SONARCLOUD_TOKEN} \
Expand Down
8 changes: 8 additions & 0 deletions build/parents/public/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
<release>${maven.compiler.release}</release>
<!-- Exclude implementation classes from the javadoc -->
<excludePackageNames>*.impl,*.impl.*</excludePackageNames>
<!--
This feature tries to set up links between javadoc of different modules.
We don't need that since we merge everything together in the end,
and it leads to really annoying additional Maven executions
that end up publishing build scans on CI,
so we disable it.
-->
<detectOfflineLinks>false</detectOfflineLinks>
<!--
Make sure to always use offline links,
otherwise the build will need to access external websites,
Expand Down
4 changes: 3 additions & 1 deletion ci/dependency-update/perform-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ fi
if [ -n "$PROPERTIES" ]
then
echo "Updating properties '$PROPERTIES'."
# We don't want to use the build cache or build scans for this execution
MISC_MAVEN_ARGS="-Dscan=false -Dno-build-cache"
# We allow any update, but constrain using a rules file (more flexible)
# We allow downgrades because the versions plugin considers e.g. 6.2.0-SNAPSHOT to be lower than 6.2.0.CR2
./mvnw --quiet -U -Pdependency-update -Pdist org.codehaus.mojo:versions-maven-plugin:update-properties \
./mvnw --quiet $MISC_MAVEN_ARGS -U -Pdependency-update -Pdist org.codehaus.mojo:versions-maven-plugin:update-properties \
-DgenerateBackupPoms=false \
-DallowMajorUpdates=true -DallowMinorUpdates=true -DallowSnapshots=true -DallowDowngrade=true \
-DincludeProperties="$PROPERTIES" \
Expand Down
5 changes: 4 additions & 1 deletion ci/list-container-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
LIST_FILE=$(mktemp)
trap "rm -f $LIST_FILE" EXIT

# We don't want to use the build cache or build scans for this execution
MISC_MAVEN_ARGS="-Dscan=false -Dno-build-cache"

# See the configuration of the maven-scripting-plugin in the main POM
./mvnw scripting:eval@list-container-images -DcontainerImagesListFile="$LIST_FILE" "${@}" 1>&2
./mvnw scripting:eval@list-container-images $MISC_MAVEN_ARGS -DcontainerImagesListFile="$LIST_FILE" "${@}" 1>&2

sort -u "$LIST_FILE" | { grep -Ev "^\s*$" || true; }
5 changes: 4 additions & 1 deletion ci/list-dependent-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ fi
IFS="," COMMA_SEPARATED_TESTED_ARTIFACT_IDS="$*"
TESTED_ARTIFACT_IDS_REGEXP="(\Q$(echo "$*" | perl -pe 's/,/\\E|\\Q/g')\E)"

# We don't want to use the build cache or build scans for this execution
MISC_MAVEN_ARGS="-Dscan=false -Dno-build-cache"

{
./mvnw dependency:list -pl :hibernate-search-parent-integrationtest -am -amd -DincludeArtifactIds="$COMMA_SEPARATED_TESTED_ARTIFACT_IDS"
./mvnw dependency:list $MISC_MAVEN_ARGS -pl :hibernate-search-parent-integrationtest -am -amd -Dscan=false -DincludeArtifactIds="$COMMA_SEPARATED_TESTED_ARTIFACT_IDS"
} \
| perl -0777 -pe "s/(hibernate-search-.*) ---(\n(?!.*Building).*)*\n.*:$TESTED_ARTIFACT_IDS_REGEXP:jar:/\nMATCH:\$1\n/g" \
| perl -ne 'print if s/MATCH:(.*)/:$1/g' \
Expand Down

0 comments on commit 63a5c66

Please sign in to comment.