Thursday, December 31, 2020

Call another job in Jenkins declarative pipeline with parameters

 HOWTO

 

Parameters on the pipeline job

pipeline {
    agent any
    parameters {
        string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')

        text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')

        booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')

        choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')

        password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')
    }
    stages {
        stage('Example') {
            steps {
                echo "Hello ${params.PERSON}"

                echo "Biography: ${params.BIOGRAPHY}"

                echo "Toggle: ${params.TOGGLE}"

                echo "Choice: ${params.CHOICE}"

                echo "Password: ${params.PASSWORD}"
            }
        }
    }
}

 

Called job


pipeline {
    agent { 
       label 'dave_node'
    }
    parameters {
        string(name: 'branch', defaultValue: 'main', description: 'Some branch')
    }
    stages {
        stage('CalledJob') {
        
            steps {
            
                 echo "Build CalledJob branch ${params.branch}"  
                 
                 script {         
                     params.each {param ->
                       println "${param.key} -> ${param.value} "
                     }
                 }
                         
            
                git url: 'https://github.com/dveselka/calledjob/', credentialsId: 'daveCredentials', branch: "${params.branch}"     
            }
        }
    }
}


Calling job

   
       stage('BuildOtherJob') {
            steps {   
            
            echo "Call other job job"        
                script {           
                      build job: 'jobtocall', parameters: [
                             string(name: 'branch', value: "some_branch")
                        ]
                }
            }
       }    


Dynamic agent

