Help with projectKey and projectName having always the same value on my projects

SonarQube version: 8.5.1.38104
Plugin: org.sonarqube version 3.0 for gradle

Every time I start a new project and run Sonarqube, it goes to my localhost server with the same name and key and I can’t change it.

I want to fix not only the project but the problem itself, as the projectKey and projectName are from an older project, which has nothing to do with this one (I used the sonarqube-scanner for this old project, it was a node + Angular project).

I have tried to delete and redownload Sonarqube as a zip, changing the project folder, creating the following Gradle entry:

sonarqube{
    properties  {
        property "sonar.projectName", "newName"
        property "sonar.projectKey", "newName"
    }
}

Creating a sonar-project.properties with the configuration:

sonar.projectKey=newName
sonar.projectName=newName

I have deleted the old project as well.

I have a project created by someone else, where this problem has not happened, it’s an Angular + node project;

There are other people in this project, and their Sonarqube work without any of the above changes or implementation, Sonarqube get the information from the project setting without a problem.

This is the server backlog:

peasyparser is the old project and botersureapi is the new one.

Scanner Context: peasyparser [Project Analysis]

SonarQube plugins:
  - Python Code Quality and Security 3.1.0.7619 (python)
  - CSS Code Quality and Security 1.3.1.1642 (cssfamily)
  - JaCoCo 1.1.0.898 (jacoco)
  - SonarGo 1.6.0.719 (go)
  - SonarKotlin 1.5.0.315 (kotlin)
  - JavaScript/TypeScript Code Quality and Security 6.5.0.13383 (javascript)
  - SonarRuby 1.5.0.315 (ruby)
  - SonarScala 1.5.0.315 (sonarscala)
  - C# Code Quality and Security 8.13.1.21947 (csharp)
  - Java Code Quality and Security 6.8.0.23379 (java)
  - SonarHTML 3.2.0.2082 (web)
  - SonarFlex 2.5.1.1831 (flex)
  - SonarXML 2.0.1.2020 (xml)
  - PHP Code Quality and Security 3.9.0.6331 (php)
  - VB.NET Code Quality and Security 8.13.1.21947 (vbnet)
Global server settings:
  - sonar.core.id=BF41A1F2-AXXDC9u7VZq7yGT3MZNE
  - sonar.core.startTime=2020-11-13T17:34:34-0300
