[BATCHEE-141][BATCHEE-142] add cdise lifecycle for cli module + upgrade tomee + upgrade some mvn plugins
diff --git a/extensions/commons-csv/pom.xml b/extensions/commons-csv/pom.xml
index f45137c..9d31c66 100644
--- a/extensions/commons-csv/pom.xml
+++ b/extensions/commons-csv/pom.xml
@@ -42,7 +42,7 @@
     <dependency>
       <groupId>org.apache.xbean</groupId>
       <artifactId>xbean-reflect</artifactId>
-      <version>4.4</version>
+      <version>4.18</version>
       <optional>true</optional>
     </dependency>
   </dependencies>
diff --git a/gui/servlet/embedded/src/main/java/org/apache/batchee/servlet/SimpleRestController.java b/gui/servlet/embedded/src/main/java/org/apache/batchee/servlet/SimpleRestController.java
index d9ded4c..66ad6c5 100644
--- a/gui/servlet/embedded/src/main/java/org/apache/batchee/servlet/SimpleRestController.java
+++ b/gui/servlet/embedded/src/main/java/org/apache/batchee/servlet/SimpleRestController.java
@@ -87,7 +87,9 @@
 
     private void startBatch(String batchName, HttpServletRequest req, HttpServletResponse resp) {
         Properties jobProperties = extractJobProperties(req, resp);
-        if (jobProperties == null) { return; }
+        if (jobProperties == null) {
+            return;
+        }
 
         try {
             long jobId = jobOperator.start(batchName, jobProperties);
@@ -100,8 +102,7 @@
         }
     }
 
