Feat: Ability to disable site lifecycle#11970
Conversation
Ability to suppress site lifecycle from Maven "default lifecycles". Note: this does not remove "site" Lifecycle component, but Maven will not consider site lifecycle, if disabled. Fixes apache#11759
| private static final boolean SITE_ENABLED = | ||
| Boolean.parseBoolean(System.getProperty("maven.site.lifecycle.enabled", "true")); |
There was a problem hiding this comment.
can we also use a user properties for it?
or repos session config props?
There was a problem hiding this comment.
That is too late. This component is constructed as part of object graph before any session is being created... Will look more around tomorrow
There was a problem hiding this comment.
Looked around, and in many places session is not present/passed over. While we could alter these classes, that would lead to many potential breakages.
I consider this use case "special" or "very edge", so IMO Java System property is good to cover it.
| private static final List<String> BUILT_IN_LIFECYCLES = | ||
| Arrays.asList(CleanLifecycleProvider.NAME, DefaultLifecycleProvider.NAME, SiteLifecycleProvider.NAME); | ||
| private static final boolean SITE_ENABLED = | ||
| Boolean.parseBoolean(System.getProperty("maven.site.lifecycle.enabled", "true")); |
There was a problem hiding this comment.
Why not Boolean.getBoolean()?
There was a problem hiding this comment.
How to default it to true?
There was a problem hiding this comment.
Indeed, you can't, but maybe we should invert the logic anyway? Site lifecycle is always enabled unless you explicitly disable this, e.g., -DskipTests=true and other skippers. -Dmaven.site.lifecycle.skip?
There was a problem hiding this comment.
Well, I could agree. But this is not skipping it, it is like "pretending is not there" (filter it out, remove it from default ones).
There was a problem hiding this comment.
Maybe just maven.site.lifecycle.disabled ?
There was a problem hiding this comment.
Well, I could agree. But this is not skipping it, it is like "pretending is not there" (filter it out, remove it from default ones).
Yes, skipping is wrong. I noticed that after reflection.
There was a problem hiding this comment.
Maybe just
maven.site.lifecycle.disabled?
maven.lifecycle.site.disabled if we talk about a properties tree.
There was a problem hiding this comment.
Unsure what tree you mean, but I am more to group properties by feature.
Ability to suppress site lifecycle from Maven "default lifecycles". This PR does not remove "site" lifecycle component, but Maven will not consider site lifecycle among "defaults", if disabled.
Note: hence, with this option enabled, the IT suite will never (and cannot) pass, as IT suite contains ITs running/expecting site lifecycle.
Fixes #11759