pipeline {
    agent { 
       label params.agent == null || params.agent.isEmpty() ? "default-agent" : params.agent
    }

Sunday, December 27, 2020

Deploy JBoss Wildfly Java EE app with Maven using Jenkins pipeline and Docker

 HOWTO

 

GitHub projects


Pipeline file https://github.com/dveselka/java-ee-8/blob/main/java-ee8-minimal/Jenkinsfile

Add jenkins user into docker group

sudo usermod -aG docker jenkins
sudo systemctl restart jenkins

Checkout app from GitHub

        stage('Checkout') {
          git url: 'https://github.com/dveselka/java-ee-8/', credentialsId: 'dave-devops', branch: 'main'
        }

 

Build application using Maven

        stage('Build') {
          
          dir('java-ee8-minimal'){
             withMaven(maven:'Maven'
             ) {
                sh 'pwd'
                sh 'env'
                sh 'mvn clean package'
            
                def pom = readMavenPom file:'pom.xml'
                print pom.version
                env.version = pom.version
             }
          }
        }

 

Build Docker image

https://www.jenkins.io/doc/book/pipeline/docker/
        stage("BuildDockerImage"){
          dir('java-ee8-minimal'){
            def customImage = docker.build("my-image:${env.BUILD_ID}")
          }
        }
Jenkins log - Docker image build
[Pipeline] { (Image)
[Pipeline] dir
Running in /var/lib/jenkins/workspace/java-ee-8/java-ee8-minimal
[Pipeline] {
[Pipeline] isUnix
[Pipeline] sh
+ docker build -t com.dave/java-ee8-minimal:4 .
Sending build context to Docker daemon  46.59kB

Step 1/4 : FROM jboss/wildfly
 ---> 8d9094a2468d
Step 2/4 : RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#123 --silent
 ---> Using cache
 ---> 8b8272a09327
Step 3/4 : COPY ./target/java-ee8-minimal.war /opt/jboss/wildfly/standalone/deployments/
 ---> 229ba08da529
Step 4/4 : CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
 ---> Running in fdea8bab71ee
Removing intermediate container fdea8bab71ee
 ---> c165d87af41e
Successfully built c165d87af41e
Successfully tagged com.dave/java-ee8-minimal:4

 

Push Docker image to repository (optional)

 

Run container

        stage ('Run') {
          dir('java-ee8-minimal'){
            docker.image("com.dave/java-ee8-minimal:${env.BUILD_ID}").run('-it --name java-ee8-minimal com.dave/java-ee8-minimal')
          }
        }

 

Install Jenkins Docker plugin to remove this error

groovy.lang.MissingPropertyException: No such property: docker for class: groovy.lang.Binding
    at groovy.lang.Binding.getVariable(Binding.java:63)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:270)

 
Jenkins log - run Docker container

[Pipeline] { (Run)
[Pipeline] dir
Running in /var/lib/jenkins/workspace/java-ee-8/java-ee8-minimal
[Pipeline] {
[Pipeline] isUnix
[Pipeline] sh
+ docker run -d -it --name java-ee8-minimal com.dave/java-ee8-minimal:6
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Docker process
docker ps -a
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS               NAMES
0eb3d2588c6b        com.dave/java-ee8-minimal:6   "/opt/jboss/wildfly/…"   2 minutes ago       Up 2 minutes        8080/tcp            java-ee8-minimal

Deploy Java EE 8 application into JBoss Wildfy AS running on Docker

HOWTO

 

GitHub projects

Start JBoss Wildfly using Docker

[dave@dave java-ee-8]$ docker run -it jboss/wildfly
Unable to find image 'jboss/wildfly:latest' locally
latest: Pulling from jboss/wildfly
75f829a71a1c: Pull complete 
7b11f246b3d3: Pull complete 
b765648c2a58: Pull complete 
506aff4a9c5a: Pull complete 
e7e0b6e22530: Pull complete 
Digest: sha256:152a4dd6e524afa133dd200b1a4ba6411dc334dfd84921d5eafcbae85f859c00
Status: Downloaded newer image for jboss/wildfly:latest
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/wildfly

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

=========================================================================

10:40:59,521 INFO  [org.jboss.modules] (main) JBoss Modules version 1.10.2.Final
10:41:00,013 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
10:41:00,021 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
10:41:00,093 WARN  [org.jboss.as.warn.fd-limit] (main) WFLYSRV0071: The operating system has limited the number of open files to 1024 for this process; a value of at least 4096 is recommended
10:41:00,133 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 21.0.1.Final (WildFly Core 13.0.3.Final) starting
10:41:00,961 INFO  [org.wildfly.security] (ServerService Thread Pool -- 27) ELY00001: WildFly Elytron version 1.13.1.Final
10:41:01,501 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
10:41:01,542 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 36) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
10:41:01,611 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
10:41:01,626 INFO  [org.xnio] (MSC service thread 1-5) XNIO version 3.8.2.Final
10:41:01,631 INFO  [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.8.2.Final
10:41:01,671 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 52) WFLYCLINF0001: Activating Infinispan subsystem.
10:41:01,685 INFO  [org.wildfly.extension.microprofile.jwt.smallrye._private] (ServerService Thread Pool -- 63) WFLYJWT0001: Activating WildFly MicroProfile JWT Subsystem
10:41:01,693 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 61) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
10:41:01,700 INFO  [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 5.0.19.Final
10:41:01,709 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 62) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
10:41:01,711 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 54) WFLYRS0016: RESTEasy version 3.13.2.Final
10:41:01,718 WARN  [org.wildfly.extension.io] (ServerService Thread Pool -- 53) WFLYIO005: Your system is configured with 1024 file descriptors, but your current application server configuration will require a minimum of 1032 (and probably more than that); attempting to adjust, however you should expect stability problems unless you increase this number
10:41:01,725 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 76) WFLYWS0002: Activating WebServices Extension
10:41:01,726 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 64) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
10:41:01,696 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 74) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
10:41:01,733 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 59) WFLYJSF0007: Activated the following JSF Implementations: [main]
10:41:01,733 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 72) WFLYSEC0002: Activating Security Subsystem
10:41:01,739 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 65) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
10:41:01,741 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 53) WFLYIO001: Worker 'default' has auto-configured to 16 IO threads with 128 max task threads based on your 8 available processors
10:41:01,740 INFO  [org.jboss.as.security] (MSC service thread 1-1) WFLYSEC0001: Current PicketBox version=5.0.3.Final-redhat-00006
10:41:01,735 INFO  [org.jboss.as.connector] (MSC service thread 1-8) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.23.Final)
10:41:01,759 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 66) WFLYNAM0001: Activating Naming Subsystem
10:41:01,780 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0003: Undertow 2.2.2.Final starting
10:41:01,849 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 44) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
10:41:01,864 INFO  [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
10:41:01,869 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
10:41:01,881 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = h2
10:41:02,030 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 75) WFLYUT0014: Creating file handler for path '/opt/jboss/wildfly/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
10:41:02,043 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0012: Started server default-server.
10:41:02,046 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0018: Host default-host starting
10:41:02,051 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
10:41:02,051 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
10:41:02,194 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8080
10:41:02,297 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0493: EJB subsystem suspension complete
10:41:02,381 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
10:41:02,549 INFO  [org.jboss.as.patching] (MSC service thread 1-2) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
10:41:02,568 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore /opt/jboss/wildfly/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
10:41:02,580 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-5) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/jboss/wildfly/standalone/deployments
10:41:02,668 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8443
10:41:02,763 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBossWS 5.4.2.Final (Apache CXF 3.3.7) 
10:41:02,946 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
10:41:02,949 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 21.0.1.Final (WildFly Core 13.0.3.Final) started in 3839ms - Started 317 of 579 services (370 services are lazy, passive or on-demand)
10:41:02,951 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
10:41:02,951 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

 