Project server settings:
Project scanner properties:
  - sonar.binaries=I:\Projetos\New folder\botersure\botersureapi\build\classes\java\main
  - sonar.coverage.exclusions=**/*.js,src/main.ts,src/polyfills.ts,**/*environment*.ts,**/*module.ts
  - sonar.coverage.jacoco.xmlReportPaths=I:\Projetos\New folder\botersure\botersureapi\build\reports\jacoco\test\jacocoTestReport.xml
  - sonar.exclusions=**/node_modules/**
  - sonar.host.url=http://localhost:9000
  - sonar.jacoco.reportPath=I:\Projetos\New folder\botersure\botersureapi\build\jacoco\test.exec
  - sonar.jacoco.reportPaths=I:\Projetos\New folder\botersure\botersureapi\build\jacoco\test.exec
  - sonar.java.binaries=I:\Projetos\New folder\botersure\botersureapi\build\classes\java\main
  - sonar.java.libraries=C:\Users\arche\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt-api\0.11.1\4a94011bfb3021579c93274fa12533b17b9326c0\jjwt-api-0.11.1.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.json\json\20200518\41a767de4bde8f01d53856b905c49b2db8862f13\json-20200518.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-mail\2.3.4.RELEASE\f64c8dab2275899ff139f57ffa5cbe5f1353965d\spring-boot-starter-mail-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-security\2.3.4.RELEASE\c7cba64ec709aab550dbbeb9a97acc50d88f6f70\spring-boot-starter-security-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-rest\2.3.4.RELEASE\e056cd301c9a30460c15dc3454cca3669bf777b5\spring-boot-starter-data-rest-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\2.3.4.RELEA...
  - sonar.java.source=11
  - sonar.java.target=11
  - sonar.java.test.binaries=I:\Projetos\New folder\botersure\botersureapi\build\classes\java\test
  - sonar.java.test.libraries=I:\Projetos\New folder\botersure\botersureapi\build\classes\java\main,I:\Projetos\New folder\botersure\botersureapi\build\resources\main,C:\Users\arche\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt-api\0.11.1\4a94011bfb3021579c93274fa12533b17b9326c0\jjwt-api-0.11.1.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.json\json\20200518\41a767de4bde8f01d53856b905c49b2db8862f13\json-20200518.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-mail\2.3.4.RELEASE\f64c8dab2275899ff139f57ffa5cbe5f1353965d\spring-boot-starter-mail-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-security\2.3.4.RELEASE\c7cba64ec709aab550dbbeb9a97acc50d88f6f70\spring-boot-starter-security-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-rest\2.3.4.RELEASE\e056cd301c9a30460c15dc3454cca3669bf777b5\spring-boot-starter-d...
  - sonar.javascript.lcov.reportPaths=coverage/peasyparser/lcov.info
  - sonar.junit.reportPaths=I:\Projetos\New folder\botersure\botersureapi\build\test-results\test
  - sonar.junit.reportsPath=I:\Projetos\New folder\botersure\botersureapi\build\test-results\test
  - sonar.libraries=C:\Users\arche\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt-api\0.11.1\4a94011bfb3021579c93274fa12533b17b9326c0\jjwt-api-0.11.1.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.json\json\20200518\41a767de4bde8f01d53856b905c49b2db8862f13\json-20200518.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-mail\2.3.4.RELEASE\f64c8dab2275899ff139f57ffa5cbe5f1353965d\spring-boot-starter-mail-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-security\2.3.4.RELEASE\c7cba64ec709aab550dbbeb9a97acc50d88f6f70\spring-boot-starter-security-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-rest\2.3.4.RELEASE\e056cd301c9a30460c15dc3454cca3669bf777b5\spring-boot-starter-data-rest-2.3.4.RELEASE.jar,C:\Users\arche\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\2.3.4.RELEA...
  - sonar.login=******
  - sonar.password=******
  - sonar.projectBaseDir=I:\Projetos\New folder\botersure\botersureapi
  - sonar.projectKey=peasyparser
  - sonar.projectName=peasyparser
  - sonar.projectVersion=0.0.1-SNAPSHOT
  - sonar.scanner.app=ScannerGradle
  - sonar.scanner.appVersion=3.0-SNAPSHOT/6.6.1
  - sonar.sourceEncoding=UTF-8
  - sonar.sources=src
  - sonar.surefire.reportsPath=I:\Projetos\New folder\botersure\botersureapi\build\test-results\test
  - sonar.test.inclusions=**/*.spec.ts,**/*test.ts, npm test
  - sonar.tests=src
  - sonar.working.directory=I:\Projetos\New folder\botersure\botersureapi\build\sonar

HI @JHec,

Welcome to the Community! :smiley:

Unless it’s overridden, the Gradle scanner normally picks up the rootProject.name from your settings.gradle file to use as both the project key and project name. Have you reused a settings.gradle file from the old project and forgotten to update the rootProject.name?

Cheers,

Cameron.

Hi Cameron,

Thank you.

It does not seem to be the case,

My sonar scanner is completely ignoring any try to override and change any configuration, I change my sonar server to run on port 9005 for test and I’m changing my files to see if any configuration is making a difference.

sonar-scanner.properties pn the sonar-scanner folder


#----- Default SonarQube server

sonar.host.url=http://localhost:9005

setting.gradle on the root project


rootProject.name = 'botersure'

gradle.properties on the root project


systemProp.sonar.host.url=http://localhost:9005

systemProp.sonar.projectKey=botersure

systemProp.sonar.projectName=botersure

build.gradle on the subproject


sonarqube {

properties {

property "sonar.projectName", "botersureapi"

property "sonar.projectKey", "botersureapi"

}

}

gradle.properties on the subproject


systemProp.sonar.host.url=http://localhost:9005

systemProp.sonar.projectKey=botersureapi

systemProp.sonar.projectName=botersureapi

All of the above end up failing to connect to the sonarqube serve on port 9005 and before the change on the connection port, all ended up with the wrong project name and key.

I can confirm that my sonarqube server is running on http://localhost:9005.

I am searching for any file that could be outside the installation folder since after deleting and reinstalling the sonar scanner still seems to be getting the wrong configuration.

Changed the port back to 9000 for testing and getting a scan https://scans.gradle.com/s/tnfi53rcv6jxe

And also add a settings.gradle on the subproject folder


rootProject.name='botersureapi'

Thank you for your time.

Hi @JHec,

Thanks for the details. I’m a little confused, because you mention configuration for both the CLI Scanner (_sonar-project.properties) and the Scanner for Gradle. Can you show me how you’re building the project and invoking the SonarQube scan?

Regards,

Cameron.

Hi @Cameron,

I’m trying all the possibles configuration files, the sonar-project. properties were not originally in this project, I’m using a copy of the project to try different approaches,

For building the project I’m using the gradle build command inside botersure project where the build.gradle is empty and the settings.gradle is:

rootProject.name = 'botersure'

include 'botersureapi'
include 'xmlparser'

To create the sonarqube report locally I’m inside the botersureapi folder using the gradle sonarqube command.

botersureapi build.gradle

plugins {
   id 'org.springframework.boot' version '2.3.4.RELEASE'
    id 'io.spring.dependency-management' version '1.0.10.RELEASE'
    id 'java'
    id "org.sonarqube" version "3.0"
    id 'jacoco'
}

group = 'dev.boter'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'io.jsonwebtoken:jjwt-api:0.11.1'
    runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.1'
    runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.1'
    implementation 'org.json:json:20200518'
    implementation 'org.springframework.boot:spring-boot-starter'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0'
    implementation 'mysql:mysql-connector-java:8.0.21'
    implementation 'com.sendgrid:sendgrid-java:4.6.7'
    implementation 'org.springframework.boot:spring-boot-starter-data-rest'
    implementation 'org.springframework.boot:spring-boot-starter-mail'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.session:spring-session-core'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'mysql:mysql-connector-java:8.0.21'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    testImplementation 'org.springframework.security:spring-security-test'
    testImplementation(platform('org.junit:junit-bom:5.7.0'))
    testImplementation('org.junit.jupiter:junit-jupiter')
}

sonarqube{
    properties  {
        property "sonar.projectName", "botersureapi"
        property "sonar.projectKey", "botersureapi"
    }
}

test {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
    }
    finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
    reports {
        xml.enabled true
    }
    dependsOn test // tests are required to run before generating the report
}

botersureapi gradle.properties

systemProp.sonar.host.url=http://localhost:9005
systemProp.sonar.projectKey=botersureapi
systemProp.sonar.projectName=botersureapi

botersureapi .project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
   <name>botersureapi</name>
   <comment>Project botersureapi created by Buildship.</comment>
   <projects>
   </projects>
   <buildSpec>
      <buildCommand>
         <name>org.eclipse.jdt.core.javabuilder</name>
         <arguments>
         </arguments>
      </buildCommand>
      <buildCommand>
         <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
         <arguments>
         </arguments>
      </buildCommand>
   </buildSpec>
   <natures>
      <nature>org.eclipse.jdt.core.javanature</nature>
      <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
   </natures>
   <filteredResources>
      <filter>
         <id>1603718065503</id>
         <name></name>
         <type>30</type>
         <matcher>
            <id>org.eclipse.core.resources.regexFilterMatcher</id>
            <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
         </matcher>
      </filter>
   </filteredResources>
</projectDescription>

In the end, the project seems to be set to this:
./botersureapi/build/sonar/.report-task.txt

projectKey=peasyparser
serverUrl=http://localhost:9000
serverVersion=8.5.1.38104
dashboardUrl=http://localhost:9000/dashboard?id=peasyparser
ceTaskId=AXX1XvAcS8k5QewUp_Wz
ceTaskUrl=http://localhost:9000/api/ce/task?id=AXX1XvAcS8k5QewUp_Wz

Thank you for your time.

Hi @JHec,

Thanks for your patience here. This is very strange behaviour, because this block of config should give you the right outcome:

sonarqube{
    properties  {
        property "sonar.projectName", "botersureapi"
        property "sonar.projectKey", "botersureapi"
    }
}

I have a couple of suggestions. First is to see where the properties are coming from.

gradle properties

should give you a list of any global properties that might be pushing through from global config.

Then you could put the following in your build.gradle file and run ./gradlew printSonarProperties

task printSonarqubeProperties {
    doLast {
        println "Name " + "${project.tasks['sonarqube'].properties['sonar.projectName']}"
        println "Key " + "${project.tasks['sonarqube'].properties['sonar.projectKey']}"
    }
}

Finally (and this is a long shot) I wonder if Gradle is doing some caching here. Can you re-run the gradle sonarqube step with the --no-build-cache option?

Regards,

Cameron.

Hi @Cameron,

Thank you very much for your time and patience,

This is the result of the gradle properties:


------------------------------------------------------------

Root project

------------------------------------------------------------

allprojects: [root project 'botersureapi']

ant: org.gradle.api.internal.project.DefaultAntBuilder@523819d0

antBuilderFactory: org.gradle.api.internal.project.DefaultAntBuilderFactory@2c39a420

archivesBaseName: botersureapi

artifacts: org.gradle.api.internal.artifacts.dsl.DefaultArtifactHandler_Decorated@55d03c3b

asDynamicObject: DynamicObject for root project 'botersureapi'

autoTargetJvmDisabled: false

baseClassLoaderScope: org.gradle.api.internal.initialization.DefaultClassLoaderScope@65f187b5

buildDir: I:\Projetos\New folder\botersure\botersureapi\build

buildFile: I:\Projetos\New folder\botersure\botersureapi\build.gradle

buildPath: :

buildScriptSource: org.gradle.groovy.scripts.TextResourceScriptSource@7795f442

buildscript: org.gradle.api.internal.initialization.DefaultScriptHandler@166c4634

childProjects: {}

class: class org.gradle.api.internal.project.DefaultProject_Decorated

classLoaderScope: org.gradle.api.internal.initialization.DefaultClassLoaderScope@42898126

compileJava: task ':compileJava'

compileTestJava: task ':compileTestJava'

components: SoftwareComponentInternal set

configurationActions: org.gradle.configuration.project.DefaultProjectConfigurationActionContainer@2b2c6aed

configurationTargetIdentifier: org.gradle.configuration.ConfigurationTargetIdentifier$1@73c3bc2e

configurations: configuration container

convention: org.gradle.internal.extensibility.DefaultConvention@76a1984

defaultArtifacts: extension 'defaultArtifacts'

defaultTasks: []

deferredProjectConfiguration: org.gradle.api.internal.project.DeferredProjectConfiguration@9e428fe

dependencies: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@41d7502d

dependencyLocking: org.gradle.internal.locking.DefaultDependencyLockingHandler_Decorated@2f1bb6f5

dependencyManagement: io.spring.gradle.dependencymanagement.internal.dsl.StandardDependencyManagementExtension@78ea3cab

depth: 0

description: null

displayName: root project 'botersureapi'

distsDir: I:\Projetos\New folder\botersure\botersureapi\build\distributions

distsDirName: distributions

distsDirectory: property(org.gradle.api.file.Directory, map(org.gradle.api.file.Directory property(org.gradle.api.file.Directory, fixed(class org.

gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, I:\Projetos\New folder\botersure\botersureapi\build)) org.gradle.api.internal.

file.DefaultFilePropertyFactory$PathToDirectoryTransformer@50615890))

docsDir: I:\Projetos\New folder\botersure\botersureapi\build\docs

docsDirName: docs

ext: org.gradle.internal.extensibility.DefaultExtraPropertiesExtension@2bcc2c89

extensions: org.gradle.internal.extensibility.DefaultConvention@76a1984

fileOperations: org.gradle.api.internal.file.DefaultFileOperations@59129b1b

fileResolver: org.gradle.api.internal.file.BaseDirFileResolver@70b4fbf6

gradle: build 'botersureapi'

group: dev.boter

identityPath: :

inheritedScope: org.gradle.internal.extensibility.ExtensibleDynamicObject$InheritedDynamicObject@2acb98a8

jacoco: extension 'jacoco'

jacocoTestReport: task ':jacocoTestReport'

java: extension 'java'

javaInstalls: org.gradle.jvm.toolchain.internal.DefaultJavaInstallationRegistry@6029511c

layout: org.gradle.api.internal.file.DefaultProjectLayout@2d2ed441

libsDir: I:\Projetos\New folder\botersure\botersureapi\build\libs

libsDirName: libs

libsDirectory: property(org.gradle.api.file.Directory, map(org.gradle.api.file.Directory property(org.gradle.api.file.Directory, fixed(class org.g

radle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, I:\Projetos\New folder\botersure\botersureapi\build)) org.gradle.api.internal.f

ile.DefaultFilePropertyFactory$PathToDirectoryTransformer@7a12e159))

listenerBuildOperationDecorator: org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator@c6a286b

logger: org.gradle.internal.logging.slf4j.OutputEventListenerBackedLogger@1f2d1911

logging: org.gradle.internal.logging.services.DefaultLoggingManager@26e1294b

model: project :

modelIdentityDisplayName: null

modelRegistry: org.gradle.model.internal.registry.DefaultModelRegistry@7db66d0a

modelSchemaStore: org.gradle.model.internal.manage.schema.extract.DefaultModelSchemaStore@7e1b63dc

module: org.gradle.api.internal.artifacts.ProjectBackedModule@35aac62e

mutationState: project :

name: botersureapi

normalization: org.gradle.normalization.internal.DefaultInputNormalizationHandler_Decorated@10c353cc

objects: org.gradle.api.internal.model.DefaultObjectFactory@4d3708cf

parent: null

parentIdentifier: null

path: :

pluginManager: org.gradle.api.internal.plugins.DefaultPluginManager_Decorated@6233cb53

plugins: [org.gradle.api.plugins.HelpTasksPlugin@2c232422, org.gradle.buildinit.plugins.BuildInitPlugin@26745f59, org.gradle.buildinit.plugins.Wra

pperPlugin@53704a28, org.springframework.boot.gradle.plugin.SpringBootPlugin@2fe56a46, io.spring.gradle.dependencymanagement.DependencyManagementP

lugin@1a5259ac, org.sonarqube.gradle.SonarQubePlugin@1ed85328, org.gradle.language.base.plugins.LifecycleBasePlugin@4fa86bd1, org.gradle.api.plugi

ns.BasePlugin@4b1b9f38, org.gradle.api.plugins.ReportingBasePlugin@438c20ce, org.gradle.api.plugins.JavaBasePlugin@1f916a84, org.gradle.api.plugin

s.JavaPlugin@13eb6c44, org.gradle.testing.jacoco.plugins.JacocoPlugin@41ed35e]

printSonarqubeProperties: task ':printSonarqubeProperties'

processOperations: org.gradle.process.internal.DefaultExecActionFactory$DecoratingExecActionFactory@26360943

project: root project 'botersureapi'

projectConfigurator: org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator@32e7924b

projectDir: I:\Projetos\New folder\botersure\botersureapi

projectEvaluationBroadcaster: ProjectEvaluationListener broadcast

projectEvaluator: org.gradle.configuration.project.LifecycleProjectEvaluator@7a26411f

projectPath: :

projectRegistry: org.gradle.api.internal.project.DefaultProjectRegistry@850f926

properties: {...}

providers: org.gradle.api.internal.provider.DefaultProviderFactory_Decorated@1e3a957e

publicType: org.gradle.api.plugins.BasePluginConvention

reporting: extension 'reporting'

reportsDir: I:\Projetos\New folder\botersure\botersureapi\build\reports

repositories: repository container

resources: org.gradle.api.internal.resources.DefaultResourceHandler@10c12938

rootDir: I:\Projetos\New folder\botersure\botersureapi

rootProject: root project 'botersureapi'

script: false

scriptHandlerFactory: org.gradle.api.internal.initialization.DefaultScriptHandlerFactory@5827ac86

scriptPluginFactory: org.gradle.configuration.ScriptPluginFactorySelector@5731f76d

serviceRegistryFactory: org.gradle.internal.service.scopes.ProjectScopeServices$$Lambda$555/0x000000080112b840@68f8445d

services: ProjectScopeServices

sonarqube: extension 'sonarqube'

sourceCompatibility: 11

sourceSets: SourceSet container

springBoot: extension 'springBoot'

standardOutputCapture: org.gradle.internal.logging.services.DefaultLoggingManager@26e1294b

state: project state 'EXECUTED'

status: integration

subprojects: []

systemProp.sonar.coverage.exclusions: **/*.js,src/main.ts,src/polyfills.ts,**/*environment*.ts,**/*module.ts

