Update to Log4j 2; Update to Turbine 5.0; Using in log4j.xml lookup web:rootdir, requires dependency log4j-web; Removed deprecated loggingRoot parameter in web.xml; Fixed jetty port configuration; Updated documentation, mysql server v5.5 is required at least for sql connectzor v8.x
diff --git a/.gitignore b/.gitignore
index ac180e4..1d90719 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
 /target
 .settings
+.idea
+.gitattributes
+*.iml
 .externalToolBuilders/
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 14f9912..f5a829e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
     <groupId>org.apache</groupId>
     <artifactId>apache</artifactId>
-    <version>18</version>
+    <version>20</version><!-- like turbine parent -->
   </parent>
   <groupId>org.apache.turbine</groupId>
   <artifactId>turbine-webapp-5.0</artifactId>
diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml
index e7e0478..4dfe69c 100644
--- a/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -128,5 +128,11 @@
         <include>**/*</include>
       </includes>
     </fileSet>
+     <fileSet filtered="false" packaged="false">
+        <directory>src/main/webapp/logs</directory>
+        <includes>
+          <include>**/*</include>
+        </includes>
+    </fileSet>
   </fileSets>
 </archetype-descriptor>
diff --git a/src/main/resources/archetype-resources/docs/README.txt b/src/main/resources/archetype-resources/docs/README.txt
index 01ef0d2..8cb124a 100644
--- a/src/main/resources/archetype-resources/docs/README.txt
+++ b/src/main/resources/archetype-resources/docs/README.txt
@@ -21,9 +21,9 @@
 
 About this archetype 
 
-Turbine Version: Turbine 4.0. 
+Turbine Version: Turbine 5.0. 
 
-# Quick Guide to using the new Turbine 4.0 maven archetype 
+# Quick Guide to using the new Turbine 5.0 maven archetype 
 for skeleton application generation
 
 ## Local database Setup
@@ -31,7 +31,7 @@
 First, you should have a local database installed and configured prior to 
 beginning the application setup below.
 
-As we are using MySQL bey default you need to create the database in MySQL, e.g. with
+As we are using MySQL by default you need to create the database in MySQL (server version should be at least 5.5, because of new sql driver), e.g. with
 
 mysql -u <user> -p
 mysql> create database helloWorld;
@@ -41,14 +41,14 @@
 
 ## Maven archetype 
 
-Next, you can invoke the Maven archetype for turbine-webapp-4.0 from 
+Next, you can invoke the Maven archetype for turbine-webapp-5.0 from 
 the command line as shown below - please update values starting 
 with 'groupId' as appropriate.
 
 mvn archetype:generate \
   -DarchetypeGroupId=org.apache.turbine \
-  -DarchetypeArtifactId=turbine-webapp-4.0 \
-  -DarchetypeVersion=1.0.1-SNAPSHOT \
+  -DarchetypeArtifactId=turbine-webapp-5.0 \
+  -DarchetypeVersion=1.0.3-SNAPSHOT \
   -DgroupId=com.mycompany.webapp \
   -DartifactId=myhelloworld \
   -Dversion=1.0 \
@@ -59,16 +59,37 @@
   -Dturbine_database_name=helloworld \
   -Dturbine_database_timezone=UTC \
   -Dturbine_database_url=jdbc:mysql://localhost:3306/ \
-  -Dgoals=generate-sources,pre-integration-test
+  -Dgoals=generate-sources,integration-test
+
+### Digression
+
+You may use 
+
+mvn archetype:generate -DarchetypeCatalog=local
+
+to avoid declaring the Darchetype* variables.
+
+This requires you provide a local catalog in $HOME\.m2\archetype-catalog.xml. Find further information here: https://maven.apache.org/archetype/archetype-models/archetype-catalog/archetype-catalog.html.
+
+##### Example
+<archetype-catalog ...>
+ <archetype>
+      <groupId>org.apache.turbine</groupId>
+      <artifactId>turbine-webapp-5.0</artifactId>
+      <version>1.0.3-SNAPSHOT</version>
+      <description>This archetype sets up a web application project based on Apache Turbine 5.0</description>
+    </archetype>
+  </archetypes>
+</archetype-catalog>
 
 ### Notes
 
-When invoking archetype:generate like above, you already have set Turbine goals generate-sources,pre-integration-test 
+When invoking archetype:generate like above, you already have set Turbine goals generate-sources,integration-test 
 and you can then skip them later.
 
 Be aware, when you set both mvn commands goals (which are maven phases actually), i.e  with
 
