@Mojo(name="plugin-source", defaultPhase=PREPARE_PACKAGE) public class OsgiSourceMojo extends AbstractSourceJarMojo
Modifier and Type | Field and Description |
---|---|
private org.codehaus.plexus.archiver.util.DefaultFileSet[] |
additionalFileSets
Additional files to be included in the source bundle jar.
|
(package private) BuildPropertiesParser |
buildPropertiesParser |
private BundleReader |
bundleReader |
private java.lang.String |
classifier
The source bundles classifier.
|
private boolean |
distinctSourceRoots
Whether sources for nested jars should be put into distinct source root folders inside the
source jar (one source root per nested jar).
|
private static java.lang.String |
GOAL |
private static java.lang.String |
I18N_KEY_BUNDLE_NAME |
private static java.lang.String |
I18N_KEY_BUNDLE_VENDOR |
private static java.lang.String |
I18N_KEY_PREFIX |
private IncludeValidationHelper |
includeValidationHelper |
private static java.lang.String |
MANIFEST_BUNDLE_LOCALIZATION_BASENAME |
private static java.lang.String |
MANIFEST_BUNDLE_LOCALIZATION_FILENAME |
private static java.lang.String |
MANIFEST_HEADER_ECLIPSE_SOURCE_BUNDLE |
private java.util.Map<java.lang.String,TychoProject> |
projectTypes |
private java.lang.String |
qualifier
Build qualifier.
|
protected boolean |
requireSourceRoots
Whether source folders are required or not.
|
private boolean |
sourceBundle
Whether the source jar should be an Eclipse source bundle.
|
private java.lang.String |
sourceBundleSuffix
The suffix to be added to the symbolic name of the bundle to construct the symbolic name of
the Eclipse source bundle.
|
protected boolean |
strictSrcIncludes
If set to
true (the default), missing build.properties src.includes will cause
build failure. |
protected boolean |
useDefaultSourceExcludes
Whether default source excludes for SCM files defined in
AbstractScanner#DEFAULTEXCLUDES should be used. |
private static java.lang.String |
VERSION_QUALIFIER |
excludeResources, finalName, includePom, outputDirectory, project, reactorProjects, session
Constructor and Description |
---|
OsgiSourceMojo() |
Modifier and Type | Method and Description |
---|---|
private void |
addSourceBundleManifestEntries(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration) |
private static java.util.List<java.lang.String> |
asList(java.lang.String[] patterns) |
private static org.apache.maven.model.Resource |
createResource(java.lang.String directory,
java.util.List<java.lang.String> includes,
java.util.List<java.lang.String> excludes) |
private org.apache.maven.model.Resource |
generateL10nFile() |
private BuildProperties |
getBuildProperties() |
protected java.lang.String |
getClassifier() |
private static org.codehaus.plexus.util.xml.Xpp3Dom |
getConfigurationElement(org.codehaus.plexus.util.xml.Xpp3Dom config,
java.lang.String name) |
private java.lang.String |
getEclipseHeaderSourceRoots() |
private static java.lang.String |
getElementValue(org.codehaus.plexus.util.xml.Xpp3Dom config,
java.lang.String name) |
private org.osgi.framework.Version |
getExpandedVersion(java.lang.String versionStr) |
private java.lang.String |
getL10nResolvedValue(OsgiManifest manifest,
java.lang.String manifestHeaderKey,
java.util.Properties l10nProps) |
private static java.lang.String |
getParameterValue(org.apache.maven.model.PluginExecution execution,
java.lang.String name,
java.lang.String defaultValue) |
protected java.util.List<org.apache.maven.model.Resource> |
getResources(org.apache.maven.project.MavenProject p) |
private static java.lang.String |
getSourceRootTargetPath(java.lang.String jarName) |
protected java.util.List<org.apache.maven.model.Resource> |
getSources(org.apache.maven.project.MavenProject p) |
protected java.util.List<org.apache.maven.model.Resource> |
getSources(org.apache.maven.project.MavenProject p,
boolean requireSourceRoots,
BuildProperties buildProperties) |
protected boolean |
isRelevantProject(org.apache.maven.project.MavenProject project) |
protected static boolean |
isRelevantProjectImpl(org.apache.maven.project.MavenProject project,
BuildPropertiesParser buildPropertiesParser) |
protected java.util.Properties |
readL10nProps(OsgiManifest manifest) |
protected void |
updateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration) |
addDirectory, addDirectory, archiveProjectContent, createArchiver, execute, getExtension, getProject, getType, packageSources, packageSources
private static final java.lang.String GOAL
private static final java.lang.String MANIFEST_HEADER_ECLIPSE_SOURCE_BUNDLE
private static final java.lang.String MANIFEST_BUNDLE_LOCALIZATION_BASENAME
private static final java.lang.String MANIFEST_BUNDLE_LOCALIZATION_FILENAME
private static final java.lang.String I18N_KEY_PREFIX
private static final java.lang.String I18N_KEY_BUNDLE_VENDOR
private static final java.lang.String I18N_KEY_BUNDLE_NAME
private static final java.lang.String VERSION_QUALIFIER
@Parameter(defaultValue="true") private boolean sourceBundle
@Parameter(defaultValue="false") private boolean distinctSourceRoots
true
and
there is a nested jar named foo.jar
, all of its sources will go into folder
foosrc/
. Otherwise all sources for all jars, nested or not, will go into the
root of the source jar (this is the default as it provides interoperability with maven source
jars).@Parameter(property="sourceBundleSuffix", defaultValue=".source") private java.lang.String sourceBundleSuffix
@Parameter(property="buildQualifier") private java.lang.String qualifier
@Parameter(defaultValue="true") protected boolean useDefaultSourceExcludes
AbstractScanner#DEFAULTEXCLUDES
should be used.@Parameter(defaultValue="false", readonly=true) protected boolean requireSourceRoots
@Parameter(defaultValue="true") protected boolean strictSrcIncludes
true
(the default), missing build.properties src.includes will cause
build failure. If set to false
, missing build.properties src.includes will be
reported as warnings but the build will not fail.@Parameter private org.codehaus.plexus.archiver.util.DefaultFileSet[] additionalFileSets
<additionalFileSets> <fileSet> <directory>${project.basedir}/sourceIncludes/</directory> <includes> <include>**/*</include> </includes> </fileSet> </additionalFileSets>
@Parameter(defaultValue="sources") private java.lang.String classifier
finalName-
classifier.jar
@Component(role=TychoProject.class) private java.util.Map<java.lang.String,TychoProject> projectTypes
@Component BuildPropertiesParser buildPropertiesParser
@Component private IncludeValidationHelper includeValidationHelper
@Component private BundleReader bundleReader
protected java.util.List<org.apache.maven.model.Resource> getSources(org.apache.maven.project.MavenProject p) throws org.apache.maven.plugin.MojoExecutionException
getSources
in class AbstractSourceJarMojo
p
- not nullorg.apache.maven.plugin.MojoExecutionException
protected java.util.List<org.apache.maven.model.Resource> getSources(org.apache.maven.project.MavenProject p, boolean requireSourceRoots, BuildProperties buildProperties) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected java.util.List<org.apache.maven.model.Resource> getResources(org.apache.maven.project.MavenProject p) throws org.apache.maven.plugin.MojoExecutionException
getResources
in class AbstractSourceJarMojo
p
- not nullorg.apache.maven.plugin.MojoExecutionException
private static java.util.List<java.lang.String> asList(java.lang.String[] patterns)
private static org.apache.maven.model.Resource createResource(java.lang.String directory, java.util.List<java.lang.String> includes, java.util.List<java.lang.String> excludes)
private org.apache.maven.model.Resource generateL10nFile() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected java.util.Properties readL10nProps(OsgiManifest manifest) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
private java.lang.String getL10nResolvedValue(OsgiManifest manifest, java.lang.String manifestHeaderKey, java.util.Properties l10nProps) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected java.lang.String getClassifier()
getClassifier
in class AbstractSourceJarMojo
sources
or test-sources
protected void updateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration)
updateSourceManifest
in class AbstractSourceJarMojo
private void addSourceBundleManifestEntries(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration)
private java.lang.String getEclipseHeaderSourceRoots()
private static java.lang.String getSourceRootTargetPath(java.lang.String jarName)
private org.osgi.framework.Version getExpandedVersion(java.lang.String versionStr)
protected boolean isRelevantProject(org.apache.maven.project.MavenProject project)
isRelevantProject
in class AbstractSourceJarMojo
protected static boolean isRelevantProjectImpl(org.apache.maven.project.MavenProject project, BuildPropertiesParser buildPropertiesParser)
private static java.lang.String getParameterValue(org.apache.maven.model.PluginExecution execution, java.lang.String name, java.lang.String defaultValue)
private static java.lang.String getElementValue(org.codehaus.plexus.util.xml.Xpp3Dom config, java.lang.String name)
private static org.codehaus.plexus.util.xml.Xpp3Dom getConfigurationElement(org.codehaus.plexus.util.xml.Xpp3Dom config, java.lang.String name)
private BuildProperties getBuildProperties()