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
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>my-java-17-project</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<dependencies>
</dependencies>
</project>
27 changes: 24 additions & 3 deletions sonarqube/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pipeline{
agent any
environment {
PATH = "$PATH:/opt/apache-maven-3.8.2/bin"
PATH = "$PATH:/usr/share/maven/bin"
}
stages{
stage('GetCode'){
steps{
git 'https://github.com/ravdy/javaloginapp.git'
git 'https://github.com/saikrishna-M-8520/DevOps.git'
}
}
stage('Build'){
Expand All @@ -17,13 +17,34 @@ pipeline{
stage('SonarQube analysis') {
// def scannerHome = tool 'SonarScanner 4.0';
steps{
withSonarQubeEnv('sonarqube-8.9') {
withSonarQubeEnv('sonarqube-8.3') {
// If you have configured more than one global server connection, you can specify its name
// sh "${scannerHome}/bin/sonar-scanner"
sh "mvn sonar:sonar"
}
}
}
stage('Upload jar To Nexus'){
steps{
script{
nexusArtifactUploader artifacts: [
[
artifactId: 'my-java-17-project',
classifier: '',
file: "target/my-java-17-project-1.0-SNAPSHOT.jar",
type: 'jar'
]
],
credentialsId: 'nexus3',
groupId: 'com.mycompany.app',
nexusUrl: '54.236.196.83:8081',
nexusVersion: 'nexus3',
protocol: 'http',
repository: 'vprofile-release',
version: '1'
}
}
}

}
}