-    private void batchStatus(String batchId, HttpServletRequest req, HttpServletResponse resp)
-    {
+    private void batchStatus(String batchId, HttpServletRequest req, HttpServletResponse resp) {
         Long executionId = extractExecutionId(batchId, resp);
         if (executionId == null) {
             return;
diff --git a/jbatch/pom.xml b/jbatch/pom.xml
index c2e5535..125fc0a 100644
--- a/jbatch/pom.xml
+++ b/jbatch/pom.xml
@@ -28,7 +28,7 @@
   <name>BatchEE :: JBatch</name>
 
   <properties>
-    <openjpa.version>2.3.0</openjpa.version>
+    <openjpa.version>3.1.2</openjpa.version>
 
     <tck.suite>${project.build.directory}/test-classes/testng/jsr352-tck-impl-EE-suite.xml</tck.suite>
   </properties>
@@ -72,7 +72,7 @@
     <dependency>
       <groupId>org.apache.xbean</groupId>
       <artifactId>xbean-reflect</artifactId>
-      <version>4.5</version>
+      <version>4.18</version>
     </dependency>
 
     <dependency>
@@ -414,7 +414,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-assembly-plugin</artifactId>
-        <version>2.4</version>
+        <version>3.3.0</version>
         <configuration>
           <tarLongFileMode>gnu</tarLongFileMode>
           <descriptors>
@@ -430,7 +430,93 @@
           </execution>
         </executions>
       </plugin>
-
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.4</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <shadedArtifactAttached>true</shadedArtifactAttached>
+              <shadedClassifierName>jakarta</shadedClassifierName>
+              <createDependencyReducedPom>false</createDependencyReducedPom>
+              <transformers>
+                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
+              </transformers>
+              <artifactSet> <!-- don't include transitive deps -->
+                <includes>
+                  <include>${project.groupId}:${project.artifactId}</include>
+                </includes>
+              </artifactSet>
+              <relocations>
+                <relocation>
+                  <pattern>javax.batch</pattern>
+                  <shadedPattern>jakarta.batch</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.annotation</pattern>
+                  <shadedPattern>jakarta.annotation</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.el</pattern>
+                  <shadedPattern>jakarta.el</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.enterprise</pattern>
+                  <shadedPattern>jakarta.enterprise</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.decorator</pattern>
+                  <shadedPattern>jakarta.decorator</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.inject</pattern>
+                  <shadedPattern>jakarta.inject</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.interceptor</pattern>
+                  <shadedPattern>jakarta.interceptor</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.servlet</pattern>
+                  <shadedPattern>jakarta.servlet</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.transaction</pattern>
+                  <shadedPattern>jakarta.transaction</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.validation</pattern>
+                  <shadedPattern>jakarta.validation</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.persistence</pattern>
+                  <shadedPattern>jakarta.persistence</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.faces</pattern>
+                  <shadedPattern>jakarta.faces</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.ejb</pattern>
+                  <shadedPattern>jakarta.ejb</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>javax.jms</pattern>
+                  <shadedPattern>jakarta.jms</shadedPattern>
+                </relocation>
+                <!--
+                todo: javax.transaction, it is in the JVM so can have issue repackaging
+                -->
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/jbatch/src/main/java/org/apache/batchee/container/modelresolver/impl/AbstractPropertyResolver.java b/jbatch/src/main/java/org/apache/batchee/container/modelresolver/impl/AbstractPropertyResolver.java
index ff3af4d..03d82ba 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/modelresolver/impl/AbstractPropertyResolver.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/modelresolver/impl/AbstractPropertyResolver.java
@@ -43,7 +43,7 @@
     }

 

 

-    private enum PROPERTY_TYPE {

+    private enum PropertyType {

         JOB_PARAMETERS, SYSTEM_PROPERTIES, JOB_PROPERTIES, PARTITION_PROPERTIES

     }

 

@@ -160,7 +160,7 @@
      * @param name

      * @return

      */

-    private String resolvePropertyValue(final String name, PROPERTY_TYPE propType,

+    private String resolvePropertyValue(final String name, PropertyType propType,

                                         final Properties submittedProperties, final Properties xmlProperties) {

 

 

@@ -301,15 +301,15 @@
 

 

         //FIXME We may want to throw a more helpful exception here to say there was probably a typo.

-        PROPERTY_TYPE type = null;

+        PropertyType type = null;

         if (str.startsWith("#{jobParameters['", startPropIndex)) {

-            type = PROPERTY_TYPE.JOB_PARAMETERS;

+            type = PropertyType.JOB_PARAMETERS;

         } else if (str.startsWith("#{systemProperties['", startPropIndex)) {

-            type = PROPERTY_TYPE.SYSTEM_PROPERTIES;

+            type = PropertyType.SYSTEM_PROPERTIES;

         } else if (str.startsWith("#{jobProperties['", startPropIndex)) {

-            type = PROPERTY_TYPE.JOB_PROPERTIES;

+            type = PropertyType.JOB_PROPERTIES;

         } else if (isPartitionedStep && str.startsWith("#{partitionPlan['", startPropIndex)) {

-            type = PROPERTY_TYPE.PARTITION_PROPERTIES;

+            type = PropertyType.PARTITION_PROPERTIES;

         }

 

         if (type == null) {

@@ -338,19 +338,19 @@
                 defaultPropExpression = str.substring(endPropIndex + "]}?:".length() + 1, tempEndPropIndex);

             }

 

-            if (type.equals(PROPERTY_TYPE.JOB_PARAMETERS)) {

+            if (type.equals(PropertyType.JOB_PARAMETERS)) {

                 propName = str.substring(startPropIndex + "#{jobParameters['".length(), endPropIndex);

             }

 

-            if (type.equals(PROPERTY_TYPE.JOB_PROPERTIES)) {

+            if (type.equals(PropertyType.JOB_PROPERTIES)) {

                 propName = str.substring(startPropIndex + "#{jobProperties['".length(), endPropIndex);

             }

 

-            if (type.equals(PROPERTY_TYPE.SYSTEM_PROPERTIES)) {

+            if (type.equals(PropertyType.SYSTEM_PROPERTIES)) {

                 propName = str.substring(startPropIndex + "#{systemProperties['".length(), endPropIndex);

             }

 

-            if (type.equals(PROPERTY_TYPE.PARTITION_PROPERTIES)) {

+            if (type.equals(PropertyType.PARTITION_PROPERTIES)) {

                 propName = str.substring(startPropIndex + "#{partitionPlan['".length(), endPropIndex);

             }

 

@@ -365,13 +365,13 @@
     class NextProperty {

 

         final String propName;

-        final PROPERTY_TYPE propType;

+        final PropertyType propType;

         final int startIndex;

         final int endIndex;

         final String defaultValueExpression;

 

 

-        NextProperty(String propName, PROPERTY_TYPE propType, int startIndex, int endIndex, String defaultValueExpression) {

+        NextProperty(String propName, PropertyType propType, int startIndex, int endIndex, String defaultValueExpression) {

             this.propName = propName;

             this.propType = propType;

             this.startIndex = startIndex;

diff --git a/pom.xml b/pom.xml
index 9047b6b..e38eb62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,8 +44,8 @@
         <jackson.version>2.2.2</jackson.version>
         <jodatime.version>2.9.1</jodatime.version>
         <johnzon.version>1.0.0</johnzon.version>
-        <tomee.version>7.0.4</tomee.version>
-        <deltaspike.version>1.8.0</deltaspike.version>
+        <tomee.version>8.0.4</tomee.version>
+        <deltaspike.version>1.9.4</deltaspike.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <batchee.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/geronimo/content/batchee</batchee.scmPubUrl>
         <batchee.scmPubCheckoutDirectory>${basedir}/.site-content</batchee.scmPubCheckoutDirectory>
@@ -199,7 +199,7 @@
             <dependency> <!-- camel/arquillian -->
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
-                <version>4.12</version>
+                <version>4.13.1</version>
                 <scope>test</scope>
             </dependency>
             <dependency>
@@ -225,7 +225,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-remote-resources-plugin</artifactId>
-                <version>1.5</version>
+                <version>1.7.0</version>
                 <dependencies>
                     <dependency> <!-- workaround for jdk 1.8 -->
                         <groupId>org.apache.maven.shared</groupId>
@@ -237,29 +237,8 @@
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-enforcer-plugin</artifactId>
-                <version>1.1.1</version>
-                <executions>
-                    <execution>
-                        <id>enforce-java</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>enforce</goal>
-                        </goals>
-                        <configuration>
-                            <rules>
-                                <requireJavaVersion>
-                                    <version>1.6.0</version>
-                                </requireJavaVersion>
-                            </rules>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>2.12</version>
+                <version>3.1.1</version>
                 <executions>
                     <execution>
                         <id>verify-style</id>
@@ -270,14 +249,12 @@
                     </execution>
                 </executions>
                 <configuration>
-                    <!-- exclude JAXB generated stuff -->
-                    <excludes>org/apache/batchee/jaxb/*</excludes>
+                    <!-- exclude generated stuff -->
+                    <excludes>org/apache/batchee/jaxb/*,org/apache/batchee/tools/maven/HelpMojo*</excludes>
 
                     <logViolationsToConsole>true</logViolationsToConsole>
                     <checkstyleRules>
                         <module name="Checker">
-                            <module name="SuppressionCommentFilter" />
-
                             <!-- Checks for Size Violations.                    -->
                             <!-- See http://checkstyle.sf.net/config_sizes.html -->
                             <module name="FileLength">
@@ -289,11 +266,12 @@
                             <!-- See http://checkstyle.sf.net/config_whitespace.html -->
                             <module name="FileTabCharacter" />
 
+                            <module name="LineLength">
+                                <property name="max" value="180" />
+                                <property name="ignorePattern" value="@version|@see" />
+                            </module>
 
                             <module name="TreeWalker">
-                                <!-- needed for the SuppressionCommentFilter -->
-                                <module name="FileContentsHolder" />
-
                                 <!-- Checks for Javadoc comments.                     -->
                                 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
                                 <!-- module name="JavadocMethod"/ -->
@@ -344,16 +322,9 @@
                                 <module name="UnusedImports" />
 
 
-                                <module name="LineLength">
-                                    <property name="max" value="180" />
-                                    <property name="ignorePattern" value="@version|@see" />
-                                </module>
                                 <module name="MethodLength">
                                     <property name="max" value="250" />
                                 </module>
-                                <module name="ParameterNumber">
-                                    <property name="max" value="10" />
-                                </module>
 
                                 <!-- Checks for blocks. You know, those {}'s         -->
                                 <!-- See http://checkstyle.sf.net/config_blocks.html -->
@@ -421,7 +392,7 @@
             <plugin>
                 <groupId>org.apache.rat</groupId>
                 <artifactId>apache-rat-plugin</artifactId>
-                <version>0.10</version>
+                <version>0.13</version>
                 <configuration>
                     <includes>
                         <include>src/**/*</include>
@@ -452,7 +423,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.16</version>
+                <version>3.0.0-M5</version>
                 <configuration>
                     <systemPropertyVariables>
                         <derby.stream.error.file>target/derby.log</derby.stream.error.file>
@@ -462,10 +433,10 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>3.8.1</version>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.8</source>
+                    <target>1.8</target>
                 </configuration>
             </plugin>
             <plugin>
@@ -512,6 +483,16 @@
                     <autoVersionSubmodules>true</autoVersionSubmodules>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.2.0</version>
+                <configuration>
+                    <doclint>none</doclint>
+                    <notimestamp>true</notimestamp>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
@@ -525,10 +506,10 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.9.1</version>
+                <version>3.2.0</version>
                 <configuration>
+                    <doclint>none</doclint>
                     <notimestamp>true</notimestamp>
-                    <additionalparam>-Xdoclint:none</additionalparam>
                 </configuration>
                 <reportSets>
                     <reportSet>
diff --git a/tools/cli/pom.xml b/tools/cli/pom.xml
index a0e4988..93af403 100644
--- a/tools/cli/pom.xml
+++ b/tools/cli/pom.xml
@@ -73,6 +73,34 @@
       <optional>true</optional>
     </dependency>
     <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-asm8-shaded</artifactId>
+      <version>4.17</version>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-finder-shaded</artifactId>
+      <version>4.18</version>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-bundleutils</artifactId>
+      <version>4.18</version>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-naming</artifactId>
+      <version>4.18</version>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
       <groupId>org.apache.deltaspike.cdictrl</groupId>
       <artifactId>deltaspike-cdictrl-api</artifactId>
       <version>${deltaspike.version}</version>
diff --git a/tools/cli/src/main/assembly/bin-openejb.xml b/tools/cli/src/main/assembly/bin-openejb.xml
index 45b5ebe..4b76ff6 100644
--- a/tools/cli/src/main/assembly/bin-openejb.xml
+++ b/tools/cli/src/main/assembly/bin-openejb.xml
@@ -101,11 +101,7 @@
         <include>org.apache.geronimo.components:geronimo-transaction</include>
         <include>org.objectweb.howl:howl</include>
         <include>org.apache.geronimo.javamail:geronimo-javamail_1.4_mail</include>
-        <include>org.apache.xbean:xbean-asm5-shaded</include>
-        <include>org.apache.xbean:xbean-finder-shaded</include>
-        <!--<include>org.apache.xbean:xbean-reflect</include>--> <!-- already used by batchee -->
-        <include>org.apache.xbean:xbean-naming</include>
-        <include>org.apache.xbean:xbean-bundleutils</include>
+        <include>org.apache.xbean:*</include>
         <include>org.hsqldb:hsqldb</include>
         <include>org.apache.commons:commons-pool2</include>
         <include>org.apache.commons:commons-dbcp2</include>
@@ -129,6 +125,10 @@
         <include>commons-cli:commons-cli</include>
         <include>net.sourceforge.serp:serp</include>
       </includes>
+      <excludes>
+        <!-- already used by batchee -->
+        <exclude>org.apache.xbean:xbean-reflect</exclude>
+      </excludes>
     </dependencySet>
   </dependencySets>
 </assembly>
diff --git a/tools/cli/src/main/java/org/apache/batchee/cli/command/JobOperatorCommand.java b/tools/cli/src/main/java/org/apache/batchee/cli/command/JobOperatorCommand.java
index bb10fe7..2784943 100644
--- a/tools/cli/src/main/java/org/apache/batchee/cli/command/JobOperatorCommand.java
+++ b/tools/cli/src/main/java/org/apache/batchee/cli/command/JobOperatorCommand.java
@@ -217,10 +217,12 @@
             lifecycle = "org.apache.batchee.cli.lifecycle.impl.CdiCtrlLifecycle";
         } else if ("spring".equalsIgnoreCase(lifecycle)) {
             lifecycle = "org.apache.batchee.cli.lifecycle.impl.SpringLifecycle";
+        } else if ("cdise".equalsIgnoreCase(lifecycle)) {
+            lifecycle = "org.apache.batchee.cli.lifecycle.impl.CdiSeLifecycle";
         }
 
         try {
-            return (Lifecycle<Object>) loader.loadClass(lifecycle).newInstance();
+            return (Lifecycle<Object>) loader.loadClass(lifecycle).getConstructor().newInstance();
         } catch (final Exception e) {
             throw new BatchContainerRuntimeException(e);
         }
diff --git a/tools/cli/src/main/java/org/apache/batchee/cli/lifecycle/impl/CdiSeLifecycle.java b/tools/cli/src/main/java/org/apache/batchee/cli/lifecycle/impl/CdiSeLifecycle.java
new file mode 100644
index 0000000..eeb14d4
--- /dev/null
+++ b/tools/cli/src/main/java/org/apache/batchee/cli/lifecycle/impl/CdiSeLifecycle.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.batchee.cli.lifecycle.impl;
+
+import javax.enterprise.inject.se.SeContainer;
+import javax.enterprise.inject.se.SeContainerInitializer;
+
+public class CdiSeLifecycle extends LifecycleBase<SeContainer> {
+    @Override
+    public SeContainer start() {
+        return SeContainerInitializer.newInstance().initialize();
+    }
+
+    @Override
+    public void stop(final SeContainer cdiContainer) {
+        cdiContainer.close();
+    }
+}