Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ pipeline{
}

stages{
stage('Clean Workspace') {
steps {
deleteDir()
}
}

stage('checkout'){
steps{
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'github access', url: 'https://github.com/sreenivas449/java-hello-world-with-maven.git']]])
}
}
stage('build'){
steps{
bat 'mvn package'
sh 'mvn package'
}
}
}
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ This guide walks you through using Maven to build a simple Java project.
## What you’ll build
You’ll create an application that provides the time of day and then build it with Maven.


## What you’ll need
+ A favorite text editor or IDE
+
+ JDK 6 or later
+ Install Maven

Expand Down
1 change: 1 addition & 0 deletions abc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bvjbjbdchjdcbnvjcnvcdcdjncdndjj
26 changes: 26 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 0.2

phases:
install:
runtime-versions:
java: corretto17
commands:
- echo "Installing dependencies"

pre_build:
commands:
- echo "Starting Maven build"
- mvn clean

build:
commands:
- mvn package

post_build:
commands:
- echo "Build completed successfully"

artifacts:
files:
- target/*.jar

19 changes: 14 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<version>0.2.0</version>

<!-- tag::joda[] -->
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>


<dependencies>
<dependency>
Expand All @@ -25,6 +25,15 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
New change
New change