diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..5fab4de --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent any + + tools { + maven "MAVEN" + } + + stages { + stage('Initialize'){ + steps{ + echo "PATH = ${M2_HOME}/bin:${PATH}" + echo "M2_HOME = /opt/maven" + } + } + stage('Build') { + steps { + dir("/var/lib/jenkins/workspace/Maven-Jenkins222/my-app/my-app") { + sh 'mvn -B -DskipTests clean package' + } + + } + } + } + post { + always { + junit( + allowEmptyResults: true, + testResults: '*/test-reports/.xml' + ) + } + } +} diff --git a/eaxmple.txt b/eaxmple.txt new file mode 100644 index 0000000..bfce019 --- /dev/null +++ b/eaxmple.txt @@ -0,0 +1 @@ +sampleprojecfffhhht diff --git a/echo.txt b/echo.txt new file mode 100644 index 0000000..1f38c8d --- /dev/null +++ b/echo.txt @@ -0,0 +1 @@ +this is a sample text file diff --git a/my-app/pom.xml b/my-app/my-app/pom.xml similarity index 100% rename from my-app/pom.xml rename to my-app/my-app/pom.xml diff --git a/my-app/my-app/src/main/java/com/mycompany/app/App.java b/my-app/my-app/src/main/java/com/mycompany/app/App.java new file mode 100644 index 0000000..77cf3e0 --- /dev/null +++ b/my-app/my-app/src/main/java/com/mycompany/app/App.java @@ -0,0 +1,13 @@ +package com.mycompany.app; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/my-app/my-app/src/test/java/com/mycompany/app/AppTest.java b/my-app/my-app/src/test/java/com/mycompany/app/AppTest.java new file mode 100644 index 0000000..81ac345 --- /dev/null +++ b/my-app/my-app/src/test/java/com/mycompany/app/AppTest.java @@ -0,0 +1,20 @@ +package com.mycompany.app; + +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/sample.txt b/sample.txt new file mode 100644 index 0000000..cc8f60d --- /dev/null +++ b/sample.txt @@ -0,0 +1 @@ +uhhh:wq: diff --git a/testcase1.txt b/testcase1.txt new file mode 100644 index 0000000..ebda4dd --- /dev/null +++ b/testcase1.txt @@ -0,0 +1,2 @@ + +hhfhfhfh diff --git a/testcase2.txt b/testcase2.txt new file mode 100644 index 0000000..92f5ff5 --- /dev/null +++ b/testcase2.txt @@ -0,0 +1 @@ +hhhhh