SSH into Docker container
[dave@dave java-ee-8]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
32092f4064f8        jboss/wildfly       "/opt/jboss/wildfly/…"   4 minutes ago       Up 4 minutes        8080/tcp            thirsty_mccarthy
[dave@dave java-ee-8]$ docker exec -it thirsty_mccarthy /bin/bash
[jboss@32092f4064f8 ~]$ uname -a
Linux 32092f4064f8 5.9.15-100.fc32.x86_64 #1 SMP Wed Dec 16 16:49:20 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[jboss@32092f4064f8 ~]$ more /etc/re
redhat-release  resolv.conf     
[jboss@32092f4064f8 ~]$ more /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)
[jboss@32092f4064f8 ~]$ ls /opt/jboss/
.bash_logout   .bash_profile  .bashrc        wildfly/       
[jboss@32092f4064f8 ~]$ ls /opt/jboss/
.bash_logout   .bash_profile  .bashrc        wildfly/       
[jboss@32092f4064f8 ~]$ ls /opt/jboss/wildfly/
.installation/     LICENSE.txt        appclient/         copyright.txt      domain/            modules/           welcome-content/   
.well-known/       README.txt         bin/               docs/              jboss-modules.jar  standalone/     

 Start the container with port mapping


[dave@dave java-ee8-minimal]$ docker run -it com.dave/java-ee8-minimal /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement=0.0.0.0
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/wildfly

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

=========================================================================

11:05:36,608 INFO  [org.jboss.modules] (main) JBoss Modules version 1.10.2.Final
11:05:37,223 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
11:05:37,235 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
11:05:37,349 WARN  [org.jboss.as.warn.fd-limit] (main) WFLYSRV0071: The operating system has limited the number of open files to 1024 for this process; a value of at least 4096 is recommended
11:05:37,409 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 21.0.1.Final (WildFly Core 13.0.3.Final) starting

 

Create custom Docker image with added start command and admin user



$ more Dockerfile
FROM jboss/wildfly

RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#123 --silent

COPY ./target/java-ee8-minimal.war /opt/jboss/wildfly/standalone/deployments/

CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]



$ docker build -t com.dave/java-ee8-minimal .
Sending build context to Docker daemon  45.06kB
Step 1/4 : FROM jboss/wildfly
latest: Pulling from jboss/wildfly
75f829a71a1c: Pull complete 
7b11f246b3d3: Pull complete 
b765648c2a58: Pull complete 
506aff4a9c5a: Pull complete 
e7e0b6e22530: Pull complete 
Digest: sha256:152a4dd6e524afa133dd200b1a4ba6411dc334dfd84921d5eafcbae85f859c00
Status: Downloaded newer image for jboss/wildfly:latest
 ---> 8d9094a2468d
Step 2/4 : RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#123 --silent
 ---> Running in aa5d352002f3
Removing intermediate container aa5d352002f3
 ---> 8b8272a09327
Step 3/4 : COPY ./target/java-ee8-minimal.war /opt/jboss/wildfly/standalone/deployments/
 ---> cc421f2ffe58
Step 4/4 : CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
 ---> Running in 1dc6700a5950
Removing intermediate container 1dc6700a5950
 ---> fc3355adcac3
Successfully built fc3355adcac3
Successfully tagged com.dave/java-ee8-minimal:latest


Get IP address

$$ docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS               NAMES
ba4374f6cbb1        com.dave/java-ee8-minimal   "/opt/jboss/wildfly/…"   4 minutes ago       Up 4 minutes        8080/tcp            java-ee8-minimal
[dave@dave java-ee-8]$ docker inspect -f '{{ .NetworkSettings.IPAddress }}' java-ee8-minimal
172.17.0.2

Start the mofified container with mapped ports and added admin user

[dave@dave java-ee8-minimal]$ docker run -it --name java-ee8-minimal com.dave/java-ee8-minimal
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/wildfly

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

=========================================================================

