Class CreateRuntimeImageMojo

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

    @Mojo(name="create-runtime-image",
          defaultPhase=PACKAGE,
          requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
          threadSafe=true)
    public class CreateRuntimeImageMojo
    extends org.apache.maven.plugin.AbstractMojo
    • Field Detail

      • project

        @Parameter(defaultValue="${project}",
                   readonly=true)
        protected org.apache.maven.project.MavenProject project
      • toolchainManager

        @Component
        private org.apache.maven.toolchain.ToolchainManager toolchainManager
      • mavenSession

        @Parameter(defaultValue="${session}",
                   readonly=true)
        private org.apache.maven.execution.MavenSession mavenSession
      • baseJdk

        @Parameter
        private java.lang.String baseJdk
      • modulePath

        @Parameter(defaultValue="[]")
        private java.util.List<java.io.File> modulePath
      • outputDirectory

        @Parameter(property="outputDirectory",
                   defaultValue="${project.build.directory}/image")
        private java.io.File outputDirectory
      • modules

        @Parameter(required=true)
        private java.util.List<java.lang.String> modules
      • launcher

        @Parameter
        private Launcher launcher
      • compression

        @Parameter
        private java.lang.String compression
      • stripDebug

        @Parameter(defaultValue="false")
        private boolean stripDebug
      • excludedResources

        @Parameter
        java.util.List<java.lang.String> excludedResources
      • ignoreSigningInformation

        @Parameter(property="ignoreSigningInformation",
                   defaultValue="false")
        private boolean ignoreSigningInformation
      • noHeaderFiles

        @Parameter(defaultValue="false")
        private boolean noHeaderFiles
      • noManPages

        @Parameter(defaultValue="false")
        private boolean noManPages
      • bindServices

        @Parameter(defaultValue="false")
        private boolean bindServices
    • Constructor Detail

      • CreateRuntimeImageMojo

        public CreateRuntimeImageMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • getNoProjectArtifactMessage

        private static java.lang.String getNoProjectArtifactMessage​(org.apache.maven.artifact.Artifact primaryProjectArtifact)
      • getJModsDir

        private java.nio.file.Path getJModsDir()
                                        throws org.apache.maven.plugin.MojoExecutionException
        Returns the directory with the jmod files to be used for creating the image. If baseJdk has been given, the jmod files from the JDK identified that way will be used; otherwise the jmod files from the JDK running the current build will be used.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getToolChainRequirements

        private java.util.Map<java.lang.String,​java.lang.String> getToolChainRequirements​(java.lang.String baseJdk)
                                                                                         throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getExcludeResourcesPatterns

        private java.util.List<java.lang.String> getExcludeResourcesPatterns()