You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/06/29 01:34:41 UTC

[james-project] branch master updated (8a827e7 -> 277f514)

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

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from 8a827e7  JAMES-3516 Add threadId to ComposedMessageIdWithMetaData
     new ef1f2f4  JAMES-3621 Reindent plugin
     new 138580f  JAMES-3621 Move JPA-SMTP mariaDB tests to main JPA-SMTP package
     new df635a2  JAMES-3261 Enable webAdmin for JPA-SMTP app
     new 190e65a  JAMES-3261 JPA-SMTP app: add missing loagback declarations
     new d1a4e30  JAMES-2418 Length in JPAUrl caused mariaDB driver to complain...
     new 1b0ea1a  JAMES-3261 JPA-SMTP app: remove cassandra logger in logback declarations
     new 1ad46c0  JAMES-3261 JPA-SMTP app: docker-compose to connect to MariaDB
     new 25ccf64  JAMES-3261 JPA app should also embed a MariaDB example
     new 277f514  JAMES-3261 Get rid of no longer needed jpa-smtp-common maven module in server/container/guice

The 9 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:
 server/apps/jpa-app/README.adoc                    |  26 +++-
 server/apps/jpa-app/docker-compose.yml             |  28 ++++
 .../james-database-mariadb.properties}             |  12 +-
 server/apps/jpa-smtp-app/README.adoc               |  26 +++-
 server/apps/jpa-smtp-app/docker-compose.yml        |  28 ++++
 server/apps/jpa-smtp-app/pom.xml                   | 108 +++++++++++---
 .../james-database-mariadb.properties}             |  12 +-
 .../jpa-smtp-app/sample-configuration/logback.xml  |   1 -
 .../sample-configuration/webadmin.properties       |   0
 .../java/org/apache/james/JPAJamesServerMain.java  |   0
 .../src/main/resources/META-INF/persistence.xml    |   8 +-
 .../src/main/resources/defaultMailetContainer.xml  |   0
 .../james/mariadb/JPAMariaDBJamesServerTest.java}  |   8 +-
 .../TestJPAMariaDBConfigurationModule.java}        |   6 +-
 server/apps/jpa-smtp-mariadb-app/pom.xml           | 156 ---------------------
 .../sample-configuration/dnsservice.xml            |  25 ----
 .../sample-configuration/domainlist.xml            |  25 ----
 .../sample-configuration/mailetcontainer.xml       | 105 --------------
 .../sample-configuration/mailrepositorystore.xml   |  34 -----
 .../sample-configuration/recipientrewritetable.xml |  27 ----
 .../sample-configuration/smtpserver.xml            | 105 --------------
 .../sample-configuration/usersrepository.xml       |  27 ----
 .../sample-configuration/webadmin.properties       |  23 ---
 .../src/test/resources/dnsservice.xml              |  25 ----
 .../src/test/resources/domainlist.xml              |  24 ----
 .../src/test/resources/fakemailrepositorystore.xml |  31 ----
 .../src/test/resources/keystore                    | Bin 2245 -> 0 bytes
 .../src/test/resources/mailetcontainer.xml         | 120 ----------------
 .../src/test/resources/mailrepositorystore.xml     |  31 ----
 .../src/test/resources/smtpserver.xml              | 102 --------------
 server/container/guice/jpa-smtp-common/pom.xml     |  88 ------------
 .../jpa-smtp-common/src/main/resources/logback.xml |  22 ---
 server/container/guice/pom.xml                     |   6 -
 .../apache/james/mailrepository/jpa/JPAUrl.java    |   2 +-
 server/pom.xml                                     |   1 -
 35 files changed, 214 insertions(+), 1028 deletions(-)
 create mode 100644 server/apps/jpa-app/docker-compose.yml
 copy server/apps/{jpa-smtp-mariadb-app/sample-configuration/james-database.properties => jpa-app/sample-configuration/james-database-mariadb.properties} (84%)
 create mode 100644 server/apps/jpa-smtp-app/docker-compose.yml
 rename server/apps/{jpa-smtp-mariadb-app/sample-configuration/james-database.properties => jpa-smtp-app/sample-configuration/james-database-mariadb.properties} (84%)
 copy server/apps/{jpa-app => jpa-smtp-app}/sample-configuration/webadmin.properties (100%)
 rename server/{container/guice/jpa-smtp-common => apps/jpa-smtp-app}/src/main/java/org/apache/james/JPAJamesServerMain.java (100%)
 rename server/{container/guice/jpa-smtp-common => apps/jpa-smtp-app}/src/main/resources/META-INF/persistence.xml (87%)
 rename server/{container/guice/jpa-smtp-common => apps/jpa-smtp-app}/src/main/resources/defaultMailetContainer.xml (100%)
 rename server/apps/{jpa-smtp-mariadb-app/src/test/java/org/apache/james/JPAJamesServerTest.java => jpa-smtp-app/src/test/java/org/apache/james/mariadb/JPAMariaDBJamesServerTest.java} (93%)
 rename server/apps/{jpa-smtp-mariadb-app/src/test/java/org/apache/james/TestJPAConfigurationModule.java => jpa-smtp-app/src/test/java/org/apache/james/mariadb/TestJPAMariaDBConfigurationModule.java} (92%)
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/pom.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/dnsservice.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/domainlist.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/mailetcontainer.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/mailrepositorystore.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/recipientrewritetable.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/smtpserver.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/usersrepository.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/sample-configuration/webadmin.properties
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/dnsservice.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/domainlist.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/fakemailrepositorystore.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/keystore
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/mailetcontainer.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/mailrepositorystore.xml
 delete mode 100644 server/apps/jpa-smtp-mariadb-app/src/test/resources/smtpserver.xml
 delete mode 100644 server/container/guice/jpa-smtp-common/pom.xml
 delete mode 100644 server/container/guice/jpa-smtp-common/src/main/resources/logback.xml

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 01/09: JAMES-3621 Reindent plugin

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit ef1f2f4209589a1f81b6cef9c4de1165abcaaba6
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 13:13:03 2021 +0700

    JAMES-3621 Reindent plugin
