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

Ondromih profiles to speedup dev build #24534

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OndroMih
Copy link
Contributor

@OndroMih OndroMih commented Aug 5, 2023

As described in the README:

  • noextras profile - skips building extra artifacts, e.g. GlassFish Embedded artifacts
  • noweb profile - skips building GlassFish Server Web distribution

Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
@dmatej
Copy link
Contributor

dmatej commented Aug 5, 2023

Nice, for the first time you reproduced my local issue on Jenkins :D
I will push the fix now ... #24535

@dmatej
Copy link
Contributor

dmatej commented Aug 5, 2023

Btw, what if we would keep a conventional -Pskip* prefix? -PskipExtras sounds natural to me. What other people think about it? Also it should be documented in README.md.
It is getting more and more complicated. Maybe one could just use -pl :!extras
Or we could add these exclusions to -Pfastest.

@OndroMih OndroMih marked this pull request as draft August 5, 2023 21:34
@OndroMih
Copy link
Contributor Author

OndroMih commented Aug 5, 2023

Unfortunately, -pl !:extras doesn't work well - it only excludes the extras module but still builds all its child modules.

Maybe it's better to use a completely different approach with -am to build a specific distribution artifact and all its dependencies?

E.g., to build GlassFish full only: mvn -T4C clean install -Pfastest -am -pl appserver/distributions/glassfish

@dmatej
Copy link
Contributor

dmatej commented Aug 6, 2023

Sad, you are right with those exclusions: https://issues.apache.org/jira/browse/MNG-5230

Wow, to my surprise this works, is it what gives the result you needed?
mvn clean install -Pfastest -pl 'org.glassfish.main.distributions:glassfish' -am -T4C

I will try yet with an empty .m2/repository ...

@hs536
Copy link
Contributor

hs536 commented Aug 7, 2023

IMHO, -Pskip* prefix sounds natural if we skip a process, but, in this case, -Pno* prefix also sounds natural to me because no archive is generated.

@dmatej dmatej added this to the 7.0.8 milestone Aug 9, 2023
@OndroMih
Copy link
Contributor Author

Wow, to my surprise this works, is it what gives the result you needed? mvn clean install -Pfastest -pl 'org.glassfish.main.distributions:glassfish' -am -T4C

@dmatej, yes, this is exactly what I would like to achieve, but with a simple command line. Unfortunately, maven doesn't support specifying command line options in a profile or in a file. I would like to have a maven plugin that can modify the default maven command line options so that we could enable the plugin with a profile like "dist-glassfish" and run the same as the above command just with mvn clean install -Pfastest,dist-glassfish. Or at least put the arguments -pl 'org.glassfish.main.distributions:glassfish' -am -T4C into a file called dist-glassfish.config and then run the same just with mavn clean install -Pfastest --args dist-glassfish.config

None of these options are supported by maven currently. And the closest to that is these noweb and noextras profiles. Or we can just document how to use the -pl and -am arguments to build specific distributions and use that instead of these profiles.

What do you think? Is it worth adding these profiles or just document -pl and -am arguments? Since Maven 3.9.0, , the maven arguments can be specified in the MAVEN_ARGS environment variable (https://maven.apache.org/configure.html#maven_args-environment-variable), so it's maybe enough to use them instead of profiles.

@arjantijms arjantijms modified the milestones: 7.0.8, 7.0.9 Aug 28, 2023
@arjantijms arjantijms modified the milestones: 7.0.9, 7.0.10 Sep 26, 2023
@arjantijms arjantijms modified the milestones: 7.0.10, 7.0.11 Oct 28, 2023
@dmatej dmatej removed this from the 7.0.11 milestone Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants