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 addFeaturePacksAsRequiredManifests
      Add any feature-pack dependency as a required manifest in the manifest YAML definition.
      protected org.apache.maven.shared.artifact.resolve.ArtifactResolver artifactResolver  
      protected boolean deployChannelManifest  
      protected boolean generateChannelManifest
      Generates a channel manifest YAML definition when the feature-pack is produced.
      protected java.lang.String minimumStability
      The minimum stability level of the WildFly processes used to generate feature specs.
      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.
      protected org.wildfly.galleon.plugin.WildFlyChannelResolutionMode wildflyChannelResolutionMode
      Feature-pack WildFly channel resolution mode when WildFly channels are configured in the provisioning tooling used to provision this feature-pack.
      • 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 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 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.
      • generateChannelManifest

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

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

        @Parameter(alias="wildfly-channel-resolution-mode",
                   required=false,
                   defaultValue="NOT_REQUIRED",
                   property="wildfly.feature.pack.require.channel.resolution")
        protected org.wildfly.galleon.plugin.WildFlyChannelResolutionMode wildflyChannelResolutionMode
        Feature-pack WildFly channel resolution mode when WildFly channels are configured in the provisioning tooling used to provision this feature-pack. "NOT_REQUIRED" means that the feature-pack and artifacts can be resolved without WildFly channels. "REQUIRED" means that the feature-pack and all its artifacts must be only resolved from WildFly channels. "REQUIRED_FP_ONLY" means that only the feature-pack must be only resolved from WildFly channels. Referenced artifacts can be resolved outside of configured WildFly channels.
      • deployChannelManifest

        @Parameter(alias="deploy-channel-manifest",
                   required=false,
                   defaultValue="true",
                   property="wildfly.feature.pack.deploy-channel-manifest")
        protected boolean deployChannelManifest
      • repoSystem

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

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

        @Parameter(alias="minimum-stability",
                   required=false)
        protected java.lang.String minimumStability
        The minimum stability level of the WildFly processes used to generate feature specs. Set this if you need to generate feature specs for features with a lower stability level than the default level of the WildFly process being used for feature-spec generation.
    • 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
      • 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)