Class AbstractFeaturePackBuildMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    UserFeaturePackBuildMojo, WfFeaturePackBuildMojo

    public abstract class AbstractFeaturePackBuildMojo
    extends org.apache.maven.plugin.AbstractMojo
    This Maven mojo creates a WildFly style feature-pack archive from the provided resources according to the feature-pack build configuration file and attaches it to the current Maven project as an artifact. The content of the future feature-pack archive is first created in the directory called `layout` under the module's build directory which is then ZIPped to create the feature-pack artifact.
    Author:
    Alexey Loubyansky
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean addFeaturePacksAsRequiredChannels
      Add any feature-pack dependency as a required channel in the channel YAML definition.
      protected org.apache.maven.shared.artifact.resolve.ArtifactResolver artifactResolver  
      protected boolean channelGenerated
      Generates a channel YAML definition when the feature-pack is produced.
      protected boolean jakartaTransform
      Whether to transform artifacts from javax.* to jakarta.* before generating feature specs.
      protected java.io.File jakartaTransformConfigsDir
      Directory where external user provided transformation configs are located (turns of default transformation rules).
      protected java.util.List<java.lang.String> jakartaTransformExcludedArtifacts
      A list of regular expression filters to exclude a list of GroupId:ArtifactId from jakarta transformation.
      protected java.io.File jakartaTransformRepo
      The directory where a generated local maven repo containing Jakarta-transformed artifacts are stored.
      protected boolean jakartaTransformVerbose
      If jakarta-transform is true, whether to produce verbose log output of the transformation work.
      protected org.apache.maven.project.MavenProject project  
      protected org.eclipse.aether.RepositorySystemSession repoSession  
      protected java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories  
      protected org.eclipse.aether.RepositorySystem repoSystem  
      protected org.apache.maven.execution.MavenSession session  
      protected java.util.Map<java.lang.String,​java.lang.String> taskProps
      Various properties that will be added to feature-pack's `resources/wildfly/wildfly-tasks.properties`.
      NOTE: values of this parameter will overwrite the corresponding values from task-properties-file parameter, in case it's also set.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.jboss.galleon.spec.PackageSpec addPackage​(java.nio.file.Path fpPackagesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, org.jboss.galleon.spec.PackageSpec.Builder pkgBuilder)  
      protected void buildFeaturePack​(org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, WildFlyFeaturePackBuild buildConfig)  
      protected void debug​(java.lang.String msg, java.lang.Object... args)  
      protected abstract void doExecute()  
      void execute()  
      protected org.wildfly.galleon.maven.MavenProjectArtifactVersions getArtifactVersions()  
      protected java.util.Map<java.lang.String,​org.jboss.galleon.layout.FeaturePackDescription> getFpDependencies()  
      protected java.nio.file.Path getFpDir()  
      protected JakartaTransformation getJakartaTransformation()  
      protected java.nio.file.Path getPackagesDir()  
      protected java.nio.file.Path getWildFlyResourcesDir()  
      protected java.nio.file.Path getWorkDir()  
      protected void handleAddOns​(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll)  
      protected void handleLayers​(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll)  
      protected void handleModules​(java.nio.file.Path srcModulesDir, org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder, java.nio.file.Path targetResources, org.jboss.galleon.spec.PackageSpec.Builder modulesAll)  
      protected void processFeaturePackDependencies​(WildFlyFeaturePackBuild buildConfig, org.jboss.galleon.spec.FeaturePackSpec.Builder fpBuilder)  
      java.nio.file.Path resolveArtifact​(org.wildfly.galleon.plugin.ArtifactCoords coords)  
      java.lang.String resolveVersion​(java.lang.String coordsWoVersion)  
      protected void setupDirs​(java.lang.String buildName, java.lang.String fpArtifactId, java.lang.String layoutDir, java.nio.file.Path resourcesDir)  
      protected void transformOnlyArtifactDependencies​(WildFlyFeaturePackBuild buildConfig)  
      protected void warn​(java.lang.String msg, java.lang.Object... args)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • repoSession

        @Parameter(defaultValue="${repositorySystemSession}",
                   readonly=true)
        protected org.eclipse.aether.RepositorySystemSession repoSession
      • project

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

        @Parameter(defaultValue="${session}",
                   readonly=true,
                   required=true)
        protected org.apache.maven.execution.MavenSession session
      • repositories

        @Parameter(defaultValue="${project.remoteProjectRepositories}",
                   readonly=true,
                   required=true)
        protected java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories
      • taskProps

        @Parameter(alias="task-properties",
                   required=false)
        protected java.util.Map<java.lang.String,​java.lang.String> taskProps
        Various properties that will be added to feature-pack's `resources/wildfly/wildfly-tasks.properties`.
        NOTE: values of this parameter will overwrite the corresponding values from task-properties-file parameter, in case it's also set.
      • jakartaTransform

        @Parameter(alias="jakarta-transform",
                   required=false)
        protected boolean jakartaTransform
        Whether to transform artifacts from javax.* to jakarta.* before generating feature specs.
      • jakartaTransformConfigsDir

        @Parameter(alias="jakarta-transform-configs-dir",
                   required=false)
        protected java.io.File jakartaTransformConfigsDir
        Directory where external user provided transformation configs are located (turns of default transformation rules).
      • jakartaTransformVerbose

        @Parameter(alias="jakarta-transform-verbose",
                   required=false)
        protected boolean jakartaTransformVerbose
        If jakarta-transform is true, whether to produce verbose log output of the transformation work.
      • jakartaTransformRepo

        @Parameter(alias="jakarta-transform-maven-repo",
                   defaultValue="${project.build.directory}/jakarta-transform-maven-repo",
                   required=true)
        protected java.io.File jakartaTransformRepo
        The directory where a generated local maven repo containing Jakarta-transformed artifacts are stored.
      • jakartaTransformExcludedArtifacts

        @Parameter(alias="jakarta-transform-excluded-artifacts",
                   required=false)
        protected java.util.List<java.lang.String> jakartaTransformExcludedArtifacts
        A list of regular expression filters to exclude a list of GroupId:ArtifactId from jakarta transformation. For example, to exclude wildfly-ee and smallrye-config artifacts:
         
         <jakarta-transform-excluded-artifacts>
           <exclude>org.wildfly:wildfly-ee\z</exclude>
           <exclude>io.smallrye.config:smallrye-config\z</exclude>
         </jakarta-transform-excluded-artifacts>
         
         
      • channelGenerated

        @Parameter(alias="generate-channel",
                   required=false,
                   defaultValue="false")
        protected boolean channelGenerated
        Generates a channel YAML definition when the feature-pack is produced. Any dependency from the feature pack is declared as a stream in the channel.
      • addFeaturePacksAsRequiredChannels

        @Parameter(alias="add-feature-packs-as-required-channels",
                   required=false,
                   defaultValue="true")
        protected boolean addFeaturePacksAsRequiredChannels
        Add any feature-pack dependency as a required channel in the channel YAML definition. This parameter has no effect if "generate-channel" is false.
      • repoSystem

        @Component
        protected org.eclipse.aether.RepositorySystem repoSystem
      • artifactResolver

        @Component
        protected org.apache.maven.shared.artifact.resolve.ArtifactResolver artifactResolver
    • Constructor Detail

      • AbstractFeaturePackBuildMojo

        public AbstractFeaturePackBuildMojo()
    • 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
      • getFpDependencies

        protected java.util.Map<java.lang.String,​org.jboss.galleon.layout.FeaturePackDescription> getFpDependencies()
      • getArtifactVersions

        protected org.wildfly.galleon.maven.MavenProjectArtifactVersions getArtifactVersions()
      • doExecute

        protected abstract void doExecute()
                                   throws org.apache.maven.plugin.MojoExecutionException,
                                          org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • setupDirs

        protected void setupDirs​(java.lang.String buildName,
                                 java.lang.String fpArtifactId,
                                 java.lang.String layoutDir,
                                 java.nio.file.Path resourcesDir)
      • getWorkDir

        protected java.nio.file.Path getWorkDir()
      • getWildFlyResourcesDir

        protected java.nio.file.Path getWildFlyResourcesDir()
      • getFpDir

        protected java.nio.file.Path getFpDir()
      • getPackagesDir

        protected java.nio.file.Path getPackagesDir()
      • resolveVersion

        public java.lang.String resolveVersion​(java.lang.String coordsWoVersion)
                                        throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • transformOnlyArtifactDependencies

        protected void transformOnlyArtifactDependencies​(WildFlyFeaturePackBuild buildConfig)
                                                  throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • buildFeaturePack

        protected void buildFeaturePack​(org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder,
                                        WildFlyFeaturePackBuild buildConfig)
                                 throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • processFeaturePackDependencies

        protected void processFeaturePackDependencies​(WildFlyFeaturePackBuild buildConfig,
                                                      org.jboss.galleon.spec.FeaturePackSpec.Builder fpBuilder)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resolveArtifact

        public java.nio.file.Path resolveArtifact​(org.wildfly.galleon.plugin.ArtifactCoords coords)
                                           throws org.jboss.galleon.ProvisioningException
        Throws:
        org.jboss.galleon.ProvisioningException
      • handleLayers

        protected void handleLayers​(java.nio.file.Path srcModulesDir,
                                    org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder,
                                    java.nio.file.Path targetResources,
                                    org.jboss.galleon.spec.PackageSpec.Builder modulesAll)
                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • handleAddOns

        protected void handleAddOns​(java.nio.file.Path srcModulesDir,
                                    org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder,
                                    java.nio.file.Path targetResources,
                                    org.jboss.galleon.spec.PackageSpec.Builder modulesAll)
                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • handleModules

        protected void handleModules​(java.nio.file.Path srcModulesDir,
                                     org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder,
                                     java.nio.file.Path targetResources,
                                     org.jboss.galleon.spec.PackageSpec.Builder modulesAll)
                              throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • addPackage

        protected org.jboss.galleon.spec.PackageSpec addPackage​(java.nio.file.Path fpPackagesDir,
                                                                org.jboss.galleon.layout.FeaturePackDescription.Builder fpBuilder,
                                                                org.jboss.galleon.spec.PackageSpec.Builder pkgBuilder)
                                                         throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • debug

        protected void debug​(java.lang.String msg,
                             java.lang.Object... args)
      • warn

        protected void warn​(java.lang.String msg,
                            java.lang.Object... args)