You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by gk...@apache.org on 2021/07/27 15:42:29 UTC

[turbine-archetypes] branch master updated (9749f94 -> 02e1378)

This is an automated email from the ASF dual-hosted git repository.

gk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git.


    from 9749f94  fix mysql datadir, use https in maven settings, which is required in maven 3.8.1, fix docs
     new 8b0ea05  use https to enable maven 3.8.1 default requirements
     new 71b7148  set default docker turbine url
     new 8ca59fc  update documentation, add and move infos
     new 152149d  fix mysql datadir, use https in maven settings, which is required in maven 3.8.1, fix docs
     new 5e3b21d  all info in docs folder, github will find README.md automatically, more explicit schema.xml
     new 02e1378  Merge branch 'master' of https://gitbox.apache.org/repos/asf/turbine-archetypes

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md                                          |  16 ++-
 .../archetype-resources/docs/DOCKER-README.md      |  84 +++++++--------
 .../resources/archetype-resources/docs/README.md   | 118 ++++++---------------
 src/main/resources/archetype-resources/pom.xml     |   3 +-
 .../main/torque-schema/torque-security-schema.xml  |  10 +-
 5 files changed, 87 insertions(+), 144 deletions(-)

[turbine-archetypes] 05/06: all info in docs folder, github will find README.md automatically, more explicit schema.xml

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git

commit 5e3b21d39178bf2095ce8b37e771ac8d94f5f26e
Author: gemkall <ge...@fu-berlin.de>
AuthorDate: Tue Jul 27 17:37:39 2021 +0200

    all info in docs folder, github will find README.md automatically, more explicit schema.xml
---
 src/main/resources/archetype-resources/README.md   | 132 ---------------------
 .../archetype-resources/docs/DOCKER-README.md      |  70 +++++------
 .../resources/archetype-resources/docs/README.md   | 111 +++++++++--------
 .../main/torque-schema/torque-security-schema.xml  |  10 +-
 4 files changed, 85 insertions(+), 238 deletions(-)

