org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:soYou're not authorized to run analysis

I want to configure sonarqube for my java project. This is the configurations I have added. But when I run

mvn clean install I got "[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project api-backend: You’re not authorized to run analysis. Please contact the project administrator. → [Help 1]
" error.

How can I fix this ?


		<!-- JaCoCo Properties -->

		<jacoco.version>0.8.8</jacoco.version>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
		<sonar.projectKey>"${project.name}"</sonar.projectKey>
		<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
		<sonar.language>java</sonar.language>
		<sonar.host.url>http://localhost:9000</sonar.host.url>
<dependencies>
	<dependency>
		<groupId>org.jacoco</groupId>
		<artifactId>jacoco-maven-plugin</artifactId>
		<version>0.8.6</version>
	</dependency>
</dependencies>
<plugins>
     			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.version}</version>
				<executions>
					<execution>
						<id>jacoco-initialize</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>jacoco-site</id>
						<phase>package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>

Hi,

It looks like anonymous analysis isn’t allowed for your project. You’ll need to provide an analysis token.

 
HTH,
Ann

Hello, I have defined it and added as sonar.login=xxx parameter at sonar-.properties file, it is still takes the same error, where should configure it?

Hi,

If you’re analyzing with Maven, then sonar-project.properties is ignored. Pass it with -Dsonar.login=... on the analysis command line.

 
HTH,
Ann

mvn sonar:sonar Dsonar.login=xxxx
I run like this still the same error

Hi,

There needs to be a - in front of that D:

mvn sonar:sonar -Dsonar.login=xxxx

 
HTH,
Ann

Yep, thanks for the support.