renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
16.52k stars 2.12k forks source link

Maven: bumpVersion update child pom.xml versions in multi module projects #14703

Open loadi-dev opened 2 years ago

loadi-dev commented 2 years ago

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

32.6.1

Please select which platform you are using if self-hosting.

GitLab self-hosted

If you're self-hosting Renovate, tell us what version of the platform you run.

14.8.3

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

Steps to reproduce

Current behavior

Expected behavior

Remark Maybe this is not a bug but an unsupported feature. In that case I'd be glad if this ticket could be converted into a feature request.

Relevant debug logs

Logs ``` INFO: Repository started (repository=golatar-projects/golatar-libs) "renovateVersion": "32.6.1" INFO: Dependency extraction complete (repository=golatar-projects/golatar-libs) "baseBranch": "main", "stats": { "managers": { "gitlabci": {"fileCount": 1, "depCount": 2}, "maven": {"fileCount": 5, "depCount": 25} }, "total": {"fileCount": 6, "depCount": 27} } INFO: Branch created (repository=golatar-projects/golatar-libs, branch=renovate/hibernate.version) "commitSha": "f3fb6c5ba927976a46bb38[37](https://source.16reiche.de/ops/renovate-bot/-/jobs/17819#L37)f6f729da11590308" INFO: PR created (repository=golatar-projects/golatar-libs, branch=renovate/hibernate.version) "pr": 1[51](https://source.16reiche.de/ops/renovate-bot/-/jobs/17819#L51), "prTitle": "Update hibernate.version to v5.6.7.Final" INFO: Repository finished (repository=golatar-projects/golatar-libs) "durationMs": 19576 ```

Have you created a minimal reproduction repository?

No reproduction repository

github-actions[bot] commented 2 years ago

Hi there,

Help us by making a minimal reproduction repository.

Before we can start work on your issue we first need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction to understand what is needed.

We may close the issue if you (or someone else) have not provided a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

loadi-dev commented 2 years ago

Hi, I created a repository for reproduction here: https://github.com/loadi-dev/renovate-bumpversion-demo.

I added a minified config.js from my GitLab instance. But I'm not quite sure how to configure it properly on GitHub. The essential parts in my eyes are:

When running renovate on such a repository it will bump the version in the parents perfectly fine, but the child will still refer to the old version. So the updated dependencies will not be effective in the end.

Please feel free to reach out, if you need any additional information.

rarkins commented 2 years ago

Please enhance the reproduction to include in the README a description of (a) expected behavior and (b) observed behavior. Ideally (b) should reference a PR in the same repo which shows the current behavior.

loadi-dev commented 2 years ago

Thanks for your feedback. I updated the repository. Let me know if anything else is missing.

rarkins commented 2 years ago

Thanks. The PR shown in your demo is updating the version in the updated Pom.xml exactly as intended/described, so most likely anything beyond that is a feature request and not a bug. Can you add a new commit manually on top of the automated PR to show the changes/differences you'd expect?

loadi-dev commented 2 years ago

I updated the PR accordingly.

In my opinion the version bump is incomplete for multi module projects. The updated dependency will never be used in the sub module. To work around that I'd need to define the dependency versions in the modules instead of having a central version definition in the parent. This would do for the minimum example, but not for projects with more than one child, sharing some common libraries.

rarkins commented 2 years ago

Thanks. You are welcome to submit a documentation PR in the meantime to clarify in our docs that multi module projects aren't currently supported for bumpVersion.

sta-szek commented 1 month ago

i think the fastest implementation would be to replace this line of code: https://github.com/renovatebot/renovate/blob/e9784375e1cff0c4c9488541b03d16cbb1fd4b79/lib/modules/manager/maven/update.ts#L112 with smth like mvn versions:set -DnewVersion=${newValue} -DprocessAllModules -DgenerateBackupPoms=false if that is possible to call another cmd