Skip to content
Open

merge #701

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
35 changes: 35 additions & 0 deletions jenkinsfile1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
node
{
mavenHome = tool name: 'Maven 3.9.12'
stage('debug-settings') {
sh "${mavenHome}/bin/mvn help:effective-settings"
}
stage ('checkoutcodegit')
{
git branch: 'development', credentialsId: 'e19dbdde-5445-4170-9c4e-2f518493875a', url: 'https://github.com/nishanthsannagiri1518-gif/maven-web-application.git'
}
stage ('build')
{
sh "${mavenHome}/bin/mvn clean package"
}
stage ('sonarqubeanalysis')
{
withSonarQubeEnv('sonarqube') {
sh "${mavenHome}/bin/mvn sonar:sonar"
}
}
stage ('nexusrepositoryupload')
{
withCredentials([usernamePassword(credentialsId: 'nexus-cred', passwordVariable: 'NEXUS_PASSWD', usernameVariable: 'NEXUS_USER')]) {
sh "${mavenHome}/bin/mvn deploy "
}
}
stage ('deploywebapp')
{
sshagent(['379f77d7-e86d-47d1-8b11-5d5ae2bf7e1d']) {
sh 'scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@54.221.87.9:/opt/tomcat/webapps/'
}
}

}

6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
<spring.version>5.1.2.RELEASE</spring.version>
<junit.version>4.11</junit.version>
<log4j.version>1.2.17</log4j.version>
<!--
<sonar.host.url>http://172.31.33.143:9000/</sonar.host.url>
<sonar.login>admin</sonar.login>
<sonar.password>passw0rd</sonar.password>
-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Expand Down Expand Up @@ -98,13 +100,13 @@
<repository>
<id>nexus</id>
<name>Mithun Technologies Releases Nexus Repository</name>
<url>http://172.31.42.154:9980/mithuntechnologies/repository/canarabank-snapshot/</url>
<url>http://54.242.30.99:8081/repository/flipkart-release/</url>
</repository>

<snapshotRepository>
<id>nexus</id>
<name>Mithun Technologies Snapshot Nexus Repository </name>
<url>http://172.31.42.154:9980/mithuntechnologies/repository/canarabank-release/</url>
<url>http://54.242.30.99:8081/repository/flipkart-snapshot/</url>
</snapshotRepository>

</distributionManagement>
Expand Down