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

Potential issue - resolveCiFriendliesOnly - No interpolation of variables defined in settings.xml #376

Closed
CedricMtta opened this issue Oct 4, 2023 · 1 comment · Fixed by #378

Comments

@CedricMtta
Copy link
Contributor

Hello,

First of all, thanks for this plugin.
I have a good use case for https://maven.apache.org/maven-ci-friendly.html, and handling the version of the project in a single variable instead of hardcoding it in each parent section of submodules is really satisfying.

Issue description

I followed the "maven-ci-friendly.html" above and noticed something weird:

I have in my ~/.m2/settings.xml a profile defining the version of a dependency needed by my project in a property.

My project has a main maven module, packaged in pom, defining the dependency management using the version from the settings.xml.
A submodule is then using the dependency specified in the dependency management.

When using the flatten-maven-plugin in flattenMode "resolveCiFriendliesOnly", the property defined in my settings.xml is not interpolated and the build fail.

Workaround

If I copy paste the property from settings.xml to the main module "properties" section, then it works as expected.

Reproduction

I created a small project to reproduce the issue, you can find it here

Expected behavior

I don't understand why a property defined in the parent pom.xml is interpoloated, but not a property defined in the settings.xml.
Am I misunderstanding somethings and is it a normal behavior, or is it a bug ?

Thanks a lot in advance for your help, I wish you a nice day.

@CedricMtta
Copy link
Contributor Author

Hello,

I think I found the issue:

When creating the modelBuildingRequest, the external profiles and properties were not taken into account.

I created a PR for this => #378

What do you think about it ?

Thanks in advance for your time,

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 a pull request may close this issue.

1 participant