---
 server/apps/jpa-smtp-app/pom.xml | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/server/apps/jpa-smtp-app/pom.xml b/server/apps/jpa-smtp-app/pom.xml
index 126f911..94e94b9 100644
--- a/server/apps/jpa-smtp-app/pom.xml
+++ b/server/apps/jpa-smtp-app/pom.xml
@@ -120,25 +120,26 @@
     </dependencies>
 
     <build>
-        <plugins>           <plugin>
-            <groupId>com.googlecode.maven-download-plugin</groupId>
-            <artifactId>download-maven-plugin</artifactId>
-            <executions>
-                <execution>
-                    <id>install-glowroot</id>
-                    <goals>
-                        <goal>wget</goal>
-                    </goals>
-                    <phase>package</phase>
-                    <configuration>
-                        <url>https://github.com/glowroot/glowroot/releases/download/v0.13.6/glowroot-0.13.6-dist.zip</url>
-                        <unpack>true</unpack>
-                        <outputDirectory>${project.build.directory}</outputDirectory>
-                        <md5>f9026dbab1fbade067ca549913802fcc</md5>
-                    </configuration>
-                </execution>
-            </executions>
-        </plugin>
+        <plugins>
+            <plugin>
+                <groupId>com.googlecode.maven-download-plugin</groupId>
+                <artifactId>download-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>install-glowroot</id>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <url>https://github.com/glowroot/glowroot/releases/download/v0.13.6/glowroot-0.13.6-dist.zip</url>
+                            <unpack>true</unpack>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <md5>f9026dbab1fbade067ca549913802fcc</md5>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 04/09: JAMES-3261 JPA-SMTP app: add missing loagback declarations

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 190e65aeadd650d48a1925a31d8b4e74d5048f2a
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 14:04:57 2021 +0700

    JAMES-3261 JPA-SMTP app: add missing loagback declarations
---
 server/apps/jpa-smtp-app/pom.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/server/apps/jpa-smtp-app/pom.xml b/server/apps/jpa-smtp-app/pom.xml
index 8b988bc..4ea814d 100644
--- a/server/apps/jpa-smtp-app/pom.xml
+++ b/server/apps/jpa-smtp-app/pom.xml
@@ -93,6 +93,18 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback.contrib</groupId>
+            <artifactId>logback-jackson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback.contrib</groupId>
+            <artifactId>logback-json-classic</artifactId>
+        </dependency>
+        <dependency>
             <groupId>io.rest-assured</groupId>
             <artifactId>rest-assured</artifactId>
             <scope>test</scope>

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 06/09: JAMES-3261 JPA-SMTP app: remove cassandra logger in logback declarations

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 1b0ea1a2eec094cddd1c2c9bda6d61f56e8c2a1b
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 14:08:32 2021 +0700

    JAMES-3261 JPA-SMTP app: remove cassandra logger in logback declarations
---
 server/apps/jpa-smtp-app/sample-configuration/logback.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/server/apps/jpa-smtp-app/sample-configuration/logback.xml b/server/apps/jpa-smtp-app/sample-configuration/logback.xml
index e0182f2..aedabb3 100644
--- a/server/apps/jpa-smtp-app/sample-configuration/logback.xml
+++ b/server/apps/jpa-smtp-app/sample-configuration/logback.xml
@@ -36,6 +36,5 @@
         </root>
 
         <logger name="org.apache.james" level="INFO" />
-        <logger name="com.datastax.driver.core.QueryLogger.SLOW" level="DEBUG" />
 
 </configuration>

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 07/09: JAMES-3261 JPA-SMTP app: docker-compose to connect to MariaDB

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 1ad46c0f5d52041270e6abe22b74daa456c43266
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 14:17:35 2021 +0700

    JAMES-3261 JPA-SMTP app: docker-compose to connect to MariaDB
---
 server/apps/jpa-app/README.adoc                    |  26 +++-
 server/apps/jpa-smtp-app/README.adoc               |  26 +++-
 server/apps/jpa-smtp-app/docker-compose.yml        |  28 ++++
 .../james-database-mariadb.properties}             |  12 +-
 server/apps/jpa-smtp-mariadb-app/pom.xml           | 156 ---------------------
 .../sample-configuration/dnsservice.xml            |  25 ----
 .../sample-configuration/domainlist.xml            |  25 ----
 .../sample-configuration/mailetcontainer.xml       | 105 --------------
 .../sample-configuration/mailrepositorystore.xml   |  34 -----
 .../sample-configuration/recipientrewritetable.xml |  27 ----
 .../sample-configuration/smtpserver.xml            | 105 --------------
 .../sample-configuration/usersrepository.xml       |  27 ----
 .../sample-configuration/webadmin.properties       |  23 ---
 server/pom.xml                                     |   1 -
 14 files changed, 82 insertions(+), 538 deletions(-)

