diff --git a/.dockerignore b/.dockerignore index ce1917084af255c7752d36250a47f555d43d0b40..972b728930b4da57f3edf726cbfa8e2621a21a46 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,5 @@ .idea README.md +docker-compose.yml +.gitignore +*.log diff --git a/README.md b/README.md index 78b616796ccbb5347f0337738561be22dab59a23..4935b3ed090a4a651601537e02300697a8e38a92 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ 1. COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up --build -d 2. Visit - 1. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample - 2. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/hello - 3. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/main - 4. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons + 1. curl http://localhost:8080/restApp/sample + 2. curl http://localhost:8080/restApp/sample/hello + 3. curl http://localhost:8080/restApp/sample/main + 4. curl http://localhost:8080/restApp/sample/persons 5. curl -H "Content-Type: application/json" \ -X POST \ -d '{"name":"Jeanne"}' \ - http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons + http://localhost:8080/restApp/sample/persons 6. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons/843c8236-6c6b-450e-9aa3-211a9b897403 7. curl -H "Accept: text/xml" http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons ## Import "real" certificate diff --git a/docker/Dockerfile b/docker/Dockerfile index 8ef1ac974908a4885b3d580a9f2daaeb6dfc673a..b0fdff5d1f8422ef772a39fdc5667d5c02ea5780 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,13 @@ # syntax=docker/dockerfile:1.3 ### First we build the application in docker in a controlled env -FROM maven:3.8.3-eclipse-temurin-11 as build +FROM maven:3.8.4-eclipse-temurin-11 as build WORKDIR /app -COPY ./ /app/ -RUN --mount=type=cache,id=mvncache,target=/root/.m2/repository,rw \ - mvn -B clean package +# COPY pom.xml /app/pom.xml +COPY . /app/ +RUN --mount=type=cache,id=mvncache,target=/root/.m2/repository,rw \ + mvn -B package ### Then we add the builded war to a JEE server. #FROM payara/server-full:5.2021.9-jdk11 as server @@ -43,5 +44,7 @@ FROM server as production # $DEPLOY_DIR #COPY --from=build /app/jee/wsApp/target/*.war \ # $DEPLOY_DIR -COPY --from=build /app/jee/jsf/target/*.war \ +#COPY --from=build /app/jee/jsf/target/*.war \ +# $DEPLOY_DIR +COPY --from=build /app/jee/ear/target/*.ear \ $DEPLOY_DIR \ No newline at end of file diff --git a/docker/payara/Dockerfile b/docker/payara/Dockerfile index 05665875fe4ed02f90440ff3b1b421cf46017b37..369243efef57261fdbf19a04e29b6bb2a7838a5f 100644 --- a/docker/payara/Dockerfile +++ b/docker/payara/Dockerfile @@ -1,20 +1,22 @@ # FROM azul/zulu-openjdk:8u222 as mypayara #FROM eclipse-temurin:17-jdk -FROM eclipse-temurin:11-jdk +FROM eclipse-temurin:11.0.13_8-jdk-focal # Default payara ports to expose # 4848: admin console # 9009: debug port (JPDA) # 8080: http # 8181: https -EXPOSE 4848 9009 8080 8181 +EXPOSE 4848 9009 8080 8181 8686 -# Payara version (5.183+) #ARG PAYARA_VERSION=5.2021.9 -ARG PAYARA_VERSION=6.2021.1.Alpha1 -ARG PAYARA_PKG=https://search.maven.org/remotecontent?filepath=fish/payara/distributions/payara/${PAYARA_VERSION}/payara-${PAYARA_VERSION}.zip #ARG PAYARA_SHA1=81c43f3c537ec74a813b48172758866615e1e792 + +ARG PAYARA_VERSION=6.2021.1.Alpha1 ARG PAYARA_SHA1=0262f8af7e52b318109ed43f8a31a1e93f111bbf +ARG PAYARA_PKG=https://search.maven.org/remotecontent?filepath=fish/payara/distributions/payara/${PAYARA_VERSION}/payara-${PAYARA_VERSION}.zip + + ARG TINI_VERSION=v0.19.0 # Initialize the configurable environment variables diff --git a/docker/post-boot-commands.asadmin b/docker/post-boot-commands.asadmin index 409f4fc943c35d3078a28af829fba46c20865794..24fe032cbe721a38c1fad8f66bff3cefbce19a6d 100755 --- a/docker/post-boot-commands.asadmin +++ b/docker/post-boot-commands.asadmin @@ -1,8 +1,8 @@ set-hazelcast-configuration --enabled=true --dynamic=true add-library /tmp/h2.jar -#create-jdbc-connection-pool --datasourceclassname org.h2.jdbcx.JdbcDataSource --restype javax.sql.ConnectionPoolDataSource --property password=password:user=user:url="jdbc:h2:tcp://db:9092/payara;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH" My-H2-pool -create-jdbc-connection-pool --datasourceclassname org.h2.jdbcx.JdbcDataSource --restype javax.sql.ConnectionPoolDataSource --property password=password:user=user:url="jdbc:h2:tcp://db:9092/payara;MODE=PostgreSQL" My-H2-pool +create-jdbc-connection-pool --datasourceclassname org.h2.jdbcx.JdbcDataSource --restype javax.sql.ConnectionPoolDataSource --property password=password:user=user:url="jdbc:h2:tcp://db:9092/payara;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE" My-H2-pool +#create-jdbc-connection-pool --datasourceclassname org.h2.jdbcx.JdbcDataSource --restype javax.sql.ConnectionPoolDataSource --property password=password:user=user:url="jdbc:h2:tcp://db:9092/payara;MODE=PostgreSQL" My-H2-pool create-jdbc-resource --connectionpoolid My-H2-pool jdbc/my-h2-pool # set configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.cert-nickname=mycert diff --git a/entites/src/main/resources/META-INF/beans.xml b/entites/src/main/resources/META-INF/beans.xml index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..efd69bc2d38663ae2f69879265843f8ff04aac04 100644 --- a/entites/src/main/resources/META-INF/beans.xml +++ b/entites/src/main/resources/META-INF/beans.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd" + bean-discovery-mode="all"> +</beans> \ No newline at end of file diff --git a/jee/business/pom.xml b/jee/business/pom.xml index 076aab2e775d1432874bb8bf6c4a73f2d7360658..d0abff1d273ceb289b357595a067db18b9c07d71 100644 --- a/jee/business/pom.xml +++ b/jee/business/pom.xml @@ -30,7 +30,7 @@ <artifactId>maven-ejb-plugin</artifactId> <version>3.1.0</version> <configuration> - <ejbVersion>3.0</ejbVersion> + <ejbVersion>3.1</ejbVersion> <generateClient>true</generateClient> </configuration> </plugin> diff --git a/jee/common-persistence/pom.xml b/jee/common-persistence/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..42c65be118ee46406c5b66b7372a6cc4ca844915 --- /dev/null +++ b/jee/common-persistence/pom.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>jee9.1</artifactId> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>common-persistence</artifactId> + + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> + + <dependencies> + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>entites</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + </dependencies> + +</project> \ No newline at end of file diff --git a/jee/jsf/src/main/resources/META-INF/persistence.xml b/jee/common-persistence/src/main/resources/META-INF/persistence.xml similarity index 100% rename from jee/jsf/src/main/resources/META-INF/persistence.xml rename to jee/common-persistence/src/main/resources/META-INF/persistence.xml diff --git a/jee/jsf/src/main/resources/insert.sql b/jee/common-persistence/src/main/resources/insert.sql similarity index 95% rename from jee/jsf/src/main/resources/insert.sql rename to jee/common-persistence/src/main/resources/insert.sql index e74e7ffef4c148ef8820cf85f012ce24599f7e1f..bc26cbec1c9e96c7327eff7d24737becf81e1455 100644 --- a/jee/jsf/src/main/resources/insert.sql +++ b/jee/common-persistence/src/main/resources/insert.sql @@ -1,4 +1,4 @@ INSERT INTO "public"."person" ("name", "uuid") VALUES ('Yves', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870B25A000916801FE374FCFAC5DCF94C11'); INSERT INTO "public"."person" ("name", "uuid") VALUES ('Pierre', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870B8F28F7D3945291756DAC7325DF44938'); INSERT INTO "public"."person" ("name", "uuid") VALUES ('Marie', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F73745369674269747378709AA3211A9B897403843C82366C6B450E'); -INSERT INTO "public"."person" ("name", "uuid") VALUES ('Jeanne', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870BC1580AEB48C0F0C0B3C82E884AA4C3C'); \ No newline at end of file +INSERT INTO "public"."person" ("name", "uuid") VALUES ('Jeanne', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870BC1580AEB48C0F0C0B3C82E884AA4C3C'); diff --git a/jee/ear/pom.xml b/jee/ear/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..be6d22619290563f3a78034fb65df23eb4b08edd --- /dev/null +++ b/jee/ear/pom.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>jee9.1</artifactId> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>ear</artifactId> + <packaging>ear</packaging> + + <dependencies> + <dependency> + <groupId>jakarta.platform</groupId> + <artifactId>jakarta.jakartaee-api</artifactId> + </dependency> + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>restApp</artifactId> + <version>1.0-SNAPSHOT</version> + <type>war</type> + </dependency> + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>wsApp</artifactId> + <version>1.0-SNAPSHOT</version> + <type>war</type> + </dependency> + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>jsf</artifactId> + <version>1.0-SNAPSHOT</version> + <type>war</type> + </dependency> + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>business</artifactId> + <version>1.0-SNAPSHOT</version> + <type>ejb</type> + </dependency> + + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>dao</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>common-persistence</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + + + </dependencies> + + <build> + <finalName>personManager</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ear-plugin</artifactId> + <version>3.2.0</version> + <configuration> + <version>8</version> + <displayName>Person manager</displayName> + <!-- If I want maven to generate the application.xml, set this to true --> + <generateApplicationXml>true</generateApplicationXml> + <defaultLibBundleDir>lib/</defaultLibBundleDir> + <skinnyWars>true</skinnyWars> + <modules> + <webModule> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>restApp</artifactId> + <!--bundleFileName>restApp.war</bundleFileName--> + </webModule> + <webModule> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>jsf</artifactId> + <!--bundleFileName>jsf.war</bundleFileName--> + </webModule> + <webModule> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>wsApp</artifactId> + <!--bundleFileName>wsApp.war</bundleFileName--> + </webModule> + <ejbModule> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>business</artifactId> + <!--bundleFileName>business.jar</bundleFileName--> + </ejbModule> + <jarModule> + <groupId>fr.univtln.bruno.samples.jee91</groupId> + <artifactId>common-persistence</artifactId> + <bundleDir>lib</bundleDir> + </jarModule> + </modules> + </configuration> + </plugin> + </plugins> + </build> + + +</project> \ No newline at end of file diff --git a/jee/jsf/pom.xml b/jee/jsf/pom.xml index ec52d71953a9d9c80fa3d5d59751abba28808e45..356170b0f809a433ea7696b913b7ba11078d0528 100644 --- a/jee/jsf/pom.xml +++ b/jee/jsf/pom.xml @@ -13,25 +13,15 @@ <properties> <primefaces.version>11.0.0-RC2</primefaces.version> - <!--primefaces.version>11.0.0-SNAPSHOT</primefaces.version--> - <omnifaces.version>4.0-M12</omnifaces.version> <all-themes.version>1.0.10</all-themes.version> </properties> - <!--repositories> - <repository> - <id>prime-repo</id> - <name>PrimeFaces Maven Repository</name> - <url>https://repository.primefaces.org</url> - <layout>default</layout> - </repository> - </repositories--> - <dependencies> <dependency> <groupId>fr.univtln.bruno.samples.jee91</groupId> <artifactId>business</artifactId> <version>1.0-SNAPSHOT</version> + <type>ejb</type> <!--type>ejb-client</type--> </dependency> @@ -41,40 +31,18 @@ <version>1.0-SNAPSHOT</version> </dependency> - <dependency> - <groupId>jakarta.platform</groupId> - <artifactId>jakarta.jakartaee-api</artifactId> - <scope>provided</scope> - </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> </dependency> - <!-- https://mvnrepository.com/artifact/jakarta.faces/jakarta.faces-api --> - <dependency> - <groupId>jakarta.faces</groupId> - <artifactId>jakarta.faces-api</artifactId> - <version>3.0.0</version> - <scope>provided</scope> - </dependency> - - <!--dependency> - <groupId>org.omnifaces</groupId> - <artifactId>omnifaces</artifactId> - <version>${omnifaces.version}</version> - </dependency--> <dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>${primefaces.version}</version> <classifier>jakarta</classifier> </dependency> - <!--dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>all-themes</artifactId> - <version>${all-themes.version}</version> - </dependency--> + </dependencies> <build> diff --git a/jee/jsf/src/main/webapp/index.xhtml b/jee/jsf/src/main/webapp/index.xhtml index f43818fbbdab8bdd6dfaa17173c8bc646063d593..7d188464dc239fab1b7379cc19f73e55ebf4ac6f 100644 --- a/jee/jsf/src/main/webapp/index.xhtml +++ b/jee/jsf/src/main/webapp/index.xhtml @@ -13,7 +13,7 @@ <h3 style="text-align: center"><h:outputText value="#{viewPersonBean.message}"/></h3> <div class="card"> - <p:dataTable var="person" value="#{viewPersonBean.persons}"> + <p:dataTable var="person" value="#{viewPersonBean.persons}" lazy="true"> <p:column headerText="UUID"> <h:outputText value="#{person.uuid}"/> </p:column> diff --git a/jee/pom.xml b/jee/pom.xml index f6c3b84ec17678a45e90071ed7f5cbb68e836889..dd29f03ee2c3631cb3e96f0cb95f64f832b6f429 100644 --- a/jee/pom.xml +++ b/jee/pom.xml @@ -21,6 +21,8 @@ <module>jsf</module> <module>restApp</module> <module>wsApp</module> + <module>ear</module> + <module>common-persistence</module> </modules> <dependencies> @@ -29,14 +31,6 @@ <artifactId>jakarta.jakartaee-api</artifactId> <scope>provided</scope> </dependency> - - <dependency> - <groupId>jakarta.enterprise</groupId> - <artifactId>jakarta.enterprise.cdi-api</artifactId> - <version>3.0.0</version> - <scope>provided</scope> - </dependency> - </dependencies> </project> \ No newline at end of file diff --git a/jee/restApp/pom.xml b/jee/restApp/pom.xml index f5b6c51ef97ce5e3b37aaead485d585fde23dd46..a8195afc1b03a13f4234d2791eb157f79c69d729 100644 --- a/jee/restApp/pom.xml +++ b/jee/restApp/pom.xml @@ -16,6 +16,7 @@ <groupId>fr.univtln.bruno.samples.jee91</groupId> <artifactId>business</artifactId> <version>1.0-SNAPSHOT</version> + <type>ejb</type> <!--type>ejb-client</type--> </dependency> diff --git a/jee/restApp/src/main/java/fr/univtln/bruno/samples/jee91/rs/JAXRSConfiguration.java b/jee/restApp/src/main/java/fr/univtln/bruno/samples/jee91/rs/JAXRSConfiguration.java index ece5bca64f1f17fcfebc60078f3ad54573fa6e56..5e8e933a80afc176a4784d0f0af77724005c9064 100644 --- a/jee/restApp/src/main/java/fr/univtln/bruno/samples/jee91/rs/JAXRSConfiguration.java +++ b/jee/restApp/src/main/java/fr/univtln/bruno/samples/jee91/rs/JAXRSConfiguration.java @@ -4,7 +4,7 @@ package fr.univtln.bruno.samples.jee91.rs; import jakarta.ws.rs.ApplicationPath; import jakarta.ws.rs.core.Application; -@ApplicationPath("resources") +@ApplicationPath("/") public class JAXRSConfiguration extends Application { } \ No newline at end of file diff --git a/jee/restApp/src/main/resources/META-INF/persistence.xml b/jee/restApp/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 18fe3bac73127e9a827bed24e72d412c334bdcc5..0000000000000000000000000000000000000000 --- a/jee/restApp/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<persistence xmlns="https://jakarta.ee/xml/ns/persistence" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" - version="3.0"> - <persistence-unit name="myappPU" transaction-type="JTA"> - <jta-data-source>jdbc/my-h2-pool</jta-data-source> - <class>fr.univtln.bruno.samples.jee91.dao.Person</class> - - <properties> - <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> - <property name="jakarta.persistence.schema-generation.scripts.action" value="drop-and-create" /> - <property name="jakarta.persistence.schema-generation.scripts.create-target" value="sampleCreate.ddl" /> - <property name="jakarta.persistence.schema-generation.scripts.drop-target" value="sampleDrop.ddl" /> - - <property name="jakarta.persistence.sql-load-script-source" value="insert.sql" /> - </properties> - </persistence-unit> -</persistence> \ No newline at end of file diff --git a/jee/restApp/src/main/resources/insert.sql b/jee/restApp/src/main/resources/insert.sql deleted file mode 100644 index e74e7ffef4c148ef8820cf85f012ce24599f7e1f..0000000000000000000000000000000000000000 --- a/jee/restApp/src/main/resources/insert.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO "public"."person" ("name", "uuid") VALUES ('Yves', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870B25A000916801FE374FCFAC5DCF94C11'); -INSERT INTO "public"."person" ("name", "uuid") VALUES ('Pierre', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870B8F28F7D3945291756DAC7325DF44938'); -INSERT INTO "public"."person" ("name", "uuid") VALUES ('Marie', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F73745369674269747378709AA3211A9B897403843C82366C6B450E'); -INSERT INTO "public"."person" ("name", "uuid") VALUES ('Jeanne', 'ACED00057372000E6A6176612E7574696C2E55554944BC9903F7986D852F0200024A000C6C65617374536967426974734A000B6D6F7374536967426974737870BC1580AEB48C0F0C0B3C82E884AA4C3C'); \ No newline at end of file diff --git a/jee/wsApp/pom.xml b/jee/wsApp/pom.xml index 239ed116a5eda283c95616a6f747f52cff95b4a8..ef1b6d125d5964557defd92ff5b58db4f377b6c9 100644 --- a/jee/wsApp/pom.xml +++ b/jee/wsApp/pom.xml @@ -16,6 +16,7 @@ <groupId>fr.univtln.bruno.samples.jee91</groupId> <artifactId>business</artifactId> <version>1.0-SNAPSHOT</version> + <type>ejb</type> <!--type>ejb-client</type--> </dependency> diff --git a/jee/wsApp/src/main/resources/META-INF/persistence.xml b/jee/wsApp/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 2cc799781f7801097a6abc19442f1889451888fd..0000000000000000000000000000000000000000 --- a/jee/wsApp/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<persistence xmlns="https://jakarta.ee/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" - version="3.0"> - <persistence-unit name="myappPU" transaction-type="JTA"> - <jta-data-source>jdbc/my-h2-pool</jta-data-source> - <class>fr.univtln.bruno.samples.jee91.dao.Person</class> - </persistence-unit> -</persistence> \ No newline at end of file diff --git a/pom.xml b/pom.xml index f93700cdfed7355876f66da9e29431d137f05c78..2890842f2fbb5e8bc58e34827130fb38c12d4d60 100644 --- a/pom.xml +++ b/pom.xml @@ -8,20 +8,20 @@ <packaging>pom</packaging> <modules> - <module>wsClient</module> <module>entites</module> <module>utils</module> <module>jee</module> + <module>websocketClient</module> </modules> <properties> <maven.compiler.source>11</maven.compiler.source> <maven.compiler.target>11</maven.compiler.target> - <jakarta.jakartaee-api.version>9.1.0</jakarta.jakartaee-api.version> + <jakarta.jakartaee-api.version>9.0.0</jakarta.jakartaee-api.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <junit-jupiter.version>5.8.1</junit-jupiter.version> + <junit-jupiter.version>5.8.2</junit-jupiter.version> </properties> <dependencyManagement> @@ -41,7 +41,7 @@ <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.20</version> + <version>1.18.22</version> <scope>compile</scope> </dependency> <dependency> @@ -55,10 +55,16 @@ <build> <plugins> <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> + <configuration> + <showDeprecation>true</showDeprecation> + <showWarnings>true</showWarnings> + </configuration> </plugin> <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.2</version> </plugin> @@ -78,6 +84,7 @@ <requireMavenVersion> <version>3.8</version> </requireMavenVersion> + <dependencyConvergence/> </rules> </configuration> </execution> diff --git a/rules.xml b/rules.xml new file mode 100644 index 0000000000000000000000000000000000000000..571d5df6f2f051ffa7b30b47be2bde00e3cdc54f --- /dev/null +++ b/rules.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ruleset xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" comparisonMethod="maven" xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd"> + <ignoreVersions> + <!-- Ignore Alpha's, Beta's, release candidates and milestones --> + <ignoreVersion type="regex">(?i).*Alpha(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">(?i).*a(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">(?i).*Beta(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">(?i).*-B(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">(?i).*RC(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">(?i).*CR(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">(?i).*M(?:-?\d+)?</ignoreVersion> + <ignoreVersion type="regex">.*jre[0-9]+$</ignoreVersion> + </ignoreVersions> + <rules> + </rules> +</ruleset> diff --git a/server.xml b/server.xml deleted file mode 100644 index 7882a0fb550ebc84e56b0825f8ad6464e6b86537..0000000000000000000000000000000000000000 --- a/server.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<server description="new server"> - - <featureManager> - <feature>javaee-9.1</feature> - <feature>microProfile-3.0</feature> - </featureManager> - - <httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443"/> - - <quickStartSecurity userName="duke" userPassword="dukeduke"/> -</server> \ No newline at end of file diff --git a/wsClient/pom.xml b/websocketClient/pom.xml similarity index 100% rename from wsClient/pom.xml rename to websocketClient/pom.xml diff --git a/wsClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java b/websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java similarity index 98% rename from wsClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java rename to websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java index bf1e350d04622d4c2be010f939b38f0d3151213e..3ed86072a8b712266064df3c3a186a1b4103f61f 100644 --- a/wsClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java +++ b/websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java @@ -41,7 +41,7 @@ public class WsClient { public static void main(String[] args) { try { - final WsClient clientEndPoint = new WsClient(new URI("ws://localhost:8080/wsApp-1.0-SNAPSHOT/hellows")); + final WsClient clientEndPoint = new WsClient(new URI("ws://localhost:8686/wsApp/hellows")); clientEndPoint.sendMessage("Hello 1 !"); Thread.sleep(5000); clientEndPoint.sendMessage("Hello 2 !"); diff --git a/wsClient/src/main/resources/log4j.properties b/websocketClient/src/main/resources/META-INF/log4j.properties similarity index 93% rename from wsClient/src/main/resources/log4j.properties rename to websocketClient/src/main/resources/META-INF/log4j.properties index b26344f037fddc8848b1789a4ef4b1f2be4ddb5c..c667f1b0a54f2545b984f7bcfa4370762ee732e6 100644 --- a/wsClient/src/main/resources/log4j.properties +++ b/websocketClient/src/main/resources/META-INF/log4j.properties @@ -7,7 +7,7 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=wqClient.log +log4j.appender.R.File=wsClient.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file