Skip to content

BUILD-8317 Create a new GitHub action to support building MAVEN workloads#9

Merged
julien-carsique-sonarsource merged 1 commit intomasterfrom
feat/smarini/BUILD-8317-createBuildMavenGhAction
Jul 25, 2025
Merged

BUILD-8317 Create a new GitHub action to support building MAVEN workloads#9
julien-carsique-sonarsource merged 1 commit intomasterfrom
feat/smarini/BUILD-8317-createBuildMavenGhAction

Conversation

@SamirM-BE
Copy link
Copy Markdown
Contributor

@SamirM-BE SamirM-BE commented Jul 8, 2025

BUILD-8317
This PR migrates our Maven-related CI scripts from the ci-common-scripts repository into a new, self-contained GitHub Action.

The primary goal is to improve maintainability and simplify our workflows by centralizing the build and analysis logic within a versioned Action.

Tested with:

Use ARTIFACTORY_ACCESS_TOKEN, not ARTIFACTORY_PRIVATE_PASSWORD
Options for MAVEN_OPTS and SONAR_SCANNER_JAVA_OPTS
Develocity is optional
Cleanup M2 repo before cache

Remove development/github/token/licenses-ro which is optional

Rework build.sh:

  • align with other actions
  • simplify and shorten
  • validate all required environment variables at the beginning
  • maintenance branches are built the same as main branch (no more separated analysis)
  • improved unshallow

mise: no need for jfrog CLI

set deploy-pull-request to false by default

Format: Shell functions documentation should be ahead, not after the function name
Shell function names with underscore separator, not dash

Use temp file in promote build info (was local .build-info)
Check for gh in promote

README: build-maven

  • no optional with parameter in the snippet
  • Configuration Options (with Parameters), Required GitHub permissions, Required Vault permissions are described after

Improved test coverage to 100% (except build-gradle and build-npm)

@SamirM-BE SamirM-BE force-pushed the feat/smarini/BUILD-8317-createBuildMavenGhAction branch 28 times, most recently from 2cdd0b7 to 5fa660a Compare July 9, 2025 18:43
@SamirM-BE SamirM-BE marked this pull request as ready for review July 10, 2025 07:02
@SamirM-BE SamirM-BE requested a review from a team as a code owner July 10, 2025 07:02
@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/smarini/BUILD-8317-createBuildMavenGhAction branch 4 times, most recently from 809111c to 15932a2 Compare July 24, 2025 10:44
@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/smarini/BUILD-8317-createBuildMavenGhAction branch 2 times, most recently from 39feca1 to cc6db05 Compare July 24, 2025 17:42
Copy link
Copy Markdown
Contributor

@jayadeep-km-sonarsource jayadeep-km-sonarsource left a comment

Choose a reason for hiding this comment

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

Apart some minor comments, the PR looks good to me. Great job!

@hedinasr
Copy link
Copy Markdown
Contributor

@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/smarini/BUILD-8317-createBuildMavenGhAction branch 5 times, most recently from dfecb00 to 2e8de19 Compare July 25, 2025 14:45
@julien-carsique-sonarsource julien-carsique-sonarsource marked this pull request as ready for review July 25, 2025 14:49
…oads

Use ARTIFACTORY_ACCESS_TOKEN, not ARTIFACTORY_PRIVATE_PASSWORD
Options for MAVEN_OPTS and SONAR_SCANNER_JAVA_OPTS
Develocity is optional
Cleanup M2 repo before cache

Remove development/github/token/licenses-ro which is optional

Rework build.sh:
- align with other actions
- simplify and shorten
- validate all required environment variables at the beginning
- maintenance branches are built the same as main branch (no more separated analysis)
- improved unshallow

mise: no need for jfrog CLI

set deploy-pull-request to false by default

Format: Shell functions documentation should be ahead, not after the function name
Shell function names with underscore separator, not dash

Use temp file in promote build info (was local .build-info)
Check for gh in promote

README: build-maven
- no optional with parameter in the snippet
- Configuration Options (`with` Parameters), Required GitHub permissions, Required Vault permissions are described after

Improved test coverage to 100% (except build-gradle and build-npm)

Reviewed-By: julien-carsique-sonarsource
Reviewed-By: jayadeep-km-sonarsource
@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/smarini/BUILD-8317-createBuildMavenGhAction branch from 2e8de19 to 572642c Compare July 25, 2025 15:34
@julien-carsique-sonarsource julien-carsique-sonarsource removed the request for review from hedinasr July 25, 2025 15:34
@julien-carsique-sonarsource julien-carsique-sonarsource enabled auto-merge (rebase) July 25, 2025 15:35
@sonarqubecloud
Copy link
Copy Markdown

🤖 Pull Request summary

Add build-maven action for Maven project builds and deployments.

  • New Maven build action: Adds complete build-maven action with build/deploy/analyze capabilities for Maven projects
  • Maven settings: Includes XML configuration files for private and public repository authentication
  • Build script: Implements Maven-specific build logic with branch-based deployment strategies and SonarQube integration
  • Coverage update: Adds build-maven to test coverage patterns in .shellspec and sonar-project.properties
  • Documentation: Adds comprehensive README section with usage examples and configuration options
  • Default change: Updates build-poetry action default for deploy-pull-request from true to false

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@julien-carsique-sonarsource julien-carsique-sonarsource merged commit fbac280 into master Jul 25, 2025
8 checks passed
@julien-carsique-sonarsource julien-carsique-sonarsource deleted the feat/smarini/BUILD-8317-createBuildMavenGhAction branch July 25, 2025 16:08
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.

4 participants