--Dgoals=generate-sources, pre-integration-test 
+-Dgoals=generate-sources, integration-test 
 
 you have to create the database (see above) before finishing the (interactive) archetype commands. 
 Otherwise you could catch up doing this later and after that is done calling the phases afterwards as mentioned below.
@@ -103,7 +124,7 @@
 If you get an error like "The driver has not received any packets" probably the database is not up and running or the port may be another one.
 
 Last step on the command line is run the server by invoking 
-mvn jetty:run         ## Now you can launch your new Turbine application
+mvn jetty:run         ## Now you can launch your new Turbine application by default http://localhost:8080/app
 
 ### Logs 
 
diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml
index 1d8d4ba..430c33e 100644
--- a/src/main/resources/archetype-resources/pom.xml
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -36,6 +36,15 @@
                 <directory>src/main/java</directory>
                 <includes>
                     <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
                 </includes>
             </resource>
             <!-- (target) resource and filtering is not used  at all ? 
@@ -174,7 +183,7 @@
 
             <!--  The serverTimezone parameter is required for MySQL.
             	You may need to remove it for other databases -->
-            <url>${turbine_database_url}${turbine_database_name}?serverTimezone=${turbine_database_timezone}</url>
+            <url>${turbine_database_url}${turbine_database_name}?serverTimezone=${turbine_database_timezone}&amp;useSSL=false&amp;verifyServerCertificate=false&amp;requireSSL=false</url>
 
             <username>${turbine_database_user}</username>
             <password>${turbine_database_password}</password>
@@ -236,11 +245,9 @@
             <scanIntervalSeconds>10</scanIntervalSeconds>
             <dumpOnStart>true</dumpOnStart>
             <reload>manual</reload>
-            <connectors>
-            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+            <httpConnector>
               <port>8081</port>
-            </connector>
-            </connectors>
+            </httpConnector>
             <!--webApp>
               <contextPath>/app</contextPath>
             </webApp-->
@@ -250,14 +257,19 @@
     </build>
 
     <dependencies>
-    
-    <!-- update with the database driver of your choice -->
-    <dependency>
-      <artifactId>mysql-connector-java</artifactId>
-      <groupId>mysql</groupId>
-      <version>8.0.12</version>
-    </dependency>    
-
+   
+      <!-- update with the database driver of your choice -->
+      <dependency>
+        <artifactId>mysql-connector-java</artifactId>
+        <groupId>mysql</groupId>
+        <version>8.0.12</version>
+      </dependency>
+       <!-- Allow lookup of #var("web:rootDir") in log4j2 file -->
+        <dependency>
+          <groupId>org.apache.logging.log4j</groupId>
+          <artifactId>log4j-web</artifactId>
+          <version>#var("log4j2.version")</version>
+        </dependency>
         <!-- Required for Java 9 and higher -->
         <dependency>
             <groupId>javax.xml.bind</groupId>
@@ -304,22 +316,7 @@
             </exclusion>
           </exclusions>
       </dependency>
-      <!-- slf4j still optional in 4.0 -->
-      <dependency>
-        <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-api</artifactId>
-        <version>${slf4j.version}</version>
-      </dependency>
-       <dependency>     <!-- delegate slf4j to log4j -->
-        <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-log4j12</artifactId>
-        <version>${slf4j.version}</version>
-       </dependency>
-       <dependency>     <!-- redirect JCL to slf4j -->
-        <groupId>org.slf4j</groupId>
-        <artifactId>jcl-over-slf4j</artifactId>
-        <version>${slf4j.version}</version>
-      </dependency>
+      <!-- slf4j already non optional/required  slf4j in T5.0-->
       <dependency>
         <groupId>org.apache.fulcrum</groupId>
         <artifactId>fulcrum-yaafi</artifactId>
@@ -353,6 +350,12 @@
         <groupId>org.apache.fulcrum</groupId>
         <artifactId>fulcrum-security-torque</artifactId>
         <version>#var("fulcrum.security")</version>
+        <exclusions>
+         <exclusion><!-- will we mapped in jcl-over-slf4j -->
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.fulcrum</groupId>
@@ -402,12 +405,12 @@
         <maven.compile.source>1.8</maven.compile.source>
         <maven.compile.target>1.8</maven.compile.target>
         <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
+        <log4j2.version>2.11.1</log4j2.version>
         <torque.version>4.0</torque.version>
         <fulcrum.json>2.0.0-SNAPSHOT</fulcrum.json>
         <fulcrum.intake>2.0.0-SNAPSHOT</fulcrum.intake>
         <fulcrum.security>1.1.3-SNAPSHOT</fulcrum.security>
         <turbine.core>5.0-SNAPSHOT</turbine.core>
