SonarQube maven plugin not respect sonar.host.url in project's pom

Hi, I am using sonar maven plugin : 3.9.1.2184

I found it does not respect target project’s sonar.host.url in pom.xml


<properties>
		<sonarqube.version>9.1.0.47736</sonarqube.version>
		<sonarjava.version>7.3.0.27589</sonarjava.version>
		<!-- Don't forget to update this version of JaCoCo -->
		<jacoco.version>0.8.7</jacoco.version>
		<!-- Use UTF-8 for all resources -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<!-- Make sure to be compatible with java 8 -->
		<maven.compiler.release>8</maven.compiler.release>
		<sonar.projectKey>ntt_devops_cq_sonar_01-custom-rules-java_AYko6OFbAdLSC_LjrexH</sonar.projectKey>
		<sonar.projectName>01-自定义规则Java示例工程</sonar.projectName>
		<sonar.host.url>http://172.28.6.14:9000</sonar.host.url>
		<sonar.token>sqp_20e4385b484cf4bdf40cb0a7d182d30ed8fb48fd</sonar.token>
	</properties>

while sonar.host.url in user setting.xml and -Dsonar.host.url works.

Can you confirm this ?

Hi,

Can you verify that when you set the URL in the pom, it’s not being overridden, e.g. on the analysis command line?

 
Ann

P.S. You’ve already revoked that token^ you just published to the internet, right? :sweat_smile:

Yes, it’s not being overridden on the command line.

token is not revoked, but we are offline, don’t worry. :grinning:

Hi,

Thanks for the verification. I should have asked this the first time: what version of SonarQube are you using? If you’re not sure, you’ll find it in the page footer.

 
Ann

10.0 (build 68432)

Hi,

I just had a conversation in another thread with a SonarCloud user about pom-set URLs. His work.

What happens when you try to us a pom-set sonar.host.url? Is it defaulting to localhost:9000, as though no value was passed at all, or is some other value being used?

 
Ann