From 4cb20471b70ade186edab907477694c8d4a1c0e5 Mon Sep 17 00:00:00 2001 From: Herobane Date: Tue, 1 Aug 2023 00:34:15 +0200 Subject: [PATCH] + Added base files --- .vscode/tasks.json | 25 +++++ Dockerfile | 5 + pom.xml | 93 +++++++++++++++++++ src/main/java/fr/sixthemes/SixDeploy.java | 25 +++++ src/main/webapp/WEB-INF/web.xml | 8 ++ src/test/java/fr/sixthemes/AppTest.java | 20 ++++ target/sixdeploy-1.0-SNAPSHOT/WEB-INF/web.xml | 8 ++ 7 files changed, 184 insertions(+) create mode 100644 .vscode/tasks.json create mode 100644 Dockerfile create mode 100644 pom.xml create mode 100644 src/main/java/fr/sixthemes/SixDeploy.java create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/test/java/fr/sixthemes/AppTest.java create mode 100644 target/sixdeploy-1.0-SNAPSHOT/WEB-INF/web.xml diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..73e2f80 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "compile", + "type": "shell", + "command": "mvn -B compile", + "group": "build" + }, + { + "label": "dockerBuild", + "type": "shell", + "command": "docker build -t sixdeploy:latest .", + "group": "build" + }, + { + "label": "test", + "type": "shell", + "command": "mvn -B test", + "group": "test" + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c062baa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM tomcat:9.0 + +COPY target/sixdeploy-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/ + +CMD ["catalina.sh", "run"] \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5088ed9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,93 @@ + + + + 4.0.0 + + fr.sixthemes + sixdeploy + 1.0-SNAPSHOT + war + + sixdeploy + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + javax.servlet + jstl + 1.2 + + + javax + javaee-web-api + 8.0 + provided + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/src/main/java/fr/sixthemes/SixDeploy.java b/src/main/java/fr/sixthemes/SixDeploy.java new file mode 100644 index 0000000..c59e7b7 --- /dev/null +++ b/src/main/java/fr/sixthemes/SixDeploy.java @@ -0,0 +1,25 @@ +package fr.sixthemes; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@WebServlet(urlPatterns = "/sixdeploy") +public class SixDeploy extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + PrintWriter out = resp.getWriter(); + + out.println("

Hello Tomcat !!

"); + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + } +} diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..4a4137d --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,8 @@ + + To do List + + sixdeploy + + diff --git a/src/test/java/fr/sixthemes/AppTest.java b/src/test/java/fr/sixthemes/AppTest.java new file mode 100644 index 0000000..4317ab1 --- /dev/null +++ b/src/test/java/fr/sixthemes/AppTest.java @@ -0,0 +1,20 @@ +package fr.sixthemes; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/target/sixdeploy-1.0-SNAPSHOT/WEB-INF/web.xml b/target/sixdeploy-1.0-SNAPSHOT/WEB-INF/web.xml new file mode 100644 index 0000000..4a4137d --- /dev/null +++ b/target/sixdeploy-1.0-SNAPSHOT/WEB-INF/web.xml @@ -0,0 +1,8 @@ + + To do List + + sixdeploy + +