-        <slf4j.version>1.7.25</slf4j.version>
         <skipTests>true</skipTests>
     </properties>
     
@@ -421,12 +424,10 @@
                         <groupId>org.mortbay.jetty</groupId>
                         <artifactId>maven-jetty-plugin</artifactId>
                         <configuration>
-                            <connectors>
-                                <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                                    <port>15000</port>
-                                    <maxIdleTime>60000</maxIdleTime>
-                                </connector>
-                            </connectors>
+                          <httpConnector>
+                            <port>8081</port>
+                            <idleTimeout>60000</idleTimeout>
+                          </httpConnector>
                         </configuration>
                     </plugin>
                 </plugins>
diff --git a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/TurbineResources.properties b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/TurbineResources.properties
index 387b732..b184621 100644
--- a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/TurbineResources.properties
+++ b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/TurbineResources.properties
@@ -25,6 +25,7 @@
 #
 # -------------------------------------------------------------------
 
+
 # -------------------------------------------------------------------
 #
 #  P I P E L I N E
@@ -34,11 +35,12 @@
 
 # -------------------------------------------------------------------
 #
-#  L O G 4 J - L O G G I N G
+#  L O G 4 J 2 - L O G G I N G
+#
+#  log4j2 may loads automatically if found on classpath, cf. https://logging.apache.org/log4j/2.x
 #
 # -------------------------------------------------------------------
-
-log4j.file = log4j.properties
+log4j2.file = log4j2.xml
 
 # -------------------------------------------------------------------
 #
diff --git a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/log4j.properties b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/log4j.properties
deleted file mode 100644
index b1b2301..0000000
--- a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/log4j.properties
+++ /dev/null
@@ -1,137 +0,0 @@
-#*

-# 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.

-*#

-##set($dollar = '$')

-##macro (var $label)${dollar}{${label}}#end

-# Turbine logging configuration

-#

-# If we don't know the logging facility, put it into the

-# turbine.log

-#

-log4j.rootLogger = INFO, app, console

-

-#

-# App log

-#

-log4j.logger.${package} = DEBUG, app

-log4j.additivity.${package} = false

-

-#

-# Avalon log

-#

-log4j.logger.avalon = DEBUG, app

-log4j.additivity.avalon = false

-

-#

-# Scheduler Category

-#

-log4j.logger.scheduler = INFO, app

-log4j.additivity.scheduler = false

-

-#

-# sql log

-# allows TRACE

-log4j.logger.org.apache.torque.util = DEBUG, sql, console

-log4j.additivity.org.apache.torque.util = false

-

-#

-# Torque log

-# allows TRACE

-log4j.logger.org.apache.torque = DEBUG, torque

-log4j.additivity.org.apache.torque = false

-

-#

-# Turbine goes into "turbine" loggers

-#

-log4j.logger.org.apache.turbine = DEBUG, turbine

-log4j.additivity.org.apache.turbine = false

-

-#

-# Velocity log

-#

-log4j.logger.velocity = INFO, velocity

-log4j.additivity.velocity = false

-

-# #######################################################################

-#

-# Logfile definitions

-#

-# #######################################################################

-

-#

-# Application.log

-#

-log4j.appender.app = org.apache.log4j.RollingFileAppender

-log4j.appender.app.MaxFileSize=5MB

-log4j.appender.app.MaxBackupIndex=5

-log4j.appender.app.file = ${applicationRoot}/logs/application.log

-log4j.appender.app.layout = org.apache.log4j.PatternLayout

-log4j.appender.app.layout.conversionPattern = %d [%t] %-5p %c - %m%n

-log4j.appender.app.append = false

-

-#

-# turbine.log

-#

-log4j.appender.turbine = org.apache.log4j.RollingFileAppender

-log4j.appender.turbine.MaxFileSize=5MB

-log4j.appender.turbine.MaxBackupIndex=5

-log4j.appender.turbine.file = ${applicationRoot}/logs/turbine.log

-log4j.appender.turbine.layout = org.apache.log4j.PatternLayout

-log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c - %m%n

-log4j.appender.turbine.append = false

-

-#

-# sql.log

-#

-log4j.appender.sql = org.apache.log4j.RollingFileAppender

-log4j.appender.sql.file = ${applicationRoot}/logs/sql.log

-log4j.appender.sql.MaxFileSize=5MB

-log4j.appender.sql.MaxBackupIndex=5

-log4j.appender.sql.layout = org.apache.log4j.PatternLayout

-log4j.appender.sql.layout.conversionPattern = %d [%t] %-5p %c - %m%n

-log4j.appender.sql.append = true

-

-#

-# console

-#

