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

Be able to specify the build command #5

Closed
zambrovski opened this issue May 20, 2021 · 5 comments
Closed

Be able to specify the build command #5

zambrovski opened this issue May 20, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zambrovski
Copy link
Contributor

zambrovski commented May 20, 2021

The community action maven release simply executes mvn package to produce the Maven artifact. In most cases this is ok for beginners, (as a part of the action), but there might be exceptions.

Here are some ideas about it:

  • since you are using cache plugin, you MUST call clean in order not to depend on previous build. This gets fatal if you for example generate sources and tweak it, easily resulting in having classes multiple times on the classpath.
  • for good reasons, long-lasting activities like I-Tests might be part of the Maven profile and not the default build. A reasonable example for this are integration tests, starting-up the application with Spring Boot and lasting several dozens minutes. As a developer I want to make sure to control when to run them.
  • Maven supports a thread control option like -T4 which accelerates the build. On my experience github actions run faster with at least -T2 or event -T4
  • Maven is good, but there might be a reason to have a dedicated maven wrapper (mvnw) to have a repeatable build independent from a particular Maven version. The default way for doing it, is to check-in the maven wrapper in particuloar version and call that instead of a globally defined Maven.
  • There is a difference between a default CI build and a release build. I want the CI build to be maximum fast to get the feedback as soon as possible. Therefor I want to build the extension with examples, run all the tests and gather all the code analysis. For the release build I want for example to skip releasing examples (why should they be in Maven central?), skip code analysis (it is already checked, but only lasts long - ok there is no harm in doing this) and generate static documentation.

Solution idea:

Introduce a variable inside the build action holding the build command, which might be overwritten by the developer, defaulting to mvn clean package ${SKIP_TESTS}.

@celanthe celanthe self-assigned this May 20, 2021
@celanthe celanthe added bug Something isn't working enhancement New feature or request labels May 20, 2021
@celanthe
Copy link
Contributor

Thanks for opening this issue @zambrovski! This isn't something I can tackle until at least mid Q3, but if the community would like to see it happen faster, people are more than welcome to submit a pull request! :)

@celanthe celanthe added the help wanted Extra attention is needed label May 20, 2021
@celanthe
Copy link
Contributor

celanthe commented Jun 2, 2021

@zambrovski Following up on this--Would a solution for this then potentially be:

./mvnw -T4 clean package ${SKIP_TESTS} added on line 58 of the action?

If so, I can make that PR introducing that proposed change. If there's another solution here, I'm more than happy to look into that as well. :)

@celanthe
Copy link
Contributor

celanthe commented Jun 28, 2021

Just an update here @zambrovski -- We've got a new PR, #13 open which I think would be able to allow you to then run ./mvnw -T4 clean package ${SKIP_TESTS} which would then perhaps address this issue? :)

@zambrovski
Copy link
Contributor Author

zambrovski commented Jun 28, 2021 via email

@celanthe celanthe removed the bug Something isn't working label Jul 7, 2021
@zambrovski
Copy link
Contributor Author

Perfectly fine with that solution for tuning the build command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants