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

"dependency-reduced-pom.xml" is generated in the root of the project instead of "/target" #555

Closed
brenuart opened this issue Jul 6, 2021 · 2 comments
Milestone

Comments

@brenuart
Copy link
Collaborator

brenuart commented Jul 6, 2021

The Maven Shade plugin is configured to produce a dependency reduced POM where dependencies to shaded artefacts are removed. This reduced POM is created in the root of the project structure instead of in the /target directory where build artefacts usually go. In general it is "bad practice" for the build to modify files outside of the build directory...

Proposition is to configure the shade plugin to save the reduced pom in the project build directory.

Note: as it is atm, the reduced pom won't be removed by a mvn clean...

@brenuart brenuart changed the title dependency-reduced-pom.xml is generated in the root of the project instead of /target "dependency-reduced-pom.xml" is generated in the root of the project instead of "/target" Jul 6, 2021
brenuart added a commit to brenuart/logstash-logback-encoder that referenced this issue Jul 6, 2021
…ced pom in the project build directory

Related issue: logfellow#555
@brenuart
Copy link
Collaborator Author

brenuart commented Jul 6, 2021

Hmmm.. storing the reduced pom other than in the project root is not a good idea. As per the plugin documentation:

setting a value for this parameter with a directory other than ${basedir} will change the value of ${basedir} for all executions that come after the shade execution. This is often not what you want. This is considered an open issue with this plugin.

And indeed, the checkstyle plugin that currently comes after the shade plugin is now unable to find the rules file located a src/checkstyle/checkstyle.xml (resolved relative to ${basedir} which is now elsewhere...

Probably better to keep things as they are atm (reduced pom in the project root). Maybe we could just configure the clean plugin to remove this file as well...

@philsttr
Copy link
Collaborator

philsttr commented Jul 7, 2021

+1 to configuring the clean plugin

brenuart added a commit to brenuart/logstash-logback-encoder that referenced this issue Jul 7, 2021
philsttr pushed a commit that referenced this issue Jul 7, 2021
@philsttr philsttr added this to the 7.0 milestone Jul 7, 2021
@philsttr philsttr closed this as completed Jul 7, 2021
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

No branches or pull requests

2 participants