11:18:28,581 INFO  [org.jboss.modules] (main) JBoss Modules version 1.10.2.Final
11:18:29,127 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
11:18:29,135 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
11:18:29,219 WARN  [org.jboss.as.warn.fd-limit] (main) WFLYSRV0071: The operating system has limited the number of open files to 1024 for this process; a value of at least 4096 is recommended
11:18:29,286 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 21.0.1.Final (WildFly Core 13.0.3.Final) starting
11:18:30,137 INFO  [org.wildfly.security] (ServerService Thread Pool -- 28) ELY00001: WildFly Elytron version 1.13.1.Final
11:18:30,739 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
11:18:30,782 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 21) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
11:18:30,819 INFO  [org.jboss.as.repository] (ServerService Thread Pool -- 9) WFLYDR0001: Content added at location /opt/jboss/wildfly/standalone/data/content/9a/599d68cb6a082432b9ec80cfbc307a3345471e/content
11:18:30,905 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
11:18:30,921 INFO  [org.xnio] (MSC service thread 1-8) XNIO version 3.8.2.Final
11:18:30,928 INFO  [org.xnio.nio] (MSC service thread 1-8) XNIO NIO Implementation Version 3.8.2.Final
11:18:30,982 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 52) WFLYCLINF0001: Activating Infinispan subsystem.
11:18:30,969 WARN  [org.wildfly.extension.io] (ServerService Thread Pool -- 53) WFLYIO005: Your system is configured with 1024 file descriptors, but your current application server configuration will require a minimum of 1032 (and probably more than that); attempting to adjust, however you should expect stability problems unless you increase this number
11:18:31,001 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 54) WFLYRS0016: RESTEasy version 3.13.2.Final
11:18:31,003 INFO  [org.jboss.as.connector] (MSC service thread 1-7) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.23.Final)
11:18:31,022 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 44) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
11:18:31,038 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 64) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
11:18:31,038 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = h2
11:18:31,066 INFO  [org.wildfly.extension.microprofile.jwt.smallrye._private] (ServerService Thread Pool -- 63) WFLYJWT0001: Activating WildFly MicroProfile JWT Subsystem
11:18:31,038 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 59) WFLYJSF0007: Activated the following JSF Implementations: [main]
11:18:31,069 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 62) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
11:18:31,069 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 5.0.19.Final
11:18:31,079 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 65) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
11:18:31,079 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 61) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
11:18:31,083 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 53) WFLYIO001: Worker 'default' has auto-configured to 16 IO threads with 128 max task threads based on your 8 available processors
11:18:31,100 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 72) WFLYSEC0002: Activating Security Subsystem
11:18:31,105 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 66) WFLYNAM0001: Activating Naming Subsystem
11:18:31,099 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 74) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
11:18:31,103 INFO  [org.jboss.as.security] (MSC service thread 1-3) WFLYSEC0001: Current PicketBox version=5.0.3.Final-redhat-00006
11:18:31,135 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 76) WFLYWS0002: Activating WebServices Extension
11:18:31,153 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 2.2.2.Final starting
11:18:31,197 INFO  [org.jboss.as.naming] (MSC service thread 1-8) WFLYNAM0003: Starting Naming Service
11:18:31,208 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-8) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
11:18:31,356 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
11:18:31,358 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
11:18:31,369 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 75) WFLYUT0014: Creating file handler for path '/opt/jboss/wildfly/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
11:18:31,382 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0012: Started server default-server.
11:18:31,400 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0018: Host default-host starting
11:18:31,507 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8080
11:18:31,571 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0493: EJB subsystem suspension complete
11:18:31,643 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
11:18:31,878 INFO  [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
11:18:31,896 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-8) WFLYDM0111: Keystore /opt/jboss/wildfly/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
11:18:31,910 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/jboss/wildfly/standalone/deployments
11:18:31,919 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "java-ee8-minimal.war" (runtime-name: "java-ee8-minimal.war")
11:18:31,989 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8443
11:18:32,071 INFO  [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 5.4.2.Final (Apache CXF 3.3.7) 
11:18:32,618 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment java-ee8-minimal.war
11:18:32,877 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-4) HV000001: Hibernate Validator 6.0.21.Final
11:18:33,273 INFO  [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-4) No shutdown hook registered: Please call close() manually on application shutdown.
11:18:33,390 INFO  [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900: 3.1.5 (Final)
11:18:33,681 INFO  [org.infinispan.CONTAINER] (ServerService Thread Pool -- 78) ISPN000128: Infinispan version: Infinispan 'Corona Extra' 11.0.4.Final
11:18:33,743 INFO  [org.infinispan.CONFIG] (MSC service thread 1-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
11:18:33,745 INFO  [org.infinispan.CONFIG] (MSC service thread 1-1) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
11:18:33,870 INFO  [org.infinispan.PERSISTENCE] (ServerService Thread Pool -- 78) ISPN000556: Starting user marshaller 'org.wildfly.clustering.infinispan.spi.marshalling.InfinispanProtoStreamMarshaller'
11:18:33,934 INFO  [io.smallrye.metrics] (MSC service thread 1-4) MicroProfile: Metrics activated (SmallRye Metrics version: 2.4.2)
11:18:34,134 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 78) WFLYCLINF0002: Started http-remoting-connector cache from ejb container
11:18:34,899 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 79) RESTEASY002225: Deploying javax.ws.rs.core.Application: class com.airhacks.JAXRSConfiguration$Proxy$_$$_WeldClientProxy
11:18:34,959 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 79) WFLYUT0021: Registered web context: '/java-ee8-minimal' for server 'default-server'
11:18:35,066 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0010: Deployed "java-ee8-minimal.war" (runtime-name : "java-ee8-minimal.war")
11:18:35,129 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
11:18:35,133 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 21.0.1.Final (WildFly Core 13.0.3.Final) started in 7081ms - Started 441 of 664 services (375 services are lazy, passive or on-demand)
11:18:35,136 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management
11:18:35,136 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990


