camunda-community-hub / community-action-maven-release

Opinionated GitHub action to release community projects to Maven Central
Apache License 2.0
7 stars 4 forks source link

Add additional input options #16

Closed celanthe closed 2 years ago

celanthe commented 2 years ago

Add additional inputs.maven-build-options to the 'run maven' step of the current Action

VonDerBeck commented 2 years ago

please add the new input "maven-build-options" under inputs. Also @VonDerBeck asked a good question during your discussion: why is there not a single "clean" in all of the Maven executions? "clean" makes the builds more reproducible by eliminating possible site effects.

@gclaussn That is indeed a good question, can I add mvn clean to all the steps in the action? Or is it something that is only called once under the maven-build-option? Apologies if this is a silly question, I'm still learning about Java/Maven and would love to get this into the codebase for everyone! I think it's definitely valuable to run clean, absolutely! I've got #15 open that I'll use to get the ball rolling there.

Ah, wait! I did NOT mean to run "clean" with every single maven operation during the release action! This is not the intention of the current design. The release action first runs "mvn package" - I think this is the step where "clean" absolutely makes sense (even if you can argue that the project has been freshly checked out and there is no need for that as well). The rest of the steps of the release action are running "mvn deploy" etc., which should use the result of the former "package" operation. Now the only thing is, that for running deploy maven always invokes the prior phases. Most of the maven operations are able to optimize themself and thus not do their work again. The "maven-shade-plugin" is an exception. Using "clean" for every single mvn operation within the release workflow would maximize the build time. Don't do this. I have found a way to deal with the maven-shade-plugin within the build of my project. There is no need to further change the overal release build. This would be a disadvantage for 95% of all the other community projects.

Cheers Gunnar

gclaussn commented 2 years ago

@VonDerBeck sounds good, that you have found a solution (regarding the maven-shade-plugin). yes, the invocation of a Maven lifecycle phase always includes the execution of every earlier lifecycle phase. but you are also right regarding build time and moreover if it works for every other project, we should not change it. :-)