Package aQute.bnd.maven.plugin
Class BndMavenTestsPlugin
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- aQute.bnd.maven.plugin.AbstractBndMavenPlugin
-
- aQute.bnd.maven.plugin.BndMavenTestsPlugin
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
BndMavenPackagingTestsPlugin
@Mojo(name="bnd-process-tests", defaultPhase=PROCESS_TEST_CLASSES, requiresDependencyResolution=TEST, threadSafe=true) public class BndMavenTestsPlugin extends AbstractBndMavenPluginProcesses the test target classes to generate OSGi metadata.This goal has the default phase of "process-test-classes".
-
-
Field Summary
Fields Modifier and Type Field Description private booleanartifactFragmentWhether the test artifact is an OSGi fragment.private java.io.FileclassesDirThe directory where themaven-compiler-pluginplaces its output.private java.io.FilemainClassesDirThe directory where themaven-compiler-pluginplaced the main output.private java.io.FilemanifestPathSpecify the path to store the generated manifest file.private java.io.FileoutputDirThe directory where this plugin will store its output.private java.util.List<org.apache.maven.model.Resource>resourcesprivate booleanskipSkip this goal.private booleanskipGoalSkip this goal.private java.io.FilesourceDirprivate TestCasestestCasesThe test case types to generate into theTest-Casesmanifest header.-
Fields inherited from class aQute.bnd.maven.plugin.AbstractBndMavenPlugin
artifactHandlerManager, bnd, bndfile, buildContext, finalName, includeClassesDir, LAST_MODIFIED, logger, MARKED_FILES, mojoExecution, outputTimestamp, PACKAGING_JAR, PACKAGING_WAR, packagingTypes, project, projectHelper, propertiesFile, settings, skipIfEmpty, SNAPSHOT, TSTAMP, webappDirectory
-
-
Constructor Summary
Constructors Constructor Description BndMavenTestsPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilegetClassesDir()java.io.FilegetManifestPath()java.io.FilegetOutputDir()java.util.List<org.apache.maven.model.Resource>getResources()java.io.FilegetSourceDir()booleanisSkip()protected voidprocessBuilder(aQute.bnd.osgi.Builder builder)If a mojo needs to tweak the builder for any particular reason, do it here.protected voidprocessBuildPath(java.util.List<java.lang.Object> buildpath)If a mojo needs to update the buildpath for any particular reason, do it here.protected voidreportErrorsAndWarnings(aQute.bnd.osgi.Builder builder)-
Methods inherited from class aQute.bnd.maven.plugin.AbstractBndMavenPlugin
execute, getClassifier, getType, getWebappDirectory, isEmpty
-
-
-
-
Field Detail
-
artifactFragment
@Parameter(defaultValue="false") private boolean artifactFragment
Whether the test artifact is an OSGi fragment.If true, make the tests artifact a fragment using
${project.artifactId}as theFragment-Hostheader and setting theBundle-SymbolicNameof the tests artifact to${project.artifactId}-tests.
-
testCases
@Parameter(defaultValue="junit5") private TestCases testCases
-
sourceDir
@Parameter(defaultValue="${project.build.testSourceDirectory}", readonly=true) private java.io.File sourceDir
-
resources
@Parameter(defaultValue="${project.build.testResources}", readonly=true) private java.util.List<org.apache.maven.model.Resource> resources
-
mainClassesDir
@Parameter(defaultValue="${project.build.outputDirectory}") private java.io.File mainClassesDirThe directory where themaven-compiler-pluginplaced the main output.
-
classesDir
@Parameter(defaultValue="${project.build.testOutputDirectory}") private java.io.File classesDirThe directory where themaven-compiler-pluginplaces its output.
-
outputDir
@Parameter(defaultValue="${project.build.testOutputDirectory}") private java.io.File outputDirThe directory where this plugin will store its output.
-
manifestPath
@Parameter(defaultValue="${project.build.testOutputDirectory}/META-INF/MANIFEST.MF") private java.io.File manifestPathSpecify the path to store the generated manifest file.
-
skip
@Parameter(property="maven.test.skip", defaultValue="false") private boolean skipSkip this goal. The goal can also be skipped with theskipGoalconfiguration.
-
skipGoal
@Parameter(property="bnd-tests.skip", defaultValue="false") private boolean skipGoalSkip this goal. The goal can also be skipped with theskipconfiguration.
-
-
Method Detail
-
getSourceDir
public java.io.File getSourceDir()
- Specified by:
getSourceDirin classAbstractBndMavenPlugin
-
getResources
public java.util.List<org.apache.maven.model.Resource> getResources()
- Specified by:
getResourcesin classAbstractBndMavenPlugin
-
getClassesDir
public java.io.File getClassesDir()
- Specified by:
getClassesDirin classAbstractBndMavenPlugin
-
getOutputDir
public java.io.File getOutputDir()
- Specified by:
getOutputDirin classAbstractBndMavenPlugin
-
getManifestPath
public java.io.File getManifestPath()
- Specified by:
getManifestPathin classAbstractBndMavenPlugin
-
isSkip
public boolean isSkip()
- Specified by:
isSkipin classAbstractBndMavenPlugin
-
processBuildPath
protected void processBuildPath(java.util.List<java.lang.Object> buildpath)
Description copied from class:AbstractBndMavenPluginIf a mojo needs to update the buildpath for any particular reason, do it here.- Overrides:
processBuildPathin classAbstractBndMavenPlugin- Parameters:
buildpath- the set of jars and class directories used while analyzing the jar contents
-
processBuilder
protected void processBuilder(aQute.bnd.osgi.Builder builder) throws org.apache.maven.plugin.MojoFailureExceptionDescription copied from class:AbstractBndMavenPluginIf a mojo needs to tweak the builder for any particular reason, do it here.- Overrides:
processBuilderin classAbstractBndMavenPlugin- Parameters:
builder- the Builder created to analyze the jar contents- Throws:
org.apache.maven.plugin.MojoFailureException- if an issue is encountered
-
reportErrorsAndWarnings
protected void reportErrorsAndWarnings(aQute.bnd.osgi.Builder builder) throws org.apache.maven.plugin.MojoFailureException- Overrides:
reportErrorsAndWarningsin classAbstractBndMavenPlugin- Throws:
org.apache.maven.plugin.MojoFailureException
-
-