-log4j.appender.console = org.apache.log4j.ConsoleAppender

-log4j.appender.console.layout = org.apache.log4j.PatternLayout

-log4j.appender.console.layout.conversionPattern = %d [%t] %-5p %C{1} - %m%n

-

-#

-# torque.log

-#

-log4j.appender.torque = org.apache.log4j.RollingFileAppender

-log4j.appender.torque.MaxFileSize=5MB

-log4j.appender.torque.MaxBackupIndex=5

-log4j.appender.torque.file = ${applicationRoot}/logs/torque.log

-log4j.appender.torque.layout = org.apache.log4j.PatternLayout

-log4j.appender.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n

-log4j.appender.torque.append = false

-

-#

-# Velocity gets configured to write its output onto the velocity

-# category.

-#

-log4j.appender.velocity = org.apache.log4j.RollingFileAppender

-log4j.appender.velocity.MaxFileSize=5MB

-log4j.appender.velocity.MaxBackupIndex=5

-log4j.appender.velocity.file = ${applicationRoot}/logs/velocity.log

-log4j.appender.velocity.layout = org.apache.log4j.PatternLayout

-log4j.appender.velocity.layout.conversionPattern = %d [%t] %-5p %c - %m%n

-log4j.appender.velocity.append = false

diff --git a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/log4j2.xml b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/log4j2.xml
new file mode 100644
index 0000000..b77729a
--- /dev/null
+++ b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/conf/log4j2.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!-- 
+  File location: see https://logging.apache.org/log4j/2.x/manual/webapp.html 
+   ...If no location is defined Log4j will search for a file that starts with "log4j2" in the WEB-INF directory...
+   
+   Cf. https://logging.apache.org/log4j/2.x/manual/webapp.html
+   
+   web:rootDir see Web Lookup: https://logging.apache.org/log4j/2.x/manual/lookups.html
+   
+   CHANGES: moved applicationRoot to web:rootDir
+-->
+#set($dollar = '$')
+<Configuration>
+     <Appenders>
+       <Console name="console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d [%t] %-5p | %c - %m%n"/>
+      </Console>
+      <File name="app" fileName="#var('web:rootDir')/logs/application.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File>
+      <File name="avalon" fileName="#var('web:rootDir')/logs/avalon.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File>
+      <File name="scheduler" fileName="#var('web:rootDir')/logs/scheduler.log">
+         <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File>
+      <File name="torque" fileName="#var('web:rootDir')/logs/torque.log">
+         <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File>
+      <File name="sql" fileName="#var('web:rootDir')/logs/sql.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File>
+      <File name="turbine" fileName="#var('web:rootDir')/logs/turbine.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File>
+      <File name="velocity" fileName="#var('web:rootDir')/logs/velocity.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+      </File> 
+    </Appenders>
+    <Loggers>
+      <Logger name="avalon" additivity="false" level="DEBUG">
+          <appender-ref ref="avalon"/>
+      </Logger>
+      <Logger name="org.apache.torque" additivity="false" level="INFO">
+          <appender-ref ref="torque"/>
+      </Logger>
+       <Logger name="org.apache.torque.util" additivity="false" level="DEBUG">
+          <appender-ref ref="sql"/>
+          <appender-ref ref="console"/>
+      </Logger>
+      <Logger name="org.apache.turbine" additivity="false" level="INFO">
+          <appender-ref ref="turbine"/>
+      </Logger>
+      <Logger name="scheduler" additivity="false" level="INFO">
+          <appender-ref ref="scheduler"/>
+      </Logger>
+      <Logger name="velocity" additivity="false" level="INFO">
+          <appender-ref ref="velocity"/>
+      </Logger>
+      <Logger name="org.apache.${package}" additivity="false" level="DEBUG">
+          <appender-ref ref="app"/>
+      </Logger>
+      <Root level="INFO">
+          <appender-ref ref="app"/>
+          <appender-ref ref="console"/>
+      </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file
diff --git a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index 3c1b0bc..62fa581 100644
--- a/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ b/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -37,10 +37,6 @@
 			<param-value>webContext</param-value>
 		</init-param>
 		<init-param>
-			<param-name>loggingRoot</param-name>
-			<param-value>/.</param-value>
-		</init-param>
-		<init-param>
 			<param-name>properties</param-name>
 			<param-value>WEB-INF/conf/TurbineResources.properties</param-value>
 		</init-param>
diff --git a/src/main/resources/archetype-resources/src/main/webapp/logs/KEEPME b/src/main/resources/archetype-resources/src/main/webapp/logs/KEEPME
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/main/resources/archetype-resources/src/main/webapp/logs/KEEPME