Class CreateFlatpakMojo

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

    @Mojo(name="package-flatpak",
          defaultPhase=PACKAGE)
    public class CreateFlatpakMojo
    extends org.apache.maven.plugin.AbstractMojo
    Create a Flatpak application from the archived product output of the tycho-p2-director-plugin and exports the application to a Flatpak repository. Signing the Flatpak repository is optional, but highly recommended.
    Since:
    1.1.5
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<AdditionalSource> additionalSources
      An optional list of additional source files that should be installed into the Flatpak application.
      private java.lang.String branch
      The branch of the application, defaults to "master" but can be set to identify the stream, for example: "Oxygen" or "4.7"
      private java.lang.String command
      The filename or path to the main binary of the application, defaults to "eclipse"
      private boolean continueOnFail
      Whether the build should be stopped if the packaging process fails.
      private java.lang.String description
      A longer description of the Flatpak application that may be shown in distro software centres.
      private java.lang.String flatpakId  
      private java.io.File gpgHome
      The location of the GPG secure keyring to use when signing the Flatpak application.
      private java.lang.String gpgKey
      The GPG key to use when signing the Flatpak application.
      private java.lang.String id
      A unique identifier for the Flatpak application, for example: "org.eclipse.Platform"
      private java.lang.String license
      The license that the Flatpak application is distributed under.
      private java.lang.String maintainer
      An optional email address that can be used to contact the project about invalid or incomplete metadata.
      private java.lang.String minFlatpakVersion
      The minimum version of Flatpak needed at runtime, that this application will support.
      private java.lang.String name
      A friendly name for the Flatpak application that will be shown to use in software centres and in desktop environments.
      private org.apache.maven.project.MavenProject project  
      private java.io.File repository
      The repository to which the new Flatpak application should be exported.
      private java.lang.String repositoryUrl
      The URL at which the Flatpak repository will be available to users, this is embedded into generated "flatpakrepo" and "flatpakref" files.
      private java.lang.String runtimeVersion
      The version of the Gnome runtime on which to build the Flatpak application.
      private java.util.List<java.lang.String> screenshots
      An optional list of URLs to screenshots that may be shown in distro software centres.
      private java.lang.String serviceUrl
      An optional URL for the Flatpak application packaging web service.
      private boolean sign
      Whether the Flatpak application should be GPG signed.
      private boolean skip
      Skips the execution of this plugin.
      private java.io.File source
      An .tar.gz or .zip file containing a Linux product from which to generate a Flatpak application.
      private java.lang.String summary
      A short description of the Flatpak application that may be shown in distro software centres and in desktop environments.
      private int timeoutMillis
      Defines the timeout in milliseconds for any communication with the packaging web service.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • id

        @Parameter(required=true)
        private java.lang.String id
        A unique identifier for the Flatpak application, for example: "org.eclipse.Platform"
        Since:
        1.1.5
      • flatpakId

        private java.lang.String flatpakId
      • name

        @Parameter(required=true)
        private java.lang.String name
        A friendly name for the Flatpak application that will be shown to use in software centres and in desktop environments.
        Since:
        1.1.5
      • summary

        @Parameter(required=true)
        private java.lang.String summary
        A short description of the Flatpak application that may be shown in distro software centres and in desktop environments.
        Since:
        1.1.5
      • description

        @Parameter(required=true)
        private java.lang.String description
        A longer description of the Flatpak application that may be shown in distro software centres.
        Since:
        1.1.5
      • maintainer

        @Parameter
        private java.lang.String maintainer
        An optional email address that can be used to contact the project about invalid or incomplete metadata.
        Since:
        1.1.5
      • screenshots

        @Parameter
        private java.util.List<java.lang.String> screenshots
        An optional list of URLs to screenshots that may be shown in distro software centres.
        Since:
        1.1.5
      • branch

        @Parameter(required=true,
                   defaultValue="master")
        private java.lang.String branch
        The branch of the application, defaults to "master" but can be set to identify the stream, for example: "Oxygen" or "4.7"
        Since:
        1.1.5
      • command

        @Parameter(required=true,
                   defaultValue="eclipse")
        private java.lang.String command
        The filename or path to the main binary of the application, defaults to "eclipse"
        Since:
        1.1.5
      • runtimeVersion

        @Parameter(required=true,
                   defaultValue="3.28")
        private java.lang.String runtimeVersion
        The version of the Gnome runtime on which to build the Flatpak application. Defaults to "3.28"
        Since:
        1.1.5
      • source

        @Parameter(required=true)
        private java.io.File source
        An .tar.gz or .zip file containing a Linux product from which to generate a Flatpak application.
        Since:
        1.1.5
      • additionalSources

        @Parameter
        private final java.util.List<AdditionalSource> additionalSources
        An optional list of additional source files that should be installed into the Flatpak application. These files are simply copied into the sandbox at the given location. For example:
         <additionalSources>
                <additionalSource>
                        <source>/path/to/local/file</source>
                        <destination>/path/to/location/inside/the/sandbox</destination>
                </additionalSources>
         </additionalSources>
         
        Since:
        1.1.5
      • minFlatpakVersion

        @Parameter(required=true,
                   defaultValue="0.8.8")
        private java.lang.String minFlatpakVersion
        The minimum version of Flatpak needed at runtime, that this application will support. Defaults to "0.8.8" (the version available on RHEL 7.5)
        Since:
        1.1.5
      • license

        @Parameter(required=true,
                   defaultValue="EPL-1.0")
        private java.lang.String license
        The license that the Flatpak application is distributed under. It should be a valid SPDX license expression. For example:
        • EPL-1.0
        • Apache-2.0 AND LGPL-3.0-or-later

        A full list of recognized licenses and their identifiers can be found at the SPDX OpenSource License Registry.

        Since:
        1.1.5
      • repository

        @Parameter(property="cbi.flatpakager.repo")
        private java.io.File repository
        The repository to which the new Flatpak application should be exported. If not specified, a new repository will be created inside the build directory.
        Since:
        1.1.5
      • repositoryUrl

        @Parameter(property="cbi.flatpakager.repoUrl",
                   defaultValue="http://www.example.com/flatpak/repo")
        private java.lang.String repositoryUrl
        The URL at which the Flatpak repository will be available to users, this is embedded into generated "flatpakrepo" and "flatpakref" files.
        Since:
        1.1.5
      • skip

        @Parameter(property="cbi.flatpakager.skip",
                   defaultValue="false")
        private boolean skip
        Skips the execution of this plugin.
        Since:
        1.1.5
      • continueOnFail

        @Parameter(property="cbi.flatpakager.continueOnFail",
                   defaultValue="false")
        private boolean continueOnFail
        Whether the build should be stopped if the packaging process fails.
        Since:
        1.1.5
      • sign

        @Parameter(property="cbi.flatpakager.sign",
                   defaultValue="false")
        private boolean sign
        Whether the Flatpak application should be GPG signed.
        Since:
        1.1.5
      • gpgKey

        @Parameter(property="cbi.flatpakager.gpgkey")
        private java.lang.String gpgKey
        The GPG key to use when signing the Flatpak application.
        Since:
        1.1.5
      • gpgHome

        @Parameter(property="cbi.flatpakager.gpghome")
        private java.io.File gpgHome
        The location of the GPG secure keyring to use when signing the Flatpak application. Defaults to the ".gnupg" directory in the user's home.
        Since:
        1.1.5
      • serviceUrl

        @Parameter(property="cbi.flatpakager.serviceUrl")
        private java.lang.String serviceUrl
        An optional URL for the Flatpak application packaging web service.

        By default, the Flatpak application will be generated locally. If the Flatpak tools are unavailable locally, or the build is running on an architecture or OS where Flatpak is not supported, then a URL may be specified that indicated the location of the Flatpak packaging web service. For example:

        http://build.eclipse.org:31338/flatpak-packager

        Since:
        1.1.5
      • timeoutMillis

        @Parameter(property="cbi.flatpakager.timeoutMillis",
                   defaultValue="0")
        private int timeoutMillis
        Defines the timeout in milliseconds for any communication with the packaging web service. Defaults to zero, which is interpreted as an infinite timeout. This only means something if a serviceUrl is specified.
        Since:
        1.1.5
      • project

        @Parameter(defaultValue="${project}",
                   required=true,
                   readonly=true)
        private org.apache.maven.project.MavenProject project
    • Constructor Detail

      • CreateFlatpakMojo

        public CreateFlatpakMojo()
    • Method Detail

      • execute

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

        private java.lang.String fetchGpgKey​(ExceptionHandler exceptionHandler)
                                      throws java.io.IOException,
                                             org.apache.maven.plugin.MojoExecutionException
        Throws:
        java.io.IOException
        org.apache.maven.plugin.MojoExecutionException
      • generateManifest

        private void generateManifest​(java.io.File targetDir)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • buildAndSignRepo

        private void buildAndSignRepo​(ExceptionHandler exceptionHandler,
                                      java.io.File targetDir)
                               throws java.lang.InterruptedException,
                                      java.io.IOException,
                                      org.apache.maven.plugin.MojoExecutionException
        Throws:
        java.lang.InterruptedException
        java.io.IOException
        org.apache.maven.plugin.MojoExecutionException
      • generateRefFiles

        private void generateRefFiles​(java.lang.String armouredGpgKey)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • executeProcess

        private void executeProcess​(ExceptionHandler exceptionHandler,
                                    java.util.List<java.lang.String> args,
                                    java.io.File targetDir)
                             throws java.lang.InterruptedException,
                                    java.io.IOException,
                                    org.apache.maven.plugin.MojoExecutionException
        Throws:
        java.lang.InterruptedException
        java.io.IOException
        org.apache.maven.plugin.MojoExecutionException
      • executeProcessOnRemoteServer

        private void executeProcessOnRemoteServer​(HttpClient httpClient,
                                                  HttpRequest request)
                                           throws java.io.IOException
        Throws:
        java.io.IOException