Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonarqube gradle analyzing project, task not found in root project

Analysing project with this command

.\gradlew sonarqube \   -Dsonar.host.url=http://my.url \   -Dsonar.login=login --stacktrace

Getting this error

org.gradle.execution.TaskSelectionException: Task '\' not found in root project 'JavaLint'

And here is my gradle file

plugins {
  id "org.sonarqube" version "2.6.2"
}

apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'eclipse'
archivesBaseName = 'JavaLint'
version = '0.1-SNAPSHOT' 
mainClassName = 'Main'

repositories {
    mavenCentral()
}

jar {
    manifest {
        attributes 'Main-Class': 'com.test.Run'
    }
}

sourceSets {
    main {
        java {
            srcDirs 'src'
        }
    }
 }

dependencies {
    compile group: 'commons-io', name: 'commons-io', version: '2.6'
    compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
    compile group: 'org.jsoup', name: 'jsoup', version: '1.11.2'
    compile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'log4j', name: 'log4j', version: '1.2.16'
}

Stack trace stacktrace

I don't understand what am i supposed to do with it.

like image 369
user3668100 Avatar asked Mar 06 '23 16:03

user3668100


1 Answers

It looks like you're using cmder (it's so beautiful) which means you're on Windows. For Windows you'll want to provide the arguments to gradle as follows

./gradlew sonarqube -D "sonar.projectKey=<your_project_name>" -D "sonar.host.url=http://localhost:9000" -D "sonar.login=<your_project_token>"
like image 54
Joel B Avatar answered Mar 10 '23 09:03

Joel B