Access the Admin console at port 9990 

Access the application at http://172.17.0.2:8080/java-ee8-minimal/resources/ping

Enjoy Jakarta EE with MicroProfile 2+!

 

Create Java EE 8 mininal project from Maven archetype

 HOWTO

 

Project

 https://github.com/dveselka/java-ee-8

Generate project from Adam Bien minimal archetype

[dave@dave git]$ cd java-ee-8/
[dave@dave java-ee-8]$ mvn archetype:generate -Dfilter=com.airhacks:javaee8-essentials-archetype
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:3.1.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:3.1.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO] 
[INFO] 
[INFO] --- maven-archetype-plugin:3.1.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -> com.airhacks:javaee8-essentials-archetype (Java EE 8 project quickstart template. Clean, lean and minimalistic.)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose com.airhacks:javaee8-essentials-archetype version: 
1: 0.0.1
2: 0.0.2
3: 0.0.4
Choose a number: 3: 3
Downloading from central: https://repo.maven.apache.org/maven2/com/airhacks/javaee8-essentials-archetype/0.0.4/javaee8-essentials-archetype-0.0.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/airhacks/javaee8-essentials-archetype/0.0.4/javaee8-essentials-archetype-0.0.4.pom (3.9 kB at 13 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/airhacks/javaee8-essentials-archetype/0.0.4/javaee8-essentials-archetype-0.0.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/airhacks/javaee8-essentials-archetype/0.0.4/javaee8-essentials-archetype-0.0.4.jar (3.9 kB at 16 kB/s)
Define value for property 'groupId': com.dave
Define value for property 'artifactId': java-ee8-minimal
Define value for property 'version' 1.0-SNAPSHOT: : 
Define value for property 'package' com.dave: : 
Confirm properties configuration:
groupId: com.dave
artifactId: java-ee8-minimal
version: 1.0-SNAPSHOT
package: com.dave
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: javaee8-essentials-archetype:0.0.4
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.dave
[INFO] Parameter: artifactId, Value: java-ee8-minimal
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.dave
[INFO] Parameter: packageInPathFormat, Value: com/dave
[INFO] Parameter: package, Value: com.dave
[INFO] Parameter: groupId, Value: com.dave
[INFO] Parameter: artifactId, Value: java-ee8-minimal
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Project created from Archetype in dir: /git/java-ee-8/java-ee8-minimal
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  52.463 s
[INFO] Finished at: 2020-12-27T10:48:01+01:00
[INFO] ------------------------------------------------------------------------

 

Generated project
[dave@dave java-ee-8]$ find java-ee8-minimal/
java-ee8-minimal/
java-ee8-minimal/pom.xml
java-ee8-minimal/Dockerfile
java-ee8-minimal/README.md
java-ee8-minimal/buildAndRun.sh
java-ee8-minimal/src
java-ee8-minimal/src/main
java-ee8-minimal/src/main/java
java-ee8-minimal/src/main/java/com
java-ee8-minimal/src/main/java/com/airhacks
java-ee8-minimal/src/main/java/com/airhacks/JAXRSConfiguration.java
java-ee8-minimal/src/main/java/com/airhacks/ping
java-ee8-minimal/src/main/java/com/airhacks/ping/boundary
java-ee8-minimal/src/main/java/com/airhacks/ping/boundary/PingResource.java
java-ee8-minimal/src/main/resources
java-ee8-minimal/src/main/resources/META-INF
java-ee8-minimal/src/main/resources/META-INF/microprofile-config.properties
java-ee8-minimal/src/main/webapp
java-ee8-minimal/src/main/webapp/WEB-INF
java-ee8-minimal/src/main/webapp/WEB-INF/beans.xml