public abstract class AbstractValidateMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected org.sonatype.plexus.build.incremental.BuildContext |
buildContext |
protected Collection<MavenBasedPackageDependency> |
dependencies
Defines the list of dependencies A dependency is declared as a
<dependency> element of a list style <dependencies>
element: |
protected boolean |
failOnValidationWarnings
If set to
true will lead to all validation errors or warnings failing the build, otherwise only validation errors lead to a
build failure |
protected Collection<String> |
mapPackageDependencyToMavenGa
Mapping of package dependencies given via group and name to Maven identifiers for enhanced validation.
|
protected org.apache.maven.plugin.MojoExecution |
mojoExecution |
protected org.apache.maven.project.MavenProject |
project
The Maven project (might be
null) |
protected Collection<MavenBasedPackageDependency> |
repositoryStructurePackages
Defines the packages that define the repository structure.
|
protected org.apache.maven.repository.RepositorySystem |
repositorySystem |
protected org.apache.maven.artifact.resolver.ResolutionErrorHandler |
resolutionErrorHandler |
protected DependencyResolver |
resolver |
protected org.apache.maven.execution.MavenSession |
session |
protected org.apache.jackrabbit.vault.validation.ValidationExecutorFactory |
validationExecutorFactory |
protected ValidationHelper |
validationHelper |
| Constructor and Description |
|---|
AbstractValidateMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
disableChecksOnlyWorkingForPackages() |
abstract void |
doExecute() |
void |
execute() |
protected Map<String,ValidatorSettings> |
getValidatorSettingsForPackage(org.apache.jackrabbit.vault.packaging.PackageId packageId,
boolean isSubPackage) |
@Parameter(property="project",
readonly=true,
required=false)
protected org.apache.maven.project.MavenProject project
null)@Parameter(defaultValue="${mojoExecution}",
readonly=true,
required=true)
protected org.apache.maven.plugin.MojoExecution mojoExecution
@Parameter(defaultValue="${session}",
readonly=true,
required=false)
protected org.apache.maven.execution.MavenSession session
@Parameter(property="vault.failOnValidationWarning",
defaultValue="false")
protected boolean failOnValidationWarnings
true will lead to all validation errors or warnings failing the build, otherwise only validation errors lead to a
build failure@Parameter(property="vault.dependencies") protected Collection<MavenBasedPackageDependency> dependencies
<dependency> element of a list style <dependencies>
element:
<dependency>
<group>theGroup</group>
<name>theName</name>
<version>1.5</version>
</dependency>
The dependency can also reference a maven project dependency, this is preferred as it yields to more robust builds.
<dependency>
<groupId>theGroup</groupId>
<artifactId>theName</artifactId>
</dependency>
The versionRange may be indicated as a single version, in which case the version range has no upper bound and defines the
minimal version accepted. Otherwise, the version range defines a lower and upper bound of accepted versions, where the bounds are
either included using parentheses () or excluded using brackets []
@Parameter(property="vault.repository.structure.packages") protected Collection<MavenBasedPackageDependency> repositoryStructurePackages
dependencies.
The repository-init feature of sling-start can define initial content that will be available in the repository before the first package is installed. Packages that depend on those nodes have no way to reference any dependency package that provides these nodes. A "real" package that would creates those nodes cannot be installed in the repository, because it would void the repository init structure. On the other hand would filevault complain, if the package was listed as dependency but not installed in the repository. So therefore this repository-structure packages serve as indicator packages that helps satisfy the structural dependencies, but are not added as real dependencies to the package.
@Parameter(property="vault.package.dependency.to.maven.ga") protected Collection<String> mapPackageDependencyToMavenGa
<group>:<name>=<groupId>:<artifactId>@Component protected org.apache.maven.repository.RepositorySystem repositorySystem
@Component protected org.apache.maven.artifact.resolver.ResolutionErrorHandler resolutionErrorHandler
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
protected final org.apache.jackrabbit.vault.validation.ValidationExecutorFactory validationExecutorFactory
protected final ValidationHelper validationHelper
protected DependencyResolver resolver
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void disableChecksOnlyWorkingForPackages()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic abstract void doExecute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected Map<String,ValidatorSettings> getValidatorSettingsForPackage(org.apache.jackrabbit.vault.packaging.PackageId packageId, boolean isSubPackage)
Copyright © 2020 The Apache Software Foundation. All rights reserved.