Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Jenkins+gradle/maven+sonar+pipline

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Summary:

When gradle is configured to access sonar, it is necessary to introduce a sonar plug-in into the build.gradle configuration, but not for maven.

Jenkins pipline maven configuration:

Stage ('SonarQube analysis') {

WithSonarQubeEnv ('Sonar') {

Sh'/ usr/local/maven/bin/mvn sonar:sonar-Dsonar.projectName=CTS-capital'

}

}

Jenkins pipline gradle configuration: (build.gradle configuration needs to be modified)

Stage ('SonarQube analysis') {

WithSonarQubeEnv ('Sonar') {

Sh''

Cd mall-page/

/ opt/software/gradle-4.8/bin/gradle sonarqube-Dsonar.projectName=MMD-mall-page

''

}

}

The builid.gradle is modified as follows: the first one requires the introduction of local packages, and the second one calls online packages.

Using the plugins DSL:

Plugins {

Id "org.sonarqube" version "2.7.1"

}

Using legacy plugin application:

Buildscript {

Repositories {

Maven {

Url "https://plugins.gradle.org/m2/"

}

}

Dependencies {

Classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"

}

}

Apply plugin: "org.sonarqube"

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report