diff --git a/server/apps/jpa-app/README.adoc b/server/apps/jpa-app/README.adoc
index 97b16db..43e7c89 100644
--- a/server/apps/jpa-app/README.adoc
+++ b/server/apps/jpa-app/README.adoc
@@ -77,4 +77,28 @@ The [CLI](https://james.apache.org/server/manage-cli.html) can easily be used:
 [source]
 ----
 docker exec CONTAINER-ID james-cli ListDomains
-----
\ No newline at end of file
+----
+
+=== Using alternative JDBC drivers
+
+In `james-database.properties`, one can specify any JDBC driver on the class path.
+
+With docker, such drivers can be added to the classpath by placing the driver JAR in a volume
+and mounting it within `/root/libs` directory.
+
+We do ship a [docker-compose](https://github.com/apache/james-project/blob/master/server/apps/jpa-smtp-app/docker-compose.yml)
+file demonstrating James JPA app usage with MariaDB. In order to run it:
+
+....
+# 1. Download the driver:
+wget https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.2/mariadb-java-client-2.7.2.jar
+
+# 2. Generate the keystore with the default password `james72laBalle`:
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+
+# 3. Start MariaDB
+docker-compose up -d mariadb
+
+# 4. Start James
+docker-compose up james
+....
\ No newline at end of file
diff --git a/server/apps/jpa-smtp-app/README.adoc b/server/apps/jpa-smtp-app/README.adoc
index 8254a6a..207baad 100644
--- a/server/apps/jpa-smtp-app/README.adoc
+++ b/server/apps/jpa-smtp-app/README.adoc
@@ -79,4 +79,28 @@ The [CLI](https://james.apache.org/server/manage-cli.html) can easily be used:
 [source]
 ----
 docker exec CONTAINER-ID james-cli ListDomains
-----
\ No newline at end of file
+----
+
+=== Using alternative JDBC drivers
+
+In `james-database.properties`, one can specify any JDBC driver on the class path.
+
+With docker, such drivers can be added to the classpath by placing the driver JAR in a volume
+and mounting it within `/root/libs` directory.
+
+We do ship a [docker-compose](https://github.com/apache/james-project/blob/master/server/apps/jpa-smtp-app/docker-compose.yml)
+file demonstrating James JPA app usage with MariaDB. In order to run it:
+
+....
+# 1. Download the driver:
+wget https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.2/mariadb-java-client-2.7.2.jar
+
+# 2. Generate the keystore with the default password `james72laBalle`:
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+
+# 3. Start MariaDB
+docker-compose up -d mariadb
+
+# 4. Start James
+docker-compose up james
+....
\ No newline at end of file
diff --git a/server/apps/jpa-smtp-app/docker-compose.yml b/server/apps/jpa-smtp-app/docker-compose.yml
new file mode 100644
index 0000000..2d22da5
--- /dev/null
+++ b/server/apps/jpa-smtp-app/docker-compose.yml
@@ -0,0 +1,28 @@
+version: '3'
+
+# In order to start James JPA app on top of mariaDB:
+# 1. Download the driver: `wget https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.2/mariadb-java-client-2.7.2.jar`
+# 2. Generate the keystore with the default password `james72laBalle`: `keytool -genkey -alias james -keyalg RSA -keystore keystore`
+# 3. Start MariaDB: `docker-compose up -d mariadb`
+# 4. Start James: `docker-compose up james`
+
+services:
+
+  james:
+    depends_on:
+      - mariadb
+    image: apache/james:jpa-smtp-latest
+    container_name: james
+    hostname: james.local
+    volumes:
+      - $PWD/mariadb-java-client-2.7.2.jar:/root/libs/mariadb-java-client-2.7.2.jar
+      - $PWD/sample-configuration/james-database-mariadb.properties:/root/conf/james-database.properties
+      - $PWD/keystore:/root/conf/keystore
+
+  mariadb:
+    image: mariadb:10.6
+    environment:
+      - MARIADB_ROOT_PASSWORD=test
+      - MARIADB_DATABASE=test
+      - MARIADB_USER=test
+      - MARIADB_PASSWORD=test
\ No newline at end of file
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/james-database.properties b/server/apps/jpa-smtp-app/sample-configuration/james-database-mariadb.properties
similarity index 84%
rename from server/apps/jpa-smtp-mariadb-app/sample-configuration/james-database.properties
rename to server/apps/jpa-smtp-app/sample-configuration/james-database-mariadb.properties
index 80fe839..8060df0 100644
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/james-database.properties
+++ b/server/apps/jpa-smtp-app/sample-configuration/james-database-mariadb.properties
@@ -18,17 +18,13 @@
 #  This template file can be used as example for James Server configuration
 #  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
 
-# See http://james.apache.org/server/3/config.html for usage
+# Read https://james.apache.org/server/config-system.html#james-database.properties for further details
 
 # Use derby as default
 database.driverClassName=org.mariadb.jdbc.Driver
-database.url=jdbc:mariadb://localhost:3306/
-database.username=app
-database.password=app
-
-# Supported adapters are:
-# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE 
-vendorAdapter.database=MYSQL
+database.url=jdbc:mariadb://mariadb/test
+database.username=test
+database.password=test
 
 # Use streaming for Blobs
 # This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
diff --git a/server/apps/jpa-smtp-mariadb-app/pom.xml b/server/apps/jpa-smtp-mariadb-app/pom.xml
deleted file mode 100644
index 4a076f8..0000000
--- a/server/apps/jpa-smtp-mariadb-app/pom.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>james-server</artifactId>
-        <version>3.7.0-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>james-server-jpa-smtp-mariadb-guice</artifactId>
-    <packaging>jar</packaging>
-
-    <name>Apache James :: Server :: JPA + mariaDB client :: SMTP only :: App</name>
-    <description>An advanced email server - JPA backend for SMTP with guice injection</description>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
-                <artifactId>james-server-guice</artifactId>
-                <version>${project.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <dependencies>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-backends-jpa</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-common</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jpa-smtp-common-guice</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-mailets</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>testing-base</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derby</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mariadb.jdbc</groupId>
-            <artifactId>mariadb-java-client</artifactId>
-            <version>2.7.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.testcontainers</groupId>
-            <artifactId>mariadb</artifactId>
-            <version>${testcontainers.version}</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <phase>package</phase>
-                        <configuration>
-                            <includeScope>compile</includeScope>
-                            <includeScope>runtime</includeScope>
-                            <outputDirectory>${project.build.directory}/${project.artifactId}.lib</outputDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>default-jar</id>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                        <configuration>
-                            <finalName>${project.artifactId}</finalName>
-                            <archive>
-                                <manifest>
-                                    <addClasspath>true</addClasspath>
-                                    <classpathPrefix>${project.artifactId}.lib/</classpathPrefix>
-                                    <mainClass>org.apache.james.JPAJamesServerMain</mainClass>
-                                    <useUniqueVersions>false</useUniqueVersions>
-                                </manifest>
-                                <manifestEntries>
-                                    <Specification-Title>Apache James JPA-SMTP mariaDB server Application</Specification-Title>
-                                    <Specification-Version>${project.version}</Specification-Version>
-                                    <Specification-Vendor>The Apache Software Foundation</Specification-Vendor>
-                                    <Implementation-Title>Apache James JPA-SMTP mariaDB server Application</Implementation-Title>
-                                    <Implementation-Version>${project.version}</Implementation-Version>
-                                    <Implementation-Vendor>The Apache Software Foundation</Implementation-Vendor>
-                                    <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
-                                    <url>https://james.apache.org/server</url>
-                                </manifestEntries>
-                            </archive>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>test-jar</id>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/dnsservice.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/dnsservice.xml
deleted file mode 100644
index 6e4fbd2..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/dnsservice.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<dnsservice>
-  <autodiscover>true</autodiscover>
-  <authoritative>false</authoritative>
-  <maxcachesize>50000</maxcachesize>
-</dnsservice>
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/domainlist.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/domainlist.xml
deleted file mode 100644
index 89b01d1..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/domainlist.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-    <autodetect>false</autodetect>
-    <autodetectIP>false</autodetectIP>
-    <defaultDomain>localhost</defaultDomain>
-</domainlist>
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/mailetcontainer.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/mailetcontainer.xml
deleted file mode 100644
index 38d009d..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/mailetcontainer.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailetcontainer enableJmx="true">
-
-    <context>
-        <postmaster>postmaster@james.minet.net</postmaster>
-    </context>
-
-    <spooler>
-        <threads>20</threads>
-    </spooler>
-
-    <processors>
-        <processor state="root" enableJmx="true">
-            <mailet match="All" class="PostmasterAlias"/>
-            <mailet match="RelayLimit=30" class="Null"/>
-            <mailet match="All" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-        </processor>
-
-        <processor state="error" enableJmx="true">
-            <mailet match="All" class="Bounce"/>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/error/</repositoryPath>
-            </mailet>
-        </processor>
-
-
-        <processor state="transport" enableJmx="true">
-            <matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or">
-                <matcher match="SMTPAuthSuccessful"/>
-                <matcher match="SMTPIsAuthNetwork"/>
-                <matcher match="SentByMailet"/>
-            </matcher>
-
-            <mailet match="All" class="RecipientRewriteTable" />
-            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
-            <mailet match="HostIsLocal" class="ToProcessor">
-                <processor>local-address-error</processor>
-                <notice>550 - Requested action not taken: no such user here</notice>
-            </mailet>
-
-            <mailet match="relay-allowed" class="RemoteDelivery">
-                <outgoingQueue>outgoing</outgoingQueue>
-                <delayTime>5000, 100000, 500000</delayTime>
-                <maxRetries>3</maxRetries>
-                <maxDnsProblemRetries>0</maxDnsProblemRetries>
-                <deliveryThreads>10</deliveryThreads>
-                <sendpartial>true</sendpartial>
-                <bounceProcessor>bounces</bounceProcessor>
-            </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet>
-        </processor>
-
-        <processor state="local-address-error" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <attachment>none</attachment>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/address-error/</repositoryPath>
-            </mailet>
-        </processor>
-
-        <processor state="relay-denied" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <attachment>none</attachment>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
-            </mailet>
-        </processor>
-
-        <processor state="bounces" enableJmx="true">
-            <mailet match="All" class="DSNBounce">
-                <passThrough>false</passThrough>
-            </mailet>
-        </processor>
-    </processors>
-
-</mailetcontainer>
-
-
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/mailrepositorystore.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/mailrepositorystore.xml
deleted file mode 100644
index acca810..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/mailrepositorystore.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailrepositorystore>
-    <mailrepositories>
-        <!-- File based repositories.  These repositories store all message data -->
-        <!-- in the file system. -->
-        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
-            <protocols>
-                <protocol>file</protocol>
-            </protocols>
-            <!-- Set if the messages should be listed sorted. False by default -->
-            <config FIFO="false" CACHEKEYS="true"/>
-        </mailrepository>
-    </mailrepositories>
-</mailrepositorystore>
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/recipientrewritetable.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/recipientrewritetable.xml
deleted file mode 100644
index 7e7f586..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/recipientrewritetable.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<!-- The default table for storing James' RecipientRewriteTable mappings. -->
-<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
-  <recursiveMapping>true</recursiveMapping>
-  <mappingLimit>10</mappingLimit>
-  <mapping>some@domain=some</mapping>
-</recipientrewritetable>
-
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/smtpserver.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/smtpserver.xml
deleted file mode 100644
index 7946218..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/smtpserver.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.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.
- -->
-
-<smtpservers>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-global</jmxName>
-        <bind>0.0.0.0:1025</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <authRequired>false</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-TLS</jmxName>
-        <bind>0.0.0.0:1465</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="true" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-authenticated</jmxName>
-        <bind>0.0.0.0:1587</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="true">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-</smtpservers>
-
-
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/usersrepository.xml b/server/apps/jpa-smtp-mariadb-app/sample-configuration/usersrepository.xml
deleted file mode 100644
index fc76107..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/usersrepository.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository">
-    <destination URL="file://users/"/>
-    <algorithm>MD5</algorithm>
-    <enableVirtualHosting>true</enableVirtualHosting>
-    <enableForwarding>true</enableForwarding>
-</usersrepository>
-
diff --git a/server/apps/jpa-smtp-mariadb-app/sample-configuration/webadmin.properties b/server/apps/jpa-smtp-mariadb-app/sample-configuration/webadmin.properties
deleted file mode 100644
index a9b5cc2..0000000
--- a/server/apps/jpa-smtp-mariadb-app/sample-configuration/webadmin.properties
+++ /dev/null
@@ -1,23 +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.
-
-#  This template file can be used as example for James Server configuration
-#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-enabled=true
-port=8000
-host=localhost
\ No newline at end of file
diff --git a/server/pom.xml b/server/pom.xml
index 644ddb5..5402cb0 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -44,7 +44,6 @@
         <module>apps/distributed-app</module>
         <module>apps/jpa-app</module>
         <module>apps/jpa-smtp-app</module>
-        <module>apps/jpa-smtp-mariadb-app</module>
         <module>apps/memory-app</module>
         <module>apps/spring-app</module>
         <module>apps/webadmin-cli</module>

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 08/09: JAMES-3261 JPA app should also embed a MariaDB example

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 25ccf643231d2f4d199d60bb98376fc0b4e9dedc
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 14:36:37 2021 +0700

    JAMES-3261 JPA app should also embed a MariaDB example
---
 server/apps/jpa-app/docker-compose.yml             | 28 +++++++++++++++
 .../james-database-mariadb.properties              | 42 ++++++++++++++++++++++
 2 files changed, 70 insertions(+)

diff --git a/server/apps/jpa-app/docker-compose.yml b/server/apps/jpa-app/docker-compose.yml
new file mode 100644
index 0000000..7f55cdb
--- /dev/null
+++ b/server/apps/jpa-app/docker-compose.yml
@@ -0,0 +1,28 @@
+version: '3'
+
+# In order to start James JPA app on top of mariaDB:
+# 1. Download the driver: `wget https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.2/mariadb-java-client-2.7.2.jar`
+# 2. Generate the keystore with the default password `james72laBalle`: `keytool -genkey -alias james -keyalg RSA -keystore keystore`
+# 3. Start MariaDB: `docker-compose up -d mariadb`
+# 4. Start James: `docker-compose up james`
+
+services:
+
+  james:
+    depends_on:
+      - mariadb
+    image: apache/james:jpa-latest
+    container_name: james
+    hostname: james.local
+    volumes:
+      - $PWD/mariadb-java-client-2.7.2.jar:/root/libs/mariadb-java-client-2.7.2.jar
+      - $PWD/sample-configuration/james-database-mariadb.properties:/root/conf/james-database.properties
+      - $PWD/keystore:/root/conf/keystore
+
+  mariadb:
+    image: mariadb:10.6
+    environment:
+      - MARIADB_ROOT_PASSWORD=test
+      - MARIADB_DATABASE=test
+      - MARIADB_USER=test
+      - MARIADB_PASSWORD=test
\ No newline at end of file
diff --git a/server/apps/jpa-app/sample-configuration/james-database-mariadb.properties b/server/apps/jpa-app/sample-configuration/james-database-mariadb.properties
new file mode 100644
index 0000000..8060df0
--- /dev/null
+++ b/server/apps/jpa-app/sample-configuration/james-database-mariadb.properties
@@ -0,0 +1,42 @@
+#  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.
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# Read https://james.apache.org/server/config-system.html#james-database.properties for further details
+
+# Use derby as default
+database.driverClassName=org.mariadb.jdbc.Driver
+database.url=jdbc:mariadb://mariadb/test
+database.username=test
+database.password=test
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it. 
+# 
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html  #7.11.  LOB Streaming 
+# 
+openjpa.streaming=false
+
+# Validate the data source before using it
+# datasource.testOnBorrow=true
+# datasource.validationQueryTimeoutSec=2
+# This is different per database. See https://stackoverflow.com/questions/10684244/dbcp-validationquery-for-different-databases#10684260
+# datasource.validationQuery=select 1

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 02/09: JAMES-3621 Move JPA-SMTP mariaDB tests to main JPA-SMTP package

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 138580fa57dfccf76fb508a3a2096dc8e5ac697d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 13:20:53 2021 +0700

    JAMES-3621 Move JPA-SMTP mariaDB tests to main JPA-SMTP package
---
 server/apps/jpa-smtp-app/pom.xml                   |  12 +++
 .../james/mariadb/JPAMariaDBJamesServerTest.java}  |   8 +-
 .../TestJPAMariaDBConfigurationModule.java}        |   6 +-
 .../src/test/resources/dnsservice.xml              |  25 -----
 .../src/test/resources/domainlist.xml              |  24 -----
 .../src/test/resources/fakemailrepositorystore.xml |  31 ------
 .../src/test/resources/keystore                    | Bin 2245 -> 0 bytes
 .../src/test/resources/mailetcontainer.xml         | 120 ---------------------
 .../src/test/resources/mailrepositorystore.xml     |  31 ------
 .../src/test/resources/smtpserver.xml              | 102 ------------------
 10 files changed, 20 insertions(+), 339 deletions(-)

diff --git a/server/apps/jpa-smtp-app/pom.xml b/server/apps/jpa-smtp-app/pom.xml
index 94e94b9..8b988bc 100644
--- a/server/apps/jpa-smtp-app/pom.xml
+++ b/server/apps/jpa-smtp-app/pom.xml
@@ -113,10 +113,22 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.mariadb.jdbc</groupId>
+            <artifactId>mariadb-java-client</artifactId>
+            <version>2.7.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>mariadb</artifactId>
+            <version>${testcontainers.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/java/org/apache/james/JPAJamesServerTest.java b/server/apps/jpa-smtp-app/src/test/java/org/apache/james/mariadb/JPAMariaDBJamesServerTest.java
similarity index 93%
rename from server/apps/jpa-smtp-mariadb-app/src/test/java/org/apache/james/JPAJamesServerTest.java
rename to server/apps/jpa-smtp-app/src/test/java/org/apache/james/mariadb/JPAMariaDBJamesServerTest.java
index 6f141fb..be9a34b 100644
--- a/server/apps/jpa-smtp-mariadb-app/src/test/java/org/apache/james/JPAJamesServerTest.java
+++ b/server/apps/jpa-smtp-app/src/test/java/org/apache/james/mariadb/JPAMariaDBJamesServerTest.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james;
+package org.apache.james.mariadb;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
@@ -27,6 +27,8 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
 import java.nio.charset.StandardCharsets;
 
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JPAJamesServerMain;
 import org.apache.james.modules.protocols.SmtpGuiceProbe;
 import org.apache.james.server.core.configuration.Configuration;
 import org.junit.After;
@@ -36,7 +38,7 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 import org.testcontainers.containers.MariaDBContainer;
 
-public class JPAJamesServerTest {
+public class JPAMariaDBJamesServerTest {
 
     private GuiceJamesServer server;
     private SocketChannel socketChannel;
@@ -66,7 +68,7 @@ public class JPAJamesServerTest {
             .build();
 
         return JPAJamesServerMain.createServer(configuration)
-                .overrideWith(new TestJPAConfigurationModule(mariaDBUrl));
+                .overrideWith(new TestJPAMariaDBConfigurationModule(mariaDBUrl));
     }
 
     @After
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/java/org/apache/james/TestJPAConfigurationModule.java b/server/apps/jpa-smtp-app/src/test/java/org/apache/james/mariadb/TestJPAMariaDBConfigurationModule.java
similarity index 92%
rename from server/apps/jpa-smtp-mariadb-app/src/test/java/org/apache/james/TestJPAConfigurationModule.java
rename to server/apps/jpa-smtp-app/src/test/java/org/apache/james/mariadb/TestJPAMariaDBConfigurationModule.java
index 070d398..bc7d7a7 100644
--- a/server/apps/jpa-smtp-mariadb-app/src/test/java/org/apache/james/TestJPAConfigurationModule.java
+++ b/server/apps/jpa-smtp-app/src/test/java/org/apache/james/mariadb/TestJPAMariaDBConfigurationModule.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james;
+package org.apache.james.mariadb;
 
 import javax.inject.Singleton;
 
@@ -26,14 +26,14 @@ import org.apache.james.modules.data.JPAConfiguration;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 
-public class TestJPAConfigurationModule extends AbstractModule {
+public class TestJPAMariaDBConfigurationModule extends AbstractModule {
 
     private static final String MARIA_USERNAME = "test";
     private static final String MARIA_PASSWORD = "test";
     private static final String JDBC_EMBEDDED_DRIVER = org.mariadb.jdbc.Driver.class.getName();
     private final String mariaDBUrl;
 
-    public TestJPAConfigurationModule(String mariaDBUrl) {
+    public TestJPAMariaDBConfigurationModule(String mariaDBUrl) {
         this.mariaDBUrl = mariaDBUrl;
     }
 
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/dnsservice.xml b/server/apps/jpa-smtp-mariadb-app/src/test/resources/dnsservice.xml
deleted file mode 100644
index 6e4fbd2..0000000
--- a/server/apps/jpa-smtp-mariadb-app/src/test/resources/dnsservice.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<dnsservice>
-  <autodiscover>true</autodiscover>
-  <authoritative>false</authoritative>
-  <maxcachesize>50000</maxcachesize>
-</dnsservice>
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/domainlist.xml b/server/apps/jpa-smtp-mariadb-app/src/test/resources/domainlist.xml
deleted file mode 100644
index fe17431..0000000
--- a/server/apps/jpa-smtp-mariadb-app/src/test/resources/domainlist.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<domainlist>
-    <autodetect>false</autodetect>
-    <autodetectIP>false</autodetectIP>
-</domainlist>
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/fakemailrepositorystore.xml b/server/apps/jpa-smtp-mariadb-app/src/test/resources/fakemailrepositorystore.xml
deleted file mode 100644
index 2d19a802..0000000
--- a/server/apps/jpa-smtp-mariadb-app/src/test/resources/fakemailrepositorystore.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailrepositorystore>
-    <mailrepositories>
-        <mailrepository class="org.apache.james.mailrepository.None">
-            <protocols>
-                <protocol>file</protocol>
-            </protocols>
-            <config FIFO="false" CACHEKEYS="true"/>
-        </mailrepository>
-    </mailrepositories>
-</mailrepositorystore>
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/keystore b/server/apps/jpa-smtp-mariadb-app/src/test/resources/keystore
deleted file mode 100644
index 536a6c7..0000000
Binary files a/server/apps/jpa-smtp-mariadb-app/src/test/resources/keystore and /dev/null differ
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/mailetcontainer.xml b/server/apps/jpa-smtp-mariadb-app/src/test/resources/mailetcontainer.xml
deleted file mode 100644
index 6b79da2..0000000
--- a/server/apps/jpa-smtp-mariadb-app/src/test/resources/mailetcontainer.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailetcontainer enableJmx="true">
-
-    <context>
-        <postmaster>postmaster</postmaster>
-    </context>
-
-    <spooler>
-        <threads>20</threads>
-    </spooler>
-
-    <processors>
-        <processor state="root" enableJmx="true">
-            <mailet match="All" class="PostmasterAlias"/>
-            <mailet match="RelayLimit=30" class="Null"/>
-
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-
-            <mailet match="All" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-        </processor>
-
-        <processor state="error" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <onMailetException>ignore</onMailetException>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/error/</repositoryPath>
-                <onMailetException>ignore</onMailetException>
-            </mailet>
-        </processor>
-
-
-        <processor state="transport" enableJmx="true">
-            <mailet match="All" class="RemoveMimeHeader">
-                <name>bcc</name>
-            </mailet>
-            <mailet match="All" class="RecipientRewriteTable">
-                <errorProcessor>rrt-error</errorProcessor>
-            </mailet>
-            <mailet match="All" class="RemoteDelivery">
-                <outgoingQueue>outgoing</outgoingQueue>
-                <delayTime>5 minutes</delayTime>
-                <delayTime>10 minutes</delayTime>
-                <delayTime>45 minutes</delayTime>
-                <delayTime>2 hours</delayTime>
-                <delayTime>3 hours</delayTime>
-                <delayTime>6 hours</delayTime>
-                <maxRetries>0</maxRetries>
-                <maxDnsProblemRetries>0</maxDnsProblemRetries>
-                <deliveryThreads>1</deliveryThreads>
-                <sendpartial>false</sendpartial>
-                <bounceProcessor>bounces</bounceProcessor>
-            </mailet>
-        </processor>
-
-        <processor state="local-address-error" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <attachment>none</attachment>
-                <passThrough>true</passThrough>
-                <debug>true</debug>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/address-error/</repositoryPath>
-            </mailet>
-        </processor>
-
-        <processor state="relay-denied" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <attachment>none</attachment>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
-            </mailet>
-        </processor>
-
-        <processor state="bounces" enableJmx="true">
-            <mailet match="All" class="DSNBounce">
-                <passThrough>false</passThrough>
-            </mailet>
-        </processor>
-
-        <processor state="rrt-error" enableJmx="false">
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/rrt-error/</repositoryPath>
-                <passThrough>true</passThrough>
-            </mailet>
-            <mailet match="IsSenderInRRTLoop" class="Null"/>
-            <mailet match="All" class="Bounce">
-                <notice>We were unable to deliver the attached message to the following recipients due to an address rewriting issue.</notice>
-            </mailet>
-        </processor>
-    </processors>
-
-</mailetcontainer>
-
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/mailrepositorystore.xml b/server/apps/jpa-smtp-mariadb-app/src/test/resources/mailrepositorystore.xml
deleted file mode 100644
index 3ca4a1d..0000000
--- a/server/apps/jpa-smtp-mariadb-app/src/test/resources/mailrepositorystore.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailrepositorystore>
-    <mailrepositories>
-        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
-            <protocols>
-                <protocol>file</protocol>
-            </protocols>
-            <config FIFO="false" CACHEKEYS="true"/>
-        </mailrepository>
-    </mailrepositories>
-</mailrepositorystore>
diff --git a/server/apps/jpa-smtp-mariadb-app/src/test/resources/smtpserver.xml b/server/apps/jpa-smtp-mariadb-app/src/test/resources/smtpserver.xml
deleted file mode 100644
index 4fb392d..0000000
--- a/server/apps/jpa-smtp-mariadb-app/src/test/resources/smtpserver.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.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.
- -->
-
-<smtpservers>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-global</jmxName>
-        <bind>0.0.0.0:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <authRequired>false</authRequired>
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-TLS</jmxName>
-        <bind>0.0.0.0:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-authenticated</jmxName>
-        <bind>0.0.0.0:1587</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-</smtpservers>
-
-

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 05/09: JAMES-2418 Length in JPAUrl caused mariaDB driver to complain...

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit d1a4e30dab028d897f70ed984aec0eea4c16618e
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 14:05:38 2021 +0700

    JAMES-2418 Length in JPAUrl caused mariaDB driver to complain...
---
 .../src/main/java/org/apache/james/mailrepository/jpa/JPAUrl.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/data/data-jpa/src/main/java/org/apache/james/mailrepository/jpa/JPAUrl.java b/server/data/data-jpa/src/main/java/org/apache/james/mailrepository/jpa/JPAUrl.java
index c775ad7..8de1eb8 100644
--- a/server/data/data-jpa/src/main/java/org/apache/james/mailrepository/jpa/JPAUrl.java
+++ b/server/data/data-jpa/src/main/java/org/apache/james/mailrepository/jpa/JPAUrl.java
@@ -39,7 +39,7 @@ public class JPAUrl {
     }
 
     @Id
-    @Column(name = "MAIL_REPO_NAME", nullable = false, length = 1024)
+    @Column(name = "MAIL_REPO_NAME", nullable = false)
     private String value;
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 03/09: JAMES-3261 Enable webAdmin for JPA-SMTP app

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit df635a2610cfee848772250ab9372807833fceb0
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 14:04:38 2021 +0700

    JAMES-3261 Enable webAdmin for JPA-SMTP app
---
 .../sample-configuration/webadmin.properties       | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/server/apps/jpa-smtp-app/sample-configuration/webadmin.properties b/server/apps/jpa-smtp-app/sample-configuration/webadmin.properties
new file mode 100644
index 0000000..ec014ea
--- /dev/null
+++ b/server/apps/jpa-smtp-app/sample-configuration/webadmin.properties
@@ -0,0 +1,48 @@
+#  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.
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# Read https://james.apache.org/server/config-webadmin.html for further details
+
+enabled=true
+port=8000
+host=localhost
+
+# Defaults to false
+https.enabled=false
+
+# Compulsory when enabling HTTPS
+#https.keystore=/path/to/keystore
+#https.password=password
+
+# Optional when enabling HTTPS (self signed)
+#https.trust.keystore
+#https.trust.password
+
+# Defaults to false
+#jwt.enabled=true
+
+# Defaults to false
+#cors.enable=true
+#cors.origin
+
+# List of fully qualified class names that should be exposed over webadmin
+# in addition to your product default routes. Routes needs to be located
+# within the classpath or in the ./extensions-jars folder.
+#extensions.routes=
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 09/09: JAMES-3261 Get rid of no longer needed jpa-smtp-common maven module in server/container/guice

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 277f514b4020e348189576120d9017c0444874a5
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 25 15:09:09 2021 +0700

    JAMES-3261 Get rid of no longer needed jpa-smtp-common maven module in server/container/guice
---
 server/apps/jpa-smtp-app/pom.xml                   | 45 ++++++++++-
 .../java/org/apache/james/JPAJamesServerMain.java  |  0
 .../src/main/resources/META-INF/persistence.xml    |  8 +-
 .../src/main/resources/defaultMailetContainer.xml  |  0
 server/container/guice/jpa-smtp-common/pom.xml     | 88 ----------------------
 .../jpa-smtp-common/src/main/resources/logback.xml | 22 ------
 server/container/guice/pom.xml                     |  6 --
 7 files changed, 47 insertions(+), 122 deletions(-)

diff --git a/server/apps/jpa-smtp-app/pom.xml b/server/apps/jpa-smtp-app/pom.xml
index 4ea814d..ced7ff6 100644
--- a/server/apps/jpa-smtp-app/pom.xml
+++ b/server/apps/jpa-smtp-app/pom.xml
@@ -65,23 +65,60 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-data-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-common</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-es-resporter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-smtp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-webadmin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-webadmin-data</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-webadmin-mailqueue</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-guice-webadmin-mailrepository</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-jpa-common-guice</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-jpa-common-guice</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jpa-smtp-common-guice</artifactId>
+            <artifactId>james-server-mailets</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-mailets</artifactId>
+            <artifactId>james-server-testing</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
@@ -105,6 +142,10 @@
             <artifactId>logback-json-classic</artifactId>
         </dependency>
         <dependency>
+            <groupId>com.linagora</groupId>
+            <artifactId>logback-elasticsearch-appender</artifactId>
+        </dependency>
+        <dependency>
             <groupId>io.rest-assured</groupId>
             <artifactId>rest-assured</artifactId>
             <scope>test</scope>
diff --git a/server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java b/server/apps/jpa-smtp-app/src/main/java/org/apache/james/JPAJamesServerMain.java
similarity index 100%
rename from server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java
rename to server/apps/jpa-smtp-app/src/main/java/org/apache/james/JPAJamesServerMain.java
diff --git a/server/container/guice/jpa-smtp-common/src/main/resources/META-INF/persistence.xml b/server/apps/jpa-smtp-app/src/main/resources/META-INF/persistence.xml
similarity index 87%
rename from server/container/guice/jpa-smtp-common/src/main/resources/META-INF/persistence.xml
rename to server/apps/jpa-smtp-app/src/main/resources/META-INF/persistence.xml
index 0656779..1dd8538 100644
--- a/server/container/guice/jpa-smtp-common/src/main/resources/META-INF/persistence.xml
+++ b/server/apps/jpa-smtp-app/src/main/resources/META-INF/persistence.xml
@@ -15,13 +15,13 @@
   "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.    
+  under the License.
 -->
 
 <persistence xmlns="http://java.sun.com/xml/ns/persistence"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
-    version="2.0">
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+             version="2.0">
 
     <persistence-unit name="Global" transaction-type="RESOURCE_LOCAL">
         <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
diff --git a/server/container/guice/jpa-smtp-common/src/main/resources/defaultMailetContainer.xml b/server/apps/jpa-smtp-app/src/main/resources/defaultMailetContainer.xml
similarity index 100%
rename from server/container/guice/jpa-smtp-common/src/main/resources/defaultMailetContainer.xml
rename to server/apps/jpa-smtp-app/src/main/resources/defaultMailetContainer.xml
diff --git a/server/container/guice/jpa-smtp-common/pom.xml b/server/container/guice/jpa-smtp-common/pom.xml
deleted file mode 100644
index 9bd128b..0000000
--- a/server/container/guice/jpa-smtp-common/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>james-server-guice</artifactId>
-        <version>3.7.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>james-server-jpa-smtp-common-guice</artifactId>
-
-    <name>Apache James :: Server :: JPA + SMTP - common guice injection</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-data-jpa</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-common</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-es-resporter</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-smtp</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-webadmin</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-webadmin-data</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-webadmin-mailqueue</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-guice-webadmin-mailrepository</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-jpa-common-guice</artifactId>
-        </dependency>
-        <dependency>
-            <!-- Added because of https://issues.apache.org/jira/browse/SUREFIRE-1266 -->
-            <groupId>${james.groupId}</groupId>
-            <artifactId>james-server-testing</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${james.groupId}</groupId>
-            <artifactId>queue-activemq-guice</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.linagora</groupId>
-            <artifactId>logback-elasticsearch-appender</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/server/container/guice/jpa-smtp-common/src/main/resources/logback.xml b/server/container/guice/jpa-smtp-common/src/main/resources/logback.xml
deleted file mode 100644
index 0e1ff22..0000000
--- a/server/container/guice/jpa-smtp-common/src/main/resources/logback.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-
-        <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
-                <resetJUL>true</resetJUL>
-        </contextListener>
-
-        <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
-                <encoder>
-                        <pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
-                        <immediateFlush>false</immediateFlush>
-                </encoder>
-        </appender>
-
-        <root level="WARN">
-                <appender-ref ref="CONSOLE" />
-        </root>
-
-        <logger name="org.apache.james" level="INFO"/>
-
-
-</configuration>
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 74dd1b2..ea45f6f 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -47,7 +47,6 @@
         <module>es-metric-reporter</module>
         <module>jmx</module>
         <module>jpa-common</module>
-        <module>jpa-smtp-common</module>
         <module>mailbox</module>
         <module>mailbox-jpa</module>
         <module>mailbox-plugin-deleted-messages-vault</module>
@@ -252,11 +251,6 @@
             </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>
-                <artifactId>james-server-jpa-smtp-common-guice</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
                 <artifactId>mailrepository-cassandra</artifactId>
                 <version>${project.version}</version>
             </dependency>

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org