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 Details

    • useDefaultSourceExcludes

      @Parameter(defaultValue="true") protected boolean useDefaultSourceExcludes
      Whether default source excludes for SCM files defined in {AbstractScanner#DEFAULTEXCLUDES} should be used.
    • requireSourceRoots

      @Parameter(defaultValue="false", readonly=true) protected boolean requireSourceRoots
      Whether 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 strictSrcIncludes
      If set to 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.
  • 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:
      getSources in class AbstractSourceJarMojo
      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:
      getResources in class AbstractSourceJarMojo
      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

      protected String getClassifier()
      Specified by:
      getClassifier in class AbstractSourceJarMojo
      Returns:
      the wanted classifier, i.e. sources or test-sources
    • updateSourceManifest

      protected void updateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration)
      Overrides:
      updateSourceManifest in class AbstractSourceJarMojo
    • isRelevantProject

      protected boolean isRelevantProject(org.apache.maven.project.MavenProject project)
      Specified by:
      isRelevantProject in class AbstractSourceJarMojo
    • isRelevant

      public static boolean isRelevant(org.apache.maven.project.MavenProject project, org.eclipse.tycho.BuildPropertiesParser buildPropertiesParser)