public class RequireNoRepositories extends AbstractNonCacheableEnforcerRule
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
allowedPluginRepositories
Specify explicitly allowed plugin repositories.
|
private java.util.List<java.lang.String> |
allowedRepositories
Specify explicitly allowed non-plugin repositories.
|
private boolean |
allowSnapshotPluginRepositories
Whether to allow plugin repositories which only resolve snapshots.
|
private boolean |
allowSnapshotRepositories
Whether to allow repositories which only resolve snapshots.
|
private boolean |
banPluginRepositories
Whether to ban plugin repositories.
|
private boolean |
banRepositories
Whether to ban non-plugin repositories.
|
Constructor and Description |
---|
RequireNoRepositories() |
Modifier and Type | Method and Description |
---|---|
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
private static java.util.List<java.lang.String> |
findBannedRepositories(java.util.List<org.apache.maven.model.Repository> repos,
java.util.List<java.lang.String> allowedRepos,
boolean allowSnapshots) |
void |
setAllowedPluginRepositories(java.util.List<java.lang.String> allowedPluginRepositories) |
void |
setAllowedRepositories(java.util.List<java.lang.String> allowedRepositories) |
void |
setAllowSnapshotPluginRepositories(boolean allowSnapshotPluginRepositories) |
void |
setAllowSnapshotRepositories(boolean allowSnapshotRepositories) |
void |
setBanPluginRepositories(boolean banPluginRepositories) |
void |
setBanRepositories(boolean banRepositories) |
getCacheId, isCacheable, isResultValid
getLevel, getMessage, setLevel, setMessage
private boolean banRepositories
setBanRepositories(boolean)
private boolean banPluginRepositories
setBanPluginRepositories(boolean)
private java.util.List<java.lang.String> allowedRepositories
setAllowedRepositories(List)
private java.util.List<java.lang.String> allowedPluginRepositories
setAllowedPluginRepositories(List)
private boolean allowSnapshotRepositories
setAllowSnapshotRepositories(boolean)
private boolean allowSnapshotPluginRepositories
#setAllowSnapshotPluginRepositories(boolean)}
public final void setBanRepositories(boolean banRepositories)
public final void setBanPluginRepositories(boolean banPluginRepositories)
public final void setAllowedRepositories(java.util.List<java.lang.String> allowedRepositories)
public final void setAllowedPluginRepositories(java.util.List<java.lang.String> allowedPluginRepositories)
public final void setAllowSnapshotRepositories(boolean allowSnapshotRepositories)
public final void setAllowSnapshotPluginRepositories(boolean allowSnapshotPluginRepositories)
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
helper
- The helper provides access to the log, MavenSession and has
helpers to get common components. It is also able to lookup components
by class name.EnforcerRuleException
- the enforcer rule exceptionprivate static java.util.List<java.lang.String> findBannedRepositories(java.util.List<org.apache.maven.model.Repository> repos, java.util.List<java.lang.String> allowedRepos, boolean allowSnapshots)
repos
- all repositories, never null
allowedRepos
- allowed repositories, never null
allowSnapshots
-