How to set Maven Plugin Version in Galleon build EAP 8

Solution Verified - Updated

Environment

  • Red Hat Enterprise Application Platform
    • 8.x
    • Local podman build
  • Red hat OpenShift Container Platform (OCP)
    • 4.x

Issue

  • How to set Maven Plugin Version in Galleon build EAP 8
  • How to change the Maven plugin version build in EAP 8

Resolution

Use PROVISIONING_MAVEN_PLUGIN_VERSION to change the Maven Plugin version that comes by default from the image.
Example below:

# Use EAP 8 Builder image to create a JBoss EAP 8 server with its default configuration
FROM registry.redhat.io/jboss-eap-8/eap8-openjdk17-builder-openshift-rhel8:latest AS builder
ENV PROVISIONING_MAVEN_PLUGIN_VERSION 1.0.1.Final-redhat-00008 <------------------------------------ Using version  1.0.1.Final-redhat-00008
ENV GALLEON_PROVISION_FEATURE_PACKS org.jboss.eap:wildfly-ee-galleon-pack,org.jboss.eap.cloud:eap-cloud-galleon-pack
ENV GALLEON_PROVISION_LAYERS cloud-default-config
ENV GALLEON_PROVISION_CHANNELS org.jboss.eap.channels:eap-8.0
ENV JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=1024m -Djava.net.preferIPv4Stack=true"

Root Cause

About EAP 8 image 8.0.GA-6

The image EAP 8 image 8.0.GA-6 mistakenly references the Maven plugin version 00006 that is not present at Red Hat's GA repository, the workaround above should fix this issue. See This content is not included.JBEAP-27755.

The maven plugins go to the link: https://maven.repository.redhat.com/ga/org/jboss/eap/channels/ where one can find the https://maven.repository.redhat.com/ga/org/jboss/eap/channels/eap-8.0/ (for EAP 8.0), which will have the manifest yaml file.

Container's Dockerfile as default values:

This environment variable comes from the image Dockerfile, for example [Builder Image for JBoss EAP 8.0 with OpenJDK17

  • Dockerfile](https://catalog.redhat.com/software/containers/jboss-eap-8/eap8-openjdk17-builder-open[…]89?image=669e65b4641175c20c33e9eb&container-tabs=dockerfile). Full list below:
Image TagPlugin version
This content is not included.1.0.1.GA-61.0.1.Final-redhat-00006 (version not present in Red Hat GA repository)
This content is not included.1.0.1.GA-51.0.1.Final-redhat-00003
This content is not included.1.0.1.GA-2.17199633191.0.1.Final-redhat-00001
This content is not included.1.0.1.GA-31.0.1.Final-redhat-00003
This content is not included.1.0.1.GA-21.0.1.Final-redhat-00001
This content is not included.1.0.0.GA-81.0.0.Final-redhat-00014

Those environment variables can be listed in proc/1/task/1/environ and are used in the Galleon provisioning process via pom.xml:

 cat opt/jboss/container/wildfly/s2i/galleon/provisioning/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
    JBoss, Home of Professional Open Source
    Copyright 2021, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jboss.galleon.s2i</groupId>
    <artifactId>galleon-s2i-parent</artifactId>
    <version>1.0.0.Final</version>
    <packaging>pom</packaging>
    <name>Provision servers with Galleon during S2I</name>
  
    <description>Provision servers with Galleon during S2I</description>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <properties>
        <s2i.provisioning.maven.plugin.artifactId>${env.PROVISIONING_MAVEN_PLUGIN_ARTIFACT_ID}</s2i.provisioning.maven.plugin.artifactId>
        <s2i.provisioning.maven.plugin.groupId>${env.PROVISIONING_MAVEN_PLUGIN_GROUP_ID}</s2i.provisioning.maven.plugin.groupId>
        <version.s2i.provisioning.maven.plugin>${env.PROVISIONING_MAVEN_PLUGIN_VERSION}</version.s2i.provisioning.maven.plugin>
    </properties>
    <modules>
        <module>generic_layers</module>
        <module>generic_provisioning</module>
    </modules>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>${s2i.provisioning.maven.plugin.groupId}</groupId>
                    <artifactId>${s2i.provisioning.maven.plugin.artifactId}</artifactId>
                    <version>${version.s2i.provisioning.maven.plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

For more details on Galleon provisioning see JBoss EAP 7 Galleon provisioning via provisioning.xml or eap-maven-plugin

Diagnostic Steps

Verify the maven plugin version via environment settings as below

$ podman run --entrypoint=/bin/bash --rm -it registry.redhat.io/jboss-eap-8/eap8-openjdk17-builder-openshift-rhel8:1.0.1.GA-5
Trying to pull registry.redhat.io/jboss-eap-8/eap8-openjdk17-builder-openshift-rhel8:1.0.1.GA-5...
...
[jboss@4a04f96f4653 ~]$ echo $PROVISIONING_MAVEN_PLUGIN_VERSION
1.0.1.Final-redhat-00003 <--------------
...
$ cat proc/1/task/1/environ
...
WILDFLY_OVERRIDING_ENV_VARS=1SSO_DEFAULT_PROVIDER_NAME=rh-sso
JBOSS_CONTAINER_WILDFLY_RUN_MODULE=/opt/jboss/container/wildfly/run
JBOSS_CONTAINER_S2I_CORE_MODULE=/opt/jboss/container/s2i/core/
JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE=/opt/jboss/container/maven/default/
JBOSS_CONTAINER_OPENJDK_JDK_MODULE=/opt/jboss/container/openjdk/jdk
JAVA_VENDOR=openjdkJBOSS_CONTAINER_JAVA_JVM_MODULE=/opt/jboss/container/java/jvm
PROVISIONING_MAVEN_PLUGIN_VERSION=1.0.1.Final-redhat-00006 <--------------------- plugin is coming with  1.0.1.Final-redhat-00006
JBOSS_CONTAINER_UTIL_LOGGING_MODULE=/opt/jboss/container/util/logging/
PROVISIONING_MAVEN_PLUGIN_GROUP_ID=org.jboss.eap.plugins
JAVA_VERSION=17PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
JBOSS_CONTAINER_MAVEN_38_MODULE=/opt/jboss/container/maven/38/
IMAGE_NAME=jboss-eap-8/eap8-openjdk17-builder-openshift-rhel8
JBOSS_IMAGE_NAME=jboss-eap-8/eap8-openjdk17-builder-openshift-rhel8
IMAGE_VERSION=1.0.1.GAJBOSS_HOME=/opt/server
JBOSS_CONTAINER_WILDFLY_S2I_LEGACY_GALLEON_MODULE=/opt/jboss/container/wildfly/s2i/galleoncontainer=oci
TERM=xtermJBOSS_CONTAINER_JAVA_PROXY_MODULE=/opt/jboss/container/java/proxyHOME=/home/jboss
JBOSS_CONTAINER_MAVEN_S2I_MODULE=/opt/jboss/container/maven/s2i
S2I_SOURCE_DEPLOYMENTS_FILE
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.