Class PackagePluginMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="package-plugin",
          threadSafe=true)
    public class PackagePluginMojo
    extends AbstractTychoPackagingMojo
    Creates a jar-based plugin and attaches it as an artifact
    • Field Detail

      • LOCK

        private static final java.lang.Object LOCK
      • buildDirectory

        @Parameter(property="project.build.directory",
                   required=true)
        protected java.io.File buildDirectory
        The output directory of the jar file By default this is the Maven "target/" directory.
      • jarArchiver

        @Component(role=org.codehaus.plexus.archiver.Archiver.class,
                   hint="jar")
        private org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
        The Jar archiver.
      • additionalFileSets

        @Parameter
        private org.codehaus.plexus.archiver.util.DefaultFileSet[] additionalFileSets
        Additional files to be included in the bundle jar. This can be used when bin.includes in build.properties is not flexible enough , e.g. for generated files. If conflicting, additional files win over bin.includes
        Example:
         <additionalFileSets>
          <fileSet>
           <directory>${project.build.directory}/mytool-gen/</directory>
           <includes>
            <include>**/*</include>
           </includes>
          </fileSet>     
         </additionalFileSets>
         
      • finalName

        @Parameter(property="project.build.finalName",
                   alias="jarName",
                   required=true)
        protected java.lang.String finalName
        Name of the generated JAR.
      • archive

        @Parameter
        private org.apache.maven.archiver.MavenArchiveConfiguration archive
        The maven archiver to use. One of the archiver properties is the addMavenDescriptor flag, which indicates whether the generated archive will contain the pom.xml and pom.properties file. If no archive configuration is specified, the default value is true. If the maven descriptor should not be added to the artifact, use the following configuration:
         <plugin>
           <groupId>org.eclipse.tycho</groupId>
           <artifactId>tycho-packaging-plugin</artifactId>
           <version>${tycho-version}</version>
           <configuration>
             <archive>
               <addMavenDescriptor>false</addMavenDescriptor>
             </archive>
           </configuration>
         </plugin>
         
      • sourceReferences

        @Parameter
        private SourceReferences sourceReferences
        Whether to generate an Eclipse-SourceReferences MANIFEST header. When using this parameter, property ${tycho.scmUrl} must be set and be a valid maven SCM URL. Example configuration:
                 <sourceReferences>
                   <generate>true</generate>
                 </sourceReferences>
         
        Note that a SourceReferencesProvider component must be registered for the SCM type being used. You may also override the generated value by configuring:
                 <sourceReferences>
                   <generate>true</generate>
                   <customValue>scm:myscm:customSourceReferenceValue</customValue>
                 </sourceReferences>
         
    • Constructor Detail

      • PackagePluginMojo

        public PackagePluginMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createSubJars

        private void createSubJars()
                            throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • makeJar

        private java.io.File makeJar​(BuildOutputJar jar)
                              throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createPluginJar

        private java.io.File createPluginJar()
                                      throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • updateManifest

        private java.io.File updateManifest()
                                     throws java.io.IOException,
                                            org.apache.maven.plugin.MojoExecutionException
        Throws:
        java.io.IOException
        org.apache.maven.plugin.MojoExecutionException