mojohaus / flatten-maven-plugin

Flatten Maven Plugin
https://www.mojohaus.org/flatten-maven-plugin/
Apache License 2.0
204 stars 84 forks source link

os-dependent classifiers are flattened #52

Open nikola-da opened 7 years ago

nikola-da commented 7 years ago

Hi all,

I came to this plugin through https://maven.apache.org/maven-ci-friendly.html as I wanted to simplify our build process.

However, I noticed that some of the properties are not flattened correctly. Namely, dependencies with <classifier> set to ${os.detected.name} are being flattened to values present on the build system, instead of being left as-is. Is there a way to prevent this behaviour?

If I use <flattenMode>minimum</flattenMode> (or bom), then dependency's classifier in the parent pom is left as-is, but not in the children pom, where it is flattened.

Thanks!

khmarbaise commented 7 years ago

Can you please make a full working example project on github...

nikola-da commented 7 years ago

Kein Problem! 😊

Example is at https://github.com/nikola-da/flatten-maven-plugin-example There are two tags: working and not-working. Please check out first working, run mvn clean install and inspect ~/.m2/repository/co/knezevic. You'll see that moduleb/....pom contains a reference to ${os.detected.name}. If you run the same command with a checkout of not-working, you'll see that classifier in moduleb for modulea has been set to a particular value of your system.

hohwille commented 5 years ago

This issue is similar to #57 I would agree and consider this as a sort of bug. Still my question is which are properties were users expect flattening and which should not be interpolated by flatten?