Hello, I am having problems now. I installed SonarQube7.3 in the company intranet environment, but I can’t upload maven multi-module files (including front-end code separated before and after) when using sonarqube-scanner on local win7. Excuse me. How do I need to solve the problem of uploading together?
pom.xml files content. I only need nodes
Can you give me some examples? A little confused!
Here is example
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>parent.group</groupId> <artifactId>parent-name</artifactId> <version>parent.version</version> </parent> <artifactId>artifact</artifactId> <packaging>pom</packaging> <modules> <module>submodule</module> </modules> </project>
I would like to see
pom.xml files from
Can you understand the pictures I have cut? The order of pom.xml is beacon-batch, beacon-core, beaconn-parent. Right, my engineer said that the outermost folder is built by us. So there is no pom.xml at the outermost level.
Yes, I understand the files. If
<modules> <module>beacon-batch</module> <module>beacon-core</module> </modules>
then you can achieve what you want by simply move the
beacon-parent pom.xml file to the main directory (this one which contains
sonar-project.properties. After that you are able to remove
sonar-project.properties and use
mvn sonar:sonar to analyze the project.
Hello, I have set up the method you gave me, but mvn sonar:sonar still reported the error, I will give you the screenshot! Please help me see!
Please provide compiled classes of your project with sonar.java.binaries property
Did you execute
mvn compile before
No, this is the code I pulled directly from gitlab, and then configured according to your method.
You have to build the project before the analysis. Please execute
mvn package sonar:sonar and the it should work.
Thanks a lot, it works, but I found that the front-end code was not uploaded (eg .js, .html, .css, .py). Or need to upload via sonar scan? The front end code is beacon-batch
To fix that, you have to add:
<properties> <sonar.sources>pom.xml,src/main</sonar.sources> </properties>
As long as I join
<sonar.sources> pom.xml, SRC / main </sonar.sources>
It will report a 500 error.
If I don’t add it, I can upload it successfully.
You have to check logs on the SonarQube server. They will show you where is the problem.
Thank you, it is useful for the time being.