Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix maven deployment issues and flatten pom #28430

Closed
spbolton opened this issue May 3, 2024 · 0 comments · Fixed by #28453, #28431 or #28524
Closed

Fix maven deployment issues and flatten pom #28430

spbolton opened this issue May 3, 2024 · 0 comments · Fixed by #28453, #28431 or #28524

Comments

@spbolton
Copy link
Contributor

spbolton commented May 3, 2024

With the maven multi-module deployment into artifactory the pom.xml published is not self-contained and references a parent hierarchy. To be able to build a plugin against dotcms-core module it needs to resolve the parent hierarchy including any top-level default properties set in parent/pom.xml. If when deploying dotcms-core all its parent dependencies are are also deployed with the correct versions then maven can pull each of these in the plugin build. Some of these parent artifacts are not real deployment artifacts and it creates clutter to deploy these separately as well as makes it difficult to identify in the sub module pom exactly which versions of artifacts it is using.

Using the maven-flatten-plugin we are able to resolve and cleanup the submodule pom.xml to resolve all the properties and artifacts as well as remove any unnecessary build information, this allows us to deploy only the important artifacts. This also follows patterns that will come out in Maven 5 which has the concept of a separate deploy pom.xml vs build.

This change also modifies the build in combination with the flatten-maven-plugin to use "ci friendly revisions" pattern for Maven instead of our current Versions Plugin that has to modify the version for each pom.xml before committing to a release branch. Using this pattern allows us to have one file to set the release in a release build as well as being able to easily generate build artifacts for any release version with zero code modifications only using a command line property. See the below link for more information on the pattern

https://maven.apache.org/maven-ci-friendly.html

@spbolton spbolton moved this to Current Sprint Backlog in dotCMS - Product Planning May 3, 2024
@spbolton spbolton self-assigned this May 3, 2024
@nollymar nollymar moved this from Current Sprint Backlog to In Review in dotCMS - Product Planning May 7, 2024
@nollymar nollymar added the Merged label May 7, 2024
@nollymar nollymar linked a pull request May 10, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue May 11, 2024
### Proposed Changes
* Adding the .mvn/maven.config file to set the release version.

### Fixes
#28430

Co-authored-by: Daniel Colina <[email protected]>
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning May 11, 2024
@nollymar nollymar moved this from Internal QA to Done in dotCMS - Product Planning May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment