From 925e133c9aa93b32ad7a3b471117e5d63d5c4e28 Mon Sep 17 00:00:00 2001 From: hummel Date: Fri, 21 Jun 2024 17:16:47 +0200 Subject: [PATCH] Initial --- MvnDemo/.gitignore | 4 + MvnDemo/.settings/.gitignore | 3 + MvnDemo/pom.xml | 107 ++++++++++++++++++ .../de/hs_mannheim/informatik/mvn/Main.java | 14 +++ .../hs_mannheim/informatik/mvn/AddTest.java | 13 +++ 5 files changed, 141 insertions(+) create mode 100644 MvnDemo/.gitignore create mode 100644 MvnDemo/.settings/.gitignore create mode 100644 MvnDemo/pom.xml create mode 100644 MvnDemo/src/main/java/de/hs_mannheim/informatik/mvn/Main.java create mode 100644 MvnDemo/src/test/java/de/hs_mannheim/informatik/mvn/AddTest.java diff --git a/MvnDemo/.gitignore b/MvnDemo/.gitignore new file mode 100644 index 0000000..f8029f6 --- /dev/null +++ b/MvnDemo/.gitignore @@ -0,0 +1,4 @@ +/target/ +/.DS_Store +/.classpath +/.project diff --git a/MvnDemo/.settings/.gitignore b/MvnDemo/.settings/.gitignore new file mode 100644 index 0000000..1de83a6 --- /dev/null +++ b/MvnDemo/.settings/.gitignore @@ -0,0 +1,3 @@ +/org.eclipse.core.resources.prefs +/org.eclipse.jdt.core.prefs +/org.eclipse.m2e.core.prefs diff --git a/MvnDemo/pom.xml b/MvnDemo/pom.xml new file mode 100644 index 0000000..dc20d1e --- /dev/null +++ b/MvnDemo/pom.xml @@ -0,0 +1,107 @@ + + 4.0.0 + de.hs_mannheim + MvnDemo + 0.0.1-SNAPSHOT + + + UTF-8 + 21 + 21 + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.1 + test + + + + org.junit.jupiter + junit-jupiter-engine + 5.8.1 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + + de.hs_mannheim.informatik.mvn.Main + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + prepare-agent + + + + report + test + + report + + + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.22.0 + + + verify + + check + + + + + + + + + + \ No newline at end of file diff --git a/MvnDemo/src/main/java/de/hs_mannheim/informatik/mvn/Main.java b/MvnDemo/src/main/java/de/hs_mannheim/informatik/mvn/Main.java new file mode 100644 index 0000000..7701ef5 --- /dev/null +++ b/MvnDemo/src/main/java/de/hs_mannheim/informatik/mvn/Main.java @@ -0,0 +1,14 @@ +package de.hs_mannheim.informatik.mvn; + +public class Main { + + public static void main(String[] args) { + System.out.println("Hallo Maven!"); + + System.out.println(new Main().add(3, 4)); + } + + public int add(int a, int b) { + return a + b; + } +} diff --git a/MvnDemo/src/test/java/de/hs_mannheim/informatik/mvn/AddTest.java b/MvnDemo/src/test/java/de/hs_mannheim/informatik/mvn/AddTest.java new file mode 100644 index 0000000..7bba4b1 --- /dev/null +++ b/MvnDemo/src/test/java/de/hs_mannheim/informatik/mvn/AddTest.java @@ -0,0 +1,13 @@ +package de.hs_mannheim.informatik.mvn; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +class AddTest { + + @Test + void test() { + assertEquals(7, new Main().add(3, 4)); + } + +}