powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
123 stars 39 forks source link

itools-packager-maven-plugin bundles provided dependencies #802

Open jonenst opened 5 years ago

jonenst commented 5 years ago

(if a question doesn't apply, you can delete it) itools-packager-maven-plugin uses compile+runtime resolution. Why not use runtime resolution ? This should be exactly what we want ? See https://maven.apache.org/developers/mojo-api-specification.html

geofjamg commented 5 years ago

Provided dependencies make sens for instance in an application server where your application run in a container with already provider dependencies. In the itools packaging case, there is no container/running environment. Nothing will be provided and all necessary dependencies have to be copied in the share/java/ folder. I think provided dependencies have to be bundled in itools distribution.

mathbagu commented 5 years ago

I agree with Jon: itools-packager should not package the provided jars. It could be ok for non conflicting jars (only one implementation in the classpath), but it’s not ok for all jars (logging or xml for instance). There is a risk someone forget to add an explicit dependency to pull an implementation and something will be missing at runtime. We should probably log a warning to aware the user?

geofjamg commented 5 years ago

What is missing in the is PR is a description of the real reason of the change request. What is the bug? What is the pain?

jonenst commented 5 years ago

bundling provided dependencies violates the POLA principle https://en.wikipedia.org/wiki/Principle_of_least_astonishment I was very surprised when I found this behavior

jonenst commented 5 years ago

I can confirm the following behaviors:

The only consequences of this change is for projects who depend on distribution-core (previously they didn't get the dependencies, after this change they would get them). Is this a supported use case ?

jonenst commented 5 years ago

The people who have added provided dependencies to distribution-core/pom.xml are Author: Luma zamarrenolm@aia.es and Author: baguemat mathieu.bague@rte-france.com