Skip to content

Use maven reactor for installing modules in mavenExecuteIntegration step#5581

Merged
manjunathSurendrakumar merged 14 commits intoSAP:masterfrom
Quaffel:maven-reactor-in-integration-test
Jan 19, 2026
Merged

Use maven reactor for installing modules in mavenExecuteIntegration step#5581
manjunathSurendrakumar merged 14 commits intoSAP:masterfrom
Quaffel:maven-reactor-in-integration-test

Conversation

@Quaffel
Copy link
Copy Markdown
Member

@Quaffel Quaffel commented Dec 9, 2025

Description

Maven handles multi-module builds through the so-called reactor mechanism (docs). Piper already makes use of that mechanism through the -pl flag in other steps. mavenBuild, for instance, uses the -pl flag to exclude the integration-tests module from the build.

For some reason, piper does not use the same mechanism in the mavenExecuteIntegration step. Instead, piper resolves the pom.xml manifest of the integration-tests module and runs maven for that module only. The optional installArtifacts option does something similar: Rather than installing the integration-tests module and its dependencies in a single go, piper runs the install:install-file goal for every module individually. This is overly complex and probably dissimilar to how developers build their projects locally.

It's also unclear to me why installArtifacts only causes the install:install-file goal to be run. This goal expects that the build artifacts (e.g., jar files) are already present. The Piper general-purpose pipeline does not build the application in the scope of the integration stage though. Some projects seem to work around this by including a build step in the integrationPreSteps.

This pull request extends the mavenExecuteIntegration step with a new option, useReactorForMultiModuleBuild (name open to discussion). When enabled, piper builds and installs the application properly using the maven reactor before running the integration tests. The integration tests are then run using the -pl flag, just as the mavenBuild step does.

In case the use of install:install-file is deliberate, I'd suggest to enhance the documentation of the step for clarification. If users are expected to configure the build themselves (through integrationPreSteps), I feel that the documentation should clearly tell them to do so.

Checklist

  • Tests
  • Documentation
  • Inner source library needs updating

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Dec 9, 2025

CLA assistant check
All committers have signed the CLA.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 9, 2025

@manjunathSurendrakumar
Copy link
Copy Markdown
Member

@Quaffel Thanks for the contribution.

I like the approach and makes sense to me.

I don't know what was the idea behind using maven "install:install-file" goal in the step but the current PR seems to overcome the previous implementation drawbacks.

@manjunathSurendrakumar
Copy link
Copy Markdown
Member

/it

Comment thread resources/metadata/mavenExecuteIntegration.yaml Outdated
@sap-email-compliance
Copy link
Copy Markdown

SAP employees are expected to use their SAP-email address for commits related to their work. Our compliance check has detected usage of an email other than a SAP one by a SAP employee. Please update your pull request accordingly.

If you think this is wrong or need any assistance, please contact ospo@sap.com.

@Quaffel Quaffel marked this pull request as ready for review January 16, 2026 11:08
@Quaffel Quaffel requested a review from a team as a code owner January 16, 2026 11:08
@Quaffel Quaffel force-pushed the maven-reactor-in-integration-test branch from d096285 to 0d0d988 Compare January 16, 2026 11:14
@Quaffel
Copy link
Copy Markdown
Member Author

Quaffel commented Jan 16, 2026

Sorry, I accidentally merged master into my branch using the GitHub UI. The merge commit therefore contained my personal email address and caused the sap-email-comliance check to fail. I therefore had to remove the problematic merge commit, merge the changes locally, and force-push.

@manjunathSurendrakumar
Copy link
Copy Markdown
Member

/it

Copy link
Copy Markdown
Member

@manjunathSurendrakumar manjunathSurendrakumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarqubecloud
Copy link
Copy Markdown

@manjunathSurendrakumar
Copy link
Copy Markdown
Member

/it

@manjunathSurendrakumar manjunathSurendrakumar merged commit 3932202 into SAP:master Jan 19, 2026
13 of 14 checks passed
@Quaffel Quaffel deleted the maven-reactor-in-integration-test branch January 19, 2026 12:02
maxatsap added a commit to maxatsap/jenkins-library that referenced this pull request Jan 20, 2026
* origin: (70 commits)
  fix(artifactPrepareVersion): reduce parameter scope (SAP#5612)
  Use maven reactor for installing modules in `mavenExecuteIntegration` step (SAP#5581)
  chore(ci): Add condition to SonarQube analysis step (SAP#5611)
  fix: filter out GHA jobs and truncate response body on http wrappers (SAP#5609)
  fix(codeqlExecuteScan): buffer issue (SAP#5608)
  feat: extend the generate build artifact metadata for golang  (SAP#5428)
  feat: creating kaniko build artifact metadata (SAP#5435)
  feat: Artifact prepare version exclusion flag (SAP#5597)
  ABAP Aunit Run step: Fix spelling of 'success' in test cases (SAP#5602)
  fix: always display debug logging with verbose: true on GitHub Actions (SAP#5601)
  feat: Switch order of GCS authentication (ST Token over json Key file) (SAP#5578)
  chore(renovate): Add ignorePaths for test data (SAP#5586)
  chore(renovate): migrate Renovate config (SAP#5585)
  chore(renovate): Add ignorePaths for integration test data (SAP#5584)
  chore(deps): update module github.com/stretchr/testify to v1.11.1 (SAP#5535)
  fix(CxOne) handling of critical and info severities in sarif generation (SAP#5582)
  fix(cnbBuild): Improved error handling (SAP#5577)
  Fix: shellExecute script download fails with query parameters in URL (SAP#5576)
  Revert "feat: Artifact prepare version exclusion flag" (SAP#5579)
  feat: Artifact prepare version exclusion flag (SAP#5565)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants