Repository navigation
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.
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to maven-4.0.x.
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to master.
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to master.
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to master.
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to master.
…o opt out of the site lifecycle When -Dmaven.site.lifecycle.disabled=true is set, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to maven-4.0.x. Fixes apache#11759
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to master.
…o opt out of the site lifecycle When -Dmaven.site.lifecycle.disabled=true is set, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to maven-4.0.x. Fixes apache#11759
…o opt out of the site lifecycle When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of apache#11970 (merged on maven-3.10.x) to master.
…out of the site lifecycle (#13546) When set to true, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of #11970 (merged on maven-3.10.x) to master.
… to opt out of the site lifecycle (#13547) * Fix #11759: add maven.site.lifecycle.disabled system property to opt out of the site lifecycle When -Dmaven.site.lifecycle.disabled=true is set, the site lifecycle is excluded from the DefaultLifecycleRegistry stream, so Maven will not resolve or bind the maven-site-plugin unless it is explicitly configured in the POM. This is an opt-in system property (-Dmaven.site.lifecycle.disabled=true) that preserves full backward compatibility. Port of #11970 (merged on maven-3.10.x) to maven-4.0.x. Fixes #11759 * fix: adapt IT to maven-4.0.x AbstractMavenIntegrationTestCase API The test was using the master-branch API (Path-returning extractResources(), no-arg constructor, Path-taking newVerifier()) which does not exist on the maven-4.0.x branch. Adapt to use: - File extractResources(String) (as in 4.0.x base class) - Constructor super("[4.0.0-rc-3,)") (required by 4.0.x base class) - newVerifier(String) instead of newVerifier(Path)
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