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)); + } + +}