Class AbstractBaselinePlugin
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.felix.bundleplugin.baseline.AbstractBaselinePlugin
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
BaselinePlugin,BaselineReport
abstract class AbstractBaselinePlugin extends org.apache.maven.plugin.AbstractMojoAbstract BND Baseline check between two bundles.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.sonatype.plexus.build.incremental.BuildContextbuildContextprivate java.io.FilebuildDirectoryprotected java.lang.StringcomparisonArtifactIdArtifact to compare the current code against.protected java.lang.StringcomparisonClassifierClassifier for the artifact to compare the current code against.protected java.lang.StringcomparisonGroupIdGroup id to compare the current code against.protected java.lang.StringcomparisonPackagingArtifact to compare the current code against.protected java.lang.StringcomparisonVersionVersion to compare the current code against.protected org.apache.maven.artifact.factory.ArtifactFactoryfactoryprotected booleanfailOnErrorWhether to fail on errors.protected booleanfailOnWarningWhether to fail on warnings.private java.lang.String[]filtersA list of packages filter, if empty the whole bundle will be traversed.private java.lang.StringfinalNameprivate org.apache.maven.artifact.metadata.ArtifactMetadataSourcemetadataSourceprotected org.apache.maven.project.MavenProjectprojectprotected org.apache.maven.artifact.resolver.ArtifactResolverresolverprotected org.apache.maven.execution.MavenSessionsessionprotected booleanskipFlag to easily skip execution.protected java.util.List<java.lang.String>supportedProjectTypesProject types which this plugin supports.
-
Constructor Summary
Constructors Constructor Description AbstractBaselinePlugin()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidclose(java.lang.Object context)private static voidcloseJars(aQute.bnd.osgi.Jar... jars)private voiddoDiff(java.lang.Object context, aQute.bnd.service.diff.Diff diff, int depth)private voiddoPackageDiff(java.lang.Object context, aQute.bnd.service.diff.Diff diff)protected abstract voidendBaseline(java.lang.Object context)protected abstract voidendDiff(java.lang.Object context, int depth)protected abstract voidendPackage(java.lang.Object context)voidexecute()protected voidexecute(java.lang.Object context)private voidfilterSnapshots(java.util.List<org.apache.maven.artifact.versioning.ArtifactVersion> versions)private java.lang.StringgetBundleName()private aQute.bnd.osgi.JargetCurrentBundle()private org.apache.maven.artifact.ArtifactgetPreviousArtifact()private static java.lang.StringgetShortDelta(aQute.bnd.service.diff.Delta delta)protected abstract java.lang.Objectinit(java.lang.Object initialContext)private static aQute.bnd.osgi.JaropenJar(java.io.File file)protected abstract voidstartBaseline(java.lang.Object context, java.lang.String generationDate, java.lang.String bundleName, java.lang.String currentVersion, java.lang.String previousVersion)protected abstract voidstartDiff(java.lang.Object context, int depth, java.lang.String type, java.lang.String name, java.lang.String delta, java.lang.String shortDelta)protected abstract voidstartPackage(java.lang.Object context, boolean mismatch, java.lang.String name, java.lang.String shortDelta, java.lang.String delta, aQute.bnd.version.Version newerVersion, aQute.bnd.version.Version olderVersion, aQute.bnd.version.Version suggestedVersion, DiffMessage diffMessage, java.util.Map<java.lang.String,java.lang.String> attributes)
-
-
-
Field Detail
-
skip
@Parameter(property="baseline.skip", defaultValue="false") protected boolean skipFlag to easily skip execution.
-
failOnError
@Parameter(property="baseline.failOnError", defaultValue="true") protected boolean failOnErrorWhether to fail on errors.
-
failOnWarning
@Parameter(property="baseline.failOnWarning", defaultValue="false") protected boolean failOnWarningWhether to fail on warnings.
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
-
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession session
-
buildDirectory
@Parameter(defaultValue="${project.build.directory}", readonly=true, required=true) private java.io.File buildDirectory
-
finalName
@Parameter(defaultValue="${project.build.finalName}", readonly=true, required=true) private java.lang.String finalName
-
resolver
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
-
factory
@Component protected org.apache.maven.artifact.factory.ArtifactFactory factory
-
metadataSource
@Component private org.apache.maven.artifact.metadata.ArtifactMetadataSource metadataSource
-
comparisonGroupId
@Parameter(defaultValue="${project.groupId}", property="comparisonGroupId") protected java.lang.String comparisonGroupIdGroup id to compare the current code against.
-
comparisonArtifactId
@Parameter(defaultValue="${project.artifactId}", property="comparisonArtifactId") protected java.lang.String comparisonArtifactIdArtifact to compare the current code against.
-
comparisonVersion
@Parameter(defaultValue="(,${project.version})", property="comparisonVersion") protected java.lang.String comparisonVersionVersion to compare the current code against.
-
comparisonPackaging
@Parameter(defaultValue="${project.packaging}", property="comparisonPackaging") protected java.lang.String comparisonPackagingArtifact to compare the current code against.
-
comparisonClassifier
@Parameter(property="comparisonClassifier") protected java.lang.String comparisonClassifier
Classifier for the artifact to compare the current code against.
-
filters
@Parameter private java.lang.String[] filters
A list of packages filter, if empty the whole bundle will be traversed. Values are specified in OSGi package instructions notation, e.g.!org.apache.felix.bundleplugin.
-
supportedProjectTypes
@Parameter protected java.util.List<java.lang.String> supportedProjectTypes
Project types which this plugin supports.
-
buildContext
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
-
-
Method Detail
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
execute
protected void execute(java.lang.Object context) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
doPackageDiff
private void doPackageDiff(java.lang.Object context, aQute.bnd.service.diff.Diff diff)
-
doDiff
private void doDiff(java.lang.Object context, aQute.bnd.service.diff.Diff diff, int depth)
-
init
protected abstract java.lang.Object init(java.lang.Object initialContext)
-
close
protected abstract void close(java.lang.Object context)
-
startBaseline
protected abstract void startBaseline(java.lang.Object context, java.lang.String generationDate, java.lang.String bundleName, java.lang.String currentVersion, java.lang.String previousVersion)
-
startPackage
protected abstract void startPackage(java.lang.Object context, boolean mismatch, java.lang.String name, java.lang.String shortDelta, java.lang.String delta, aQute.bnd.version.Version newerVersion, aQute.bnd.version.Version olderVersion, aQute.bnd.version.Version suggestedVersion, DiffMessage diffMessage, java.util.Map<java.lang.String,java.lang.String> attributes)
-
startDiff
protected abstract void startDiff(java.lang.Object context, int depth, java.lang.String type, java.lang.String name, java.lang.String delta, java.lang.String shortDelta)
-
endDiff
protected abstract void endDiff(java.lang.Object context, int depth)
-
endPackage
protected abstract void endPackage(java.lang.Object context)
-
endBaseline
protected abstract void endBaseline(java.lang.Object context)
-
getCurrentBundle
private aQute.bnd.osgi.Jar getCurrentBundle() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getPreviousArtifact
private org.apache.maven.artifact.Artifact getPreviousArtifact() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-
filterSnapshots
private void filterSnapshots(java.util.List<org.apache.maven.artifact.versioning.ArtifactVersion> versions)
-
openJar
private static aQute.bnd.osgi.Jar openJar(java.io.File file) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
closeJars
private static void closeJars(aQute.bnd.osgi.Jar... jars)
-
getBundleName
private java.lang.String getBundleName()
-
getShortDelta
private static java.lang.String getShortDelta(aQute.bnd.service.diff.Delta delta)
-
-