Package org.eclipse.tycho.source
Class OsgiSourceMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eclipse.tycho.source.AbstractSourceJarMojo
org.eclipse.tycho.source.OsgiSourceMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="plugin-source",
defaultPhase=PREPARE_PACKAGE,
threadSafe=true)
public class OsgiSourceMojo
extends AbstractSourceJarMojo
Goal to create a JAR-package containing all the source files of a osgi project.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether source folders are required or not.protected booleanIf set totrue(the default), missing build.properties src.includes will cause build failure.protected booleanWhether default source excludes for SCM files defined in {AbstractScanner#DEFAULTEXCLUDES} should be used.Fields inherited from class org.eclipse.tycho.source.AbstractSourceJarMojo
excludeResources, finalName, includePom, outputDirectory, project, reactorProjects, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected List<org.apache.maven.model.Resource>getResources(org.apache.maven.project.MavenProject p) protected List<org.apache.maven.model.Resource>getSources(org.apache.maven.project.MavenProject p) protected List<org.apache.maven.model.Resource>getSources(org.apache.maven.project.MavenProject p, boolean requireSourceRoots, org.eclipse.tycho.BuildProperties buildProperties) static booleanisRelevant(org.apache.maven.project.MavenProject project, org.eclipse.tycho.BuildPropertiesParser buildPropertiesParser) protected booleanisRelevantProject(org.apache.maven.project.MavenProject project) protected static PropertiesreadL10nProps(UnaryOperator<String> getManifestHeaderValue, Path basedir, org.apache.maven.plugin.logging.Log log) protected PropertiesreadL10nProps(OsgiManifest manifest) voidsetBuildPropertiesParser(org.eclipse.tycho.BuildPropertiesParser buildPropertiesParser) protected voidupdateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration) Methods inherited from class org.eclipse.tycho.source.AbstractSourceJarMojo
addDirectory, addDirectory, archiveProjectContent, createArchiver, execute, getExtension, getProject, getType, packageSources, packageSourcesMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
useDefaultSourceExcludes
@Parameter(defaultValue="true") protected boolean useDefaultSourceExcludesWhether default source excludes for SCM files defined in {AbstractScanner#DEFAULTEXCLUDES} should be used. -
requireSourceRoots
@Parameter(defaultValue="false", readonly=true) protected boolean requireSourceRootsWhether source folders are required or not. If not required (the default), projects without source folders/source includes will be silently ignored. -
strictSrcIncludes
@Parameter(defaultValue="true") protected boolean strictSrcIncludesIf set totrue(the default), missing build.properties src.includes will cause build failure. If set tofalse, missing build.properties src.includes will be reported as warnings but the build will not fail.
-
-
Constructor Details
-
OsgiSourceMojo
public OsgiSourceMojo()
-
-
Method Details
-
setBuildPropertiesParser
public void setBuildPropertiesParser(org.eclipse.tycho.BuildPropertiesParser buildPropertiesParser) -
getSources
protected List<org.apache.maven.model.Resource> getSources(org.apache.maven.project.MavenProject p) throws org.apache.maven.plugin.MojoExecutionException - Specified by:
getSourcesin classAbstractSourceJarMojo- Parameters:
p- not null- Returns:
- the compile or test sources
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getSources
protected List<org.apache.maven.model.Resource> getSources(org.apache.maven.project.MavenProject p, boolean requireSourceRoots, org.eclipse.tycho.BuildProperties buildProperties) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getResources
protected List<org.apache.maven.model.Resource> getResources(org.apache.maven.project.MavenProject p) throws org.apache.maven.plugin.MojoExecutionException - Specified by:
getResourcesin classAbstractSourceJarMojo- Parameters:
p- not null- Returns:
- the compile or test resources
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
readL10nProps
protected Properties readL10nProps(OsgiManifest manifest) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
readL10nProps
protected static Properties readL10nProps(UnaryOperator<String> getManifestHeaderValue, Path basedir, org.apache.maven.plugin.logging.Log log) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getClassifier
- Specified by:
getClassifierin classAbstractSourceJarMojo- Returns:
- the wanted classifier, i.e.
sourcesortest-sources
-
updateSourceManifest
protected void updateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration) - Overrides:
updateSourceManifestin classAbstractSourceJarMojo
-
isRelevantProject
protected boolean isRelevantProject(org.apache.maven.project.MavenProject project) - Specified by:
isRelevantProjectin classAbstractSourceJarMojo
-
isRelevant
public static boolean isRelevant(org.apache.maven.project.MavenProject project, org.eclipse.tycho.BuildPropertiesParser buildPropertiesParser)
-