systemProp.sonar.exclusions: **/node_modules/**

systemProp.sonar.host.url: http://localhost:9000

systemProp.sonar.javascript.lcov.reportPaths: coverage/peasyparser/lcov.info

systemProp.sonar.projectKey: peasyparser

systemProp.sonar.projectName: peasyparser

systemProp.sonar.sourceEncoding: UTF-8

systemProp.sonar.sources: src

systemProp.sonar.test.inclusions: **/*.spec.ts,**/*test.ts, npm test

systemProp.sonar.tests: src

targetCompatibility: 11

taskThatOwnsThisObject: null

tasks: task set

test: task ':test'

testReportDir: I:\Projetos\New folder\botersure\botersureapi\build\reports\tests

testReportDirName: tests

testResultsDir: I:\Projetos\New folder\botersure\botersureapi\build\test-results

testResultsDirName: test-results

version: 0.0.1-SNAPSHOT

and this was the result of the gradlew printSonarProperties


> Task :botersureapi:printSonarqubeProperties

Name peasyparser

Key peasyparser

gradle sonarqube --no-build-cache Did not change the result.

There is any way for me to reset the sonar configuration on my computer?

It seems that when I tried to use Gradle to build a node project and run sonarqube I messed up the configuration on a global level. All the systemProp configurations are the same as the peasyparser project.

Thank you again for your time.

Hi @JHec,

I think the problem is here:

Gradle system properties (tagged by systemProp.) are set at the global level. In my (minimal) Gradle setup, for example, they’re set in my $(USER_HOME)/.gradle/gradle.properties file. Can you check there?

Regards,

Cameron.

Hi @Cameron,

This is the file,

# gradle.properties
systemProp.sonar.host.url=http://localhost:9000
 
#----- Token generated from an account with 'publish analysis' permission
systemProp.sonar.login=********
systemProp.sonar.password=********

systemProp.sonar.projectKey=peasyparser
systemProp.sonar.projectName=peasyparser
systemProp.sonar.sourceEncoding=UTF-8
systemProp.sonar.sources=src
systemProp.sonar.exclusions=**/node_modules/**
systemProp.sonar.tests=src
systemProp.sonar.test.inclusions=**/*.spec.ts,**/*test.ts, npm test
systemProp.sonar.javascript.lcov.reportPaths=coverage/peasyparser/lcov.info
systemProp.sonar.coverage.exclusions=**/*.js,src/main.ts,src/polyfills.ts,**/*environment*.ts,**/*module.ts

Deleting these properties solved the problem.

Thank you very much for all your help, this was driving me crazy.

Hi @JHec,

:tada: Glad we solved it!

Regards,

Cameron.

hello…
I need some clarification on Related to sonarprojectName property, i used sonarprojectName property through CLI instead of using sonar-project properties file for nodejs application, but when i execute it is not created the projectname what i have given, it is displaying with the application name(package.json) in the sonarqube dashboard. can anyone please help me out to provide information on this…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.