diff --git a/src/main/resources/archetype-resources/README.md b/src/main/resources/archetype-resources/README.md
deleted file mode 100644
index a960e28..0000000
--- a/src/main/resources/archetype-resources/README.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# Quick Guide to using the new Turbine 5.1 maven archetype for skeleton application generation
-
-## About this archetype 
-
-Turbine Version: Turbine 5.1.
-
-You may skip Docker and Local Database Setup and read it later.
-
-### Docker Setup
-
-- If docker is available you could use the Docker build setup. Follow instructions here: [DOCKER README] (docs/DOCKER-README.md).
-
-#### Local Database Setup
-
-First, you should have a local database installed and configured prior to 
-beginning the application setup below.
-
-- Find more information about Logs and application structur here: [README] (docs/README.md).
-
-
-### Maven archetype 
-
-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.
-
-```sh
-mvn archetype:generate \
-  -DarchetypeGroupId=org.apache.turbine \
-  -DarchetypeArtifactId=turbine-webapp-5.1 \
-  -DarchetypeVersion=2.0.0-SNAPSHOT \
-  -DgroupId=com.mycompany.webapp \
-  -DartifactId=myhelloworld \
-  -Dversion=1.0 \
-  -Dturbine_app_name=HelloWorld \
-  -Dturbine_database_adapter=mysql \
-  -Dturbine_database_user=db_username \
-  -Dturbine_database_password=db_password \
-  -Dturbine_database_name=helloworld \
-  -Dturbine_database_timezone=UTC \
-  -Dturbine_database_url=jdbc:mysql://localhost:3306/ \
-  -Dgoals=generate-sources,integration-test
-```
-
-#### Docker integration
-
-N.B. Set docker variable to true to enable Docker setup in building the artifact: 
-
-    -Ddocker=true
-    
-to immediately enable docker setup, when generating the archetype. 
-
-Currently only port 3306 is supported, if you do not want ot change the port seetings for the db container in docker-compose.yml
-
-### Development
-
-You may use 
-
-```sh
-mvn archetype:generate -DarchetypeCatalog=local
-```
-
-to avoid declaring the *archetype* 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.1</artifactId>
-      <version>2.0.0-SNAPSHOT</version>
-      <description>This archetype sets up a web application project based on Apache Turbine 5.0</description>
-    </archetype>
-  </archetypes>
-</archetype-catalog>
-
-### Notes (local Database Setup only)
-
-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, 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.
-
-#### turbine_database_url
-
-Note that the database URL (turbine_database_url) 
-will be appended with your database name
-in the final pom.xml, so you do not need to specify that in 
-the configuration. Be sure that it ends with a slash ('/')!
-
-## Project Start and Usage
-
-Next, change into the newly generated project folder, in our case
-
-```sh
-cd myhelloworld
-```
-
-Skip next two steps, if the build was successfull.
-
-```sh
-mvn generate-sources
-```
-This will generate the OM layer and SQL code for creating the corresponding database tables.
-
-
-```sh
-mvn integration-test
-```
-This executes the SQL code to create the application schema defined  in src/main/torque-schema.
-
-You should now check the database tables and if some data is missing
-insert the sample data file in sample-mysql-data (Torque 4.0 has disabled the datasql task).
-
-```sh
-mvn clean install 
-```
-
-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 -Pjetty
-
-- Now you can launch your new Turbine application by default [http://localhost:8081/app] (check port in pom.xml, if needed).
-
-- Find more information about Logs and application structur here: [README] (docs/README.md).
diff --git a/src/main/resources/archetype-resources/docs/DOCKER-README.md b/src/main/resources/archetype-resources/docs/DOCKER-README.md
index 219c3a9..c6eea76 100644
--- a/src/main/resources/archetype-resources/docs/DOCKER-README.md
+++ b/src/main/resources/archetype-resources/docs/DOCKER-README.md
@@ -22,34 +22,23 @@ To run the build with maven do this outside of the container using following mvn
 
     mvn install -Pdocker
 
-    
-- Then check in directory  target/docker-resources the file docker-compose.yml e.g. with
-
-    docker compose config
-
-## Optional Integration Test (not tested)
-
-    mvn integration-test 
-
-N.B.: This builds the integrationtest project in target/test-classes/projects/first/project/integrationtest with docker enabled configuration. 
-Running the build inside the container is not required and may be problematic, unless you use only public available dependencies.
-
-
 # Installation (running the app)
+    
+- Change into directory target/docker-resources andf check the file docker-compose.yml, e.g. with
 
-- Change into the projects target/docker resource folder
-
-```sh
-cd  target/docker-resources
-``` 
+    cd <project>/target/docker-resources
 
-## Check Docker Compose file (optional)
+    docker compose config
+    
+- Build and start the services
 
-- Check services in docker-compose.yml (volumes) 
-``` 
-docker-compose config
-```
+    docker compose build --no-cache
+    docker compose up
+    
+First time building might take a couple of minutes. 
 
+ - Now you can launch in another termina your new Turbine application by default [http://localhost:8081/app] 
+ 
 N.B. You may use the command *docker compose* or *docker-compose*, but will slightly different results.
 
 - Check database service call in ** target/<projectname>/WEB-INF/jetty-env.xml**. It should reference the service name (db), not localhost - as it is also set in maven docker profile.
@@ -116,10 +105,7 @@ If previously build, you may want to delete all volumes (this will delete all ta
 
  - Build it
  
- 
-```sh
     docker-compose build --no-cache
-```
 
  .. optionally build it separately
     docker-compose build --no-cache --build-arg DB_CONTEXT=./docker-resources/db db
@@ -135,14 +121,13 @@ It is a dependency for the service app (see app/Dockerfile).
 ### Starting Services
 
 Start both services in one step
-``` 
-docker-compose up
-```    
+
+    docker-compose up
+   
 .. or doing it in background, requires second start command
-``` 
-docker-compose -d up
-docker-compose start
-``` 
+
+    docker-compose -d up
+    docker-compose start
 
 This will start first the db service, then the app service. Jetty is run exposing the webapp to **http://localhost:8081/app**.
 By default remote debugging is activated (port 9000), which could be removed/commented in docker-compose.yml.
@@ -160,9 +145,8 @@ docker-compose run --rm db /bin/sh
 ``` 
 Extract data in db service
 
-```sh
- mysql -u root -h db -P 3306 -p
-```
+    mysql -u root -h db -P 3306 -p
+    
 .. or 
 
     docker-compose exec db mysql -u root --password=... -e "show databases;" --build-arg DB_CONTEXT=./docker-resources/db
@@ -171,13 +155,13 @@ Extract data in db service
 ### App Service
 
 This will start app and db (as it depends on app):
-```sh
-docker-compose run --rm app /bin/sh 
-``` 
+
+    docker-compose run --rm app /bin/sh 
+
 In the container, check:
-```sh
-ls -la /myapp // should list pom.xml ...
-```
+
+    ls -la /myapp // should list pom.xml ...
+
 
 # System Specific Informations
 
@@ -219,7 +203,7 @@ Error starting userland proxy: mkdir /port/tcp:0.0.0.0:13306:tcp:...:3306: input
 
 ### Still more docker commands ...
 
-  docker ps  
+  docker volume inspect <containerid>  
  
   // delete intermediate images, volumes
   docker rmi $(docker images --filter "dangling=true" -q)
diff --git a/src/main/resources/archetype-resources/docs/README.md b/src/main/resources/archetype-resources/docs/README.md
index b26b963..a1855da 100644
--- a/src/main/resources/archetype-resources/docs/README.md
+++ b/src/main/resources/archetype-resources/docs/README.md
@@ -1,36 +1,39 @@
-#*
-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.
-*#
- 
-
 # Quick Guide to using the new Turbine 5.1 maven archetype for skeleton application generation
 
+Maven Archetype to generate a webapp utilizing Turbine 5.x
+
+## Getting Started
+
+These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
+
+### Prerequisites
+
+* Java 8 JDK or later 
+* [MySQL](https://www.mysql.com/) - Database Server or [Docker] (https://docs.docker.com/get-docker/)
+* [Maven](https://maven.apache.org/) - Dependency Management
+
+You should have Java 8 or later installed.  The archetype sets up a new application using MySQL as the default database store.  However, you can adjust this to use any database supported by Apache Torque 5.x. If not using Docker, you should therefore be at least have a database instance where you have access rights to create a new database schema and populate it with the tables the application generates.  Finally, this is a maven archetype, so of course you should install a local version [...]
 
 ## About this archetype 
 
-Turbine Version: Turbine 5.1.
+Turbine Version: Turbine 5.1 Turbine-webapp-5.x
 
-Follow either Local database Setup or Docker Setup
+### Integration Test (if you checked out this Archetype Generate Repository)
 
-### Local database Setup
+    mvn integration-test 
+
+N.B.: This builds an integrationtest project in target/test-classes/projects/first/project/integrationtest (if you provide -Ddocker=true with docker enabled configuration, otherwise you need a hosted mysql database). You could start testing this archetype here..
+
+- Follow either Local database Setup or Docker Setup
+
+### Docker Setup
+
+- If docker is available you could use the Docker build setup. Follow instructions here: [DOCKER README] (DOCKER-README.md).
+
+### Local Database Setup
 
 First, you should have a local database installed and configured prior to 
-beginning the application setup.
+beginning the application setup below.
 
 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
 
@@ -40,46 +43,39 @@ mysql> \q
 
 or other tools. The database should have been started and the database user granted enough rights.
 
+### Maven archetype 
+
+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.
 
-### Docker integration (short intro)
+```sh
+mvn archetype:generate \
+  -DarchetypeGroupId=org.apache.turbine \
+  -DarchetypeArtifactId=turbine-webapp-5.1 \
+  -DarchetypeVersion=2.0.0-SNAPSHOT \
+  -DgroupId=com.mycompany.webapp \
+  -DartifactId=myhelloworld \
+  -Dversion=1.0 \
+  -Dturbine_app_name=HelloWorld \
+  -Dturbine_database_adapter=mysql \
+  -Dturbine_database_user=db_username \
+  -Dturbine_database_password=db_password \
+  -Dturbine_database_name=helloworld \
+  -Dturbine_database_timezone=UTC \
+  -Dturbine_database_url=jdbc:mysql://localhost:3306/ \
+  -Dgoals=generate-sources,integration-test
+```
 
-Run this command
+#### Docker integration
 
-    mvn clean install -Pdocker
+N.B. Set docker variable to true to enable Docker setup in building the artifact: 
 
+    -Ddocker=true
     
 to immediately enable docker setup, when generating the archetype. 
 
 Currently only port 3306 is supported, if you do not want ot change the port seetings for the db container in docker-compose.yml
-
-You then should change to the generated docker resources: 
-
-    cd <project>/target/docker-resources
-    
-and follow the instructions in [DOCKER README] (docs/DOCKER-README.md). In short you may do the following (you may have to start docker desktop on windows):
- 
-    docker compose configurable
-    docker compose build --no-cache
-    docker compose up
-    
- - First time Building might take a couple of minutes. 
-    
- - Now you can launch your new Turbine application by default [http://localhost:8081/app] 
- 
-
-- Read [DOCKER README] (DOCKER-README.md).
- 
-You then need not to follow the following chapters, but could immediately go to 
-
-    cd <project>/target/docker-resources
-    
-and then follow the instructions in DOCKER-README.md. In short you may do the following:
- 
-    docker compose configurable
-    docker compose build --no-cache
-    docker compose up
-    
- - Now you can launch your new Turbine application by default [http://localhost:8081/app] 
  
 
 ## Project Start and Usage
@@ -145,8 +141,7 @@ If running from integration test, check/update
 - target/test-classes/projects/first/project/integrationtest/src/test/conf/torque/TorqueTest.properties or
   META-INF/maven/archetype-metadata.xml
 
-The security test is by default skipped as it requires a running mysql. It tests many of the Fulcrum Torque Turbine security aspects, 
-activate it by calling
+The security test is by default skipped as it requires a running mysql. It tests many of the Fulcrum Torque Turbine security aspects, you may activate it by calling
 
 ```sh
 mvn test -DskipTests=false
diff --git a/src/main/resources/archetype-resources/src/main/torque-schema/torque-security-schema.xml b/src/main/resources/archetype-resources/src/main/torque-schema/torque-security-schema.xml
index 41d6802..2b26cb2 100644
--- a/src/main/resources/archetype-resources/src/main/torque-schema/torque-security-schema.xml
+++ b/src/main/resources/archetype-resources/src/main/torque-schema/torque-security-schema.xml
@@ -80,8 +80,8 @@
 
   <table name="TURBINE_ROLE_PERMISSION" 
    interface="org.apache.fulcrum.security.torque.peer.TurbineRolePermissionPeerMapper">
-    <column name="ROLE_ID" required="true" primaryKey="true" type="INTEGER"/>
-    <column name="PERMISSION_ID" required="true" primaryKey="true" type="INTEGER"/>
+    <column name="ROLE_ID" required="true" primaryKey="true" type="INTEGER" javaType="primitive"/>
+    <column name="PERMISSION_ID" required="true" primaryKey="true" type="INTEGER" javaType="primitive"/>
 
     <!-- Turbine service revokeAll(role) manages removal, but you might want to handle it just with onDelete="cascade" -->
     <foreign-key foreignTable="TURBINE_ROLE">
@@ -119,9 +119,9 @@
   <table name="TURBINE_USER_GROUP_ROLE" 
   interface="org.apache.fulcrum.security.torque.peer.TurbineUserGroupRoleModelPeerMapper"
   peerInterface="org.apache.fulcrum.security.torque.peer.TorqueTurbineUserGroupRolePeer">
-    <column name="USER_ID" required="true" primaryKey="true" type="INTEGER"/>
-    <column name="GROUP_ID" required="true" primaryKey="true" type="INTEGER"/>
-    <column name="ROLE_ID" required="true" primaryKey="true" type="INTEGER"/>
+    <column name="USER_ID" required="true" primaryKey="true" type="INTEGER" javaType="primitive"/>
+    <column name="GROUP_ID" required="true" primaryKey="true" type="INTEGER" javaType="primitive"/>
+    <column name="ROLE_ID" required="true" primaryKey="true" type="INTEGER" javaType="primitive"/>
     <!-- Turbine service revokeAll(user) manages removal, but you might want to handle it just with onDelete="cascade" -->
     <foreign-key foreignTable="TURBINE_USER">
       <reference local="USER_ID" foreign="USER_ID"/>

[turbine-archetypes] 01/06: use https to enable maven 3.8.1 default requirements

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git

commit 8b0ea05e0e5d51665227bc4c417cbfd983d8e6f8
Author: gemkall <ge...@fu-berlin.de>
AuthorDate: Tue Jul 27 11:59:07 2021 +0200

    use https to enable maven 3.8.1 default requirements
---
 .../src/main/docker-resources/app/settings.xml                 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/archetype-resources/src/main/docker-resources/app/settings.xml b/src/main/resources/archetype-resources/src/main/docker-resources/app/settings.xml
index c7d36af..1e1a7d2 100644
--- a/src/main/resources/archetype-resources/src/main/docker-resources/app/settings.xml
+++ b/src/main/resources/archetype-resources/src/main/docker-resources/app/settings.xml
@@ -19,7 +19,7 @@
       <repositories>
         <repository>
           <id>releases</id>
-          <url>http://central</url>
+          <url>https://central</url>
           <releases><enabled>true</enabled></releases>
           <snapshots><enabled>false</enabled></snapshots>
         </repository>
@@ -27,13 +27,13 @@
           <releases><enabled>true</enabled></releases>
           <snapshots><enabled>true</enabled></snapshots>
           <id>snapshots</id>
-          <url>http://snapshots</url>
+          <url>https://snapshots</url>
         </repository>
       </repositories>
      <pluginRepositories>
         <pluginRepository>
           <id>releases</id>
-          <url>http://central</url>
+          <url>https://central</url>
           <releases><enabled>true</enabled></releases>
           <snapshots><enabled>true</enabled></snapshots>
         </pluginRepository>
@@ -41,7 +41,7 @@
          <releases><enabled>true</enabled></releases>
           <snapshots><enabled>true</enabled></snapshots>
           <id>snapshots</id>
-          <url>http://snapshots</url>
+          <url>https://snapshots</url>
         </pluginRepository>
       </pluginRepositories>
     </profile>
@@ -54,7 +54,7 @@
         <pluginRepository>
           <id>central</id>
           <name>Maven Plugin Repository</name>
-          <url>http://repo1.maven.org/maven2</url>
+          <url>https://repo1.maven.org/maven2</url>
           <layout>default</layout>
           <snapshots>
             <enabled>false</enabled>

[turbine-archetypes] 03/06: update documentation, add and move infos

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git

commit 8ca59fcb6a238f37af9b664bf5e75eb3e1e88a7d
Author: gemkall <ge...@fu-berlin.de>
AuthorDate: Tue Jul 27 12:00:56 2021 +0200

    update documentation, add and move infos
---
 README.md                                          |  16 ++-
 src/main/resources/archetype-resources/README.md   | 132 +++++++++++++++++++++
 .../archetype-resources/docs/DOCKER-README.md      |  14 ++-
 .../resources/archetype-resources/docs/README.md   | 105 +++++-----------
 4 files changed, 181 insertions(+), 86 deletions(-)

diff --git a/README.md b/README.md
index d05d8bc..7580d3e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# turbine-webapp-5.0
+# turbine-webapp-5.x
 
-Maven Archetype to generate a webapp utilizing Turbine 5.0
+Maven Archetype to generate a webapp utilizing Turbine 5.x
 
 ## Getting Started
 
@@ -9,22 +9,28 @@ These instructions will get you a copy of the project up and running on your loc
 ### Prerequisites
 
 * Java 8 JDK or later 
-* [MySQl](https://www.mysql.com/) - Database Server
+* [MySQL](https://www.mysql.com/) - Database Server or [Docker] (https://docs.docker.com/get-docker/)
 * [Maven](https://maven.apache.org/) - Dependency Management
 
-You should have Java 8 or later installed.  The archetype sets up a new application using MySQL as the default database store.  However, you can adjust this to use any database supported by Apache Torque 4.0. Therefore, you should be at least have a database instance where you have access rights to create a new database schema and populate it with the tables the application generates.  Finally, this is a maven archetype, so of course you should install a local version of Maven (tested wi [...]
+You should have Java 8 or later installed.  The archetype sets up a new application using MySQL as the default database store.  However, you can adjust this to use any database supported by Apache Torque 5.x. If not using Docker, you should therefore be at least have a database instance where you have access rights to create a new database schema and populate it with the tables the application generates.  Finally, this is a maven archetype, so of course you should install a local version [...]
 
 
 ### Installing
 
 Eclipse integration:
 
-You need to first add the Apache maven archetypes to your IDE so that you can take advantage of using the turbine-webapp-5.0 plugin to generate a new web application.
+You need to first add the Apache maven archetypes to your IDE so that you can take advantage of using the turbine-webapp-5.x plugin to generate a new web application.
 
 The location of the remote catalog file is: http://repo.maven.apache.org/maven2/archetype-catalog.xml 
 
 Step-by-step instructions on how to accomplish this can be found here: https://howtodoinjava.com/eclipse/how-to-import-maven-remote-archetype-catalogs-in-eclipse/
 
+Follow further instructions here: [README] (src/main/resources/archetype-resources/README.md).
+
+#### Development
+
+Clone this repository and build it with maven. 
+
 
 ## Built With
 
diff --git a/src/main/resources/archetype-resources/README.md b/src/main/resources/archetype-resources/README.md
new file mode 100644
index 0000000..a960e28
--- /dev/null
+++ b/src/main/resources/archetype-resources/README.md
@@ -0,0 +1,132 @@
+# Quick Guide to using the new Turbine 5.1 maven archetype for skeleton application generation
+
+## About this archetype 
+
+Turbine Version: Turbine 5.1.
+
+You may skip Docker and Local Database Setup and read it later.
+
+### Docker Setup
+
+- If docker is available you could use the Docker build setup. Follow instructions here: [DOCKER README] (docs/DOCKER-README.md).
+
+#### Local Database Setup
+
+First, you should have a local database installed and configured prior to 
+beginning the application setup below.
+
+- Find more information about Logs and application structur here: [README] (docs/README.md).
+
+
+### Maven archetype 
+
+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.
+
+```sh
+mvn archetype:generate \
+  -DarchetypeGroupId=org.apache.turbine \
+  -DarchetypeArtifactId=turbine-webapp-5.1 \
+  -DarchetypeVersion=2.0.0-SNAPSHOT \
+  -DgroupId=com.mycompany.webapp \
+  -DartifactId=myhelloworld \
+  -Dversion=1.0 \
+  -Dturbine_app_name=HelloWorld \
+  -Dturbine_database_adapter=mysql \
+  -Dturbine_database_user=db_username \
+  -Dturbine_database_password=db_password \
+  -Dturbine_database_name=helloworld \
+  -Dturbine_database_timezone=UTC \
+  -Dturbine_database_url=jdbc:mysql://localhost:3306/ \
+  -Dgoals=generate-sources,integration-test
+```
+
+#### Docker integration
+
+N.B. Set docker variable to true to enable Docker setup in building the artifact: 
+
+    -Ddocker=true
+    
+to immediately enable docker setup, when generating the archetype. 
+
+Currently only port 3306 is supported, if you do not want ot change the port seetings for the db container in docker-compose.yml
+
+### Development
+
+You may use 
+
+```sh
+mvn archetype:generate -DarchetypeCatalog=local
+```
+
+to avoid declaring the *archetype* 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.1</artifactId>
+      <version>2.0.0-SNAPSHOT</version>
+      <description>This archetype sets up a web application project based on Apache Turbine 5.0</description>
+    </archetype>
+  </archetypes>
+</archetype-catalog>
+
+### Notes (local Database Setup only)
+
+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, 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.
+
+#### turbine_database_url
+
+Note that the database URL (turbine_database_url) 
+will be appended with your database name
+in the final pom.xml, so you do not need to specify that in 
+the configuration. Be sure that it ends with a slash ('/')!
+
+## Project Start and Usage
+
+Next, change into the newly generated project folder, in our case
+
+```sh
+cd myhelloworld
+```
+
+Skip next two steps, if the build was successfull.
+
+```sh
+mvn generate-sources
+```
+This will generate the OM layer and SQL code for creating the corresponding database tables.
+
+
+```sh
+mvn integration-test
+```
+This executes the SQL code to create the application schema defined  in src/main/torque-schema.
+
+You should now check the database tables and if some data is missing
+insert the sample data file in sample-mysql-data (Torque 4.0 has disabled the datasql task).
+
+```sh
+mvn clean install 
+```
+
+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 -Pjetty
+
+- Now you can launch your new Turbine application by default [http://localhost:8081/app] (check port in pom.xml, if needed).
+
+- Find more information about Logs and application structur here: [README] (docs/README.md).
diff --git a/src/main/resources/archetype-resources/docs/DOCKER-README.md b/src/main/resources/archetype-resources/docs/DOCKER-README.md
index b6be1e2..f5e2b4e 100644
--- a/src/main/resources/archetype-resources/docs/DOCKER-README.md
+++ b/src/main/resources/archetype-resources/docs/DOCKER-README.md
@@ -59,16 +59,17 @@ N.B. You may use the command *docker compose* or *docker-compose*, but will slig
 <Set name="url">jdbc:mysql://db:3306/turbine</Set>
 ```
 
-
 - To change velocity templates check webapp in ** src/main/webapp**.  Ohter resources might depend on https://www.eclipse.org/jetty/documentation/jetty-9/index.html#jars-scanned-for-annotations.
 
-## Cleanup or restart (optional)
+## Start, cleanup or restart 
 
-- Optionally Check system or cleanup, e.g. with docker-compose down, docker-compose down -v or docker sytem prune (removes any container on system).
+- Optionally check system or cleanup, e.g. with docker-compose down, docker-compose down -v or docker sytem prune (removes any container on system).
 
 - If services are already installed, activate/start by 
     docker-compose up
     
+You might do it separately for the db and the app service. The latter will start a maven build process finally starting the jetty server. Maven depends on the Maven settings, which are set in docker-resources/app/settings.xml. The local maven repository is mapped in the docker-compose.yml final to the host's local repository settings.localRepository during the first build, which reads the host's environment. Be sure to check this, if compilation errors occur as the host's maven executabl [...]
+    
  Example Logs:
   
     [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.25-1debian10 started.
@@ -97,8 +98,7 @@ N.B. You may use the command *docker compose* or *docker-compose*, but will slig
     [INFO] --- torque-maven-plugin:5.1-SNAPSHOT:generate (torque-om) @ integrationtest ---
     [main] INFO | org.apache.torque.generator.control.Controller - readConfiguration() : Starting to read configuration files
 
-
-- Starting the app service will build the app and start jetty with Maven on port 8081. 
+- Starting the app service will build the app and start jetty with Maven on port 8081 by default. 
 This command is set as a **command** in the app service in docker compose. 
 
 Currently the docker-compose is generated once more, if starting the containers, this will overwrite m2repo and may result in errors.
@@ -235,3 +235,7 @@ Error starting userland proxy: mkdir /port/tcp:0.0.0.0:13306:tcp:...:3306: input
   
   # stops all running containers  
   docker stop $(docker ps -a -q)
+  
+## License
+
+This project is licensed under the Apache Software License 2.0
diff --git a/src/main/resources/archetype-resources/docs/README.md b/src/main/resources/archetype-resources/docs/README.md
index 6e7674b..b26b963 100644
--- a/src/main/resources/archetype-resources/docs/README.md
+++ b/src/main/resources/archetype-resources/docs/README.md
@@ -21,19 +21,16 @@ under the License.
 # Quick Guide to using the new Turbine 5.1 maven archetype for skeleton application generation
 
 
-
 ## About this archetype 
 
 Turbine Version: Turbine 5.1.
 
-### Docker Setup
-
-Skip Local Database setup and read later DOCKER-README.md
+Follow either Local database Setup or Docker Setup
 
 ### Local database Setup
 
 First, you should have a local database installed and configured prior to 
-beginning the application setup below.
+beginning the application setup.
 
 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
 
@@ -43,40 +40,34 @@ mysql> \q
 
 or other tools. The database should have been started and the database user granted enough rights.
 
-### Maven archetype 
-
-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.
 
-```sh
-mvn archetype:generate \
-  -DarchetypeGroupId=org.apache.turbine \
-  -DarchetypeArtifactId=turbine-webapp-5.1 \
-  -DarchetypeVersion=2.0.0-SNAPSHOT \
-  -DgroupId=com.mycompany.webapp \
-  -DartifactId=myhelloworld \
-  -Dversion=1.0 \
-  -Dturbine_app_name=HelloWorld \
-  -Dturbine_database_adapter=mysql \
-  -Dturbine_database_user=db_username \
-  -Dturbine_database_password=db_password \
-  -Dturbine_database_name=helloworld \
-  -Dturbine_database_timezone=UTC \
-  -Dturbine_database_url=jdbc:mysql://localhost:3306/ \
-  -Dgoals=generate-sources,integration-test
-```
+### Docker integration (short intro)
 
-#### Docker integration (short intro)
+Run this command
 
-N.B. Change dabase url to use service id and set docker environment to true: 
+    mvn clean install -Pdocker
 
-    -Dturbine_database_url=jdbc:mysql://db:3306/ \
-    -Ddocker=true
     
 to immediately enable docker setup, when generating the archetype. 
 
 Currently only port 3306 is supported, if you do not want ot change the port seetings for the db container in docker-compose.yml
+
+You then should change to the generated docker resources: 
+
+    cd <project>/target/docker-resources
+    
+and follow the instructions in [DOCKER README] (docs/DOCKER-README.md). In short you may do the following (you may have to start docker desktop on windows):
+ 
+    docker compose configurable
+    docker compose build --no-cache
+    docker compose up
+    
+ - First time Building might take a couple of minutes. 
+    
+ - Now you can launch your new Turbine application by default [http://localhost:8081/app] 
+ 
+
+- Read [DOCKER README] (DOCKER-README.md).
  
 You then need not to follow the following chapters, but could immediately go to 
 
@@ -91,48 +82,6 @@ and then follow the instructions in DOCKER-README.md. In short you may do the fo
  - Now you can launch your new Turbine application by default [http://localhost:8081/app] 
  
 
-### Development
-
-You may use 
-
-```sh
-mvn archetype:generate -DarchetypeCatalog=local
-```
-
-to avoid declaring the *archetype* 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.1</artifactId>
-      <version>2.0.0-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,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, 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.
-
-#### turbine_database_url
-
-Note that the database URL (turbine_database_url) 
-will be appended with your database name
-in the final pom.xml, so you do not need to specify that in 
-the configuration.
-
 ## Project Start and Usage
 
 Next, change into the newly generated project folder, in our case
@@ -238,11 +187,15 @@ before running the jetty server.
 
 Be aware of settings and some smaller restrictions, which mostly will be fixed in the upcoming releases.
 
-- Keep groups/roles lower case (which should be fixed in Fulcrum Security 1.1.1/Turbine 4.0)
+- Keep groups/roles lower case (which should be fixed in current Fulcrum Security 2.x/Turbine 5.x)
 - abstract classes and managers are included (because of some minor bugs in Fulcrum Security 1.1.0, same as above)
-- LogoutUser action is included (fix in Turbine 4.0, getUserFromSession)
+- LogoutUser action is included as an custom example 
 - LoginUser action is included (to check for anonymous user, may be fixed in future release)
 - OM (Torque Object Mapper) stub classes are included (until configurable in schema with Torque version 2.1)
-- TurbineConfiguration returns a Commons configuration object, even if field is not assignable (will be fixed in Turbine 4.0, you can then assign e.g. to String instead, cft. SecureScreen)
+- TurbineConfiguration returns a Commons configuration object, even if field is not assignable (fixed in Turbine 5.x, you can then assign e.g. to String instead, cft. SecureScreen)
 - Database connection is done initially by default with JNDI. If you want to change it, check Torque.properties and (1) for Tomcat, META-INF/context.xml or (2) for Jetty, WEB-INF/jetty-env.xml.  
 
+## License
+
+This project is licensed under the Apache Software License 2.0
+

[turbine-archetypes] 02/06: set default docker turbine url

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git

commit 71b71483466c1734c9318117cb61e666aacc881a
Author: gemkall <ge...@fu-berlin.de>
AuthorDate: Tue Jul 27 12:00:17 2021 +0200

    set default docker turbine url
---
 src/main/resources/archetype-resources/pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml
index 4a79ce1..0e2d8d5 100644
--- a/src/main/resources/archetype-resources/pom.xml
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -494,7 +494,8 @@ under the License.
                  </plugins>
               </build>
             <properties>
-                <turbine_database_url>${turbine_database_url}</turbine_database_url>
+                <!-- hard code docker compose service id and port by default -->
+                <turbine_database_url>jdbc:mysql://db:3306/</turbine_database_url>
                 <!-- read from #var("settings.localRepository") to provide e.g. local snapshot builds -->
                 <app_volume_local_repo>${settings.localRepository}</app_volume_local_repo>
                 <docker>true</docker>

[turbine-archetypes] 06/06: Merge branch 'master' of https://gitbox.apache.org/repos/asf/turbine-archetypes

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git

commit 02e13786beb9c15ac0a93db7dd1ae6645fadd027
Merge: 5e3b21d 9749f94
Author: gemkall <ge...@fu-berlin.de>
AuthorDate: Tue Jul 27 17:42:11 2021 +0200

    Merge branch 'master' of https://gitbox.apache.org/repos/asf/turbine-archetypes


[turbine-archetypes] 04/06: fix mysql datadir, use https in maven settings, which is required in maven 3.8.1, fix docs

Posted by gk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git

commit 152149d22c4b89e6887577142018fa47ea0fe369
Author: gemkall <ge...@fu-berlin.de>
AuthorDate: Tue Jul 27 17:06:37 2021 +0200

    fix mysql datadir, use https in maven settings, which is required in maven 3.8.1, fix docs
---
 src/main/resources/archetype-resources/docs/DOCKER-README.md     | 8 +++-----
 .../src/main/docker-resources/db/mysql/conf/my.cnf               | 9 +++------
 .../src/main/docker-resources/docker-compose.yml                 | 1 +
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/main/resources/archetype-resources/docs/DOCKER-README.md b/src/main/resources/archetype-resources/docs/DOCKER-README.md
index f5e2b4e..219c3a9 100644
--- a/src/main/resources/archetype-resources/docs/DOCKER-README.md
+++ b/src/main/resources/archetype-resources/docs/DOCKER-README.md
@@ -110,7 +110,7 @@ If not yet done, build on the host with mvn clean install -f ../pom.xml -Pdocker
 The app service uses later a volume, which maps to the local maven repository, which you may need/not need.
 The db service uses mysql-latest (currently 8.x), you may replace it with a fixed release tag.
 
-If previously build, you may want to delete all volumes and containers
+If previously build, you may want to delete all volumes (this will delete all tables in /var/lib/mysql) and containers
 
     docker-compose down -v
 
@@ -156,7 +156,7 @@ You could follow the logs with docker-compose logs -f app or docker-compose logs
 
 ### Db Service 
 ``` 
-docker-compose run --rm db /bin/sh --build-arg DB_CONTEXT=./docker-resources/db
+docker-compose run --rm db /bin/sh 
 ``` 
 Extract data in db service
 
@@ -185,9 +185,7 @@ ls -la /myapp // should list pom.xml ...
 
 ### Powershell
 
-- Use Powershell
-
-- Replace in volume mapping for host repo path (maven localRepository) backslashes with slashes "/" in docker-compose.yml.
+- You may have to replace in volume mapping for host repo path (maven localRepository) backslashes with slashes "/" in docker-compose.yml.
 
 - check COMPOSE_CONVERT_WINDOWS_PATHS, https://docs.docker.com/compose/reference/envvars/#compose_convert_windows_paths
 
diff --git a/src/main/resources/archetype-resources/src/main/docker-resources/db/mysql/conf/my.cnf b/src/main/resources/archetype-resources/src/main/docker-resources/db/mysql/conf/my.cnf
index 940f84b..6eca3ac 100644
--- a/src/main/resources/archetype-resources/src/main/docker-resources/db/mysql/conf/my.cnf
+++ b/src/main/resources/archetype-resources/src/main/docker-resources/db/mysql/conf/my.cnf
@@ -6,17 +6,14 @@
 #
 # * Basic Settings
 #
-#user            = mysql
-#pid-file        = /var/run/mysqld/mysqld.pid
-#socket          = /var/run/mysqld/mysqld.sock
 
 character-set-server=utf8
 
 # in mysql image VOLUME /var/lib/mysql and any changes to this directory 
 # during build process might got lost after the build step is done 
 # match db_data in docker-compose
-
-datadir     = /initialized-db
+# therefore we us a copy in Dockerfile, no uncomment needed
+# datadir     = /initialized-db
 
 #tmpdir          = /tmp
 
@@ -29,6 +26,6 @@ datadir     = /initialized-db
 tee=/mysql/log/log.out
 
 [mysqld_safe]
-#socket          = /var/run/mysqld/mysqld.sock
+
 nice            = 0
 
diff --git a/src/main/resources/archetype-resources/src/main/docker-resources/docker-compose.yml b/src/main/resources/archetype-resources/src/main/docker-resources/docker-compose.yml
index 34b93ec..026a5de 100644
--- a/src/main/resources/archetype-resources/src/main/docker-resources/docker-compose.yml
+++ b/src/main/resources/archetype-resources/src/main/docker-resources/docker-compose.yml
@@ -67,6 +67,7 @@ services:
     #command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci]
     command: --default-authentication-plugin=mysql_native_password
 
+ # this might work only for *nix, check with docker image inspect db
 volumes:
   db_data_${turbine_database_name}: