Sonar plugin error in eclipse maven project

I am creating a new language plugin for sonarqube in Eclipse with a maven project and encountered the following error while building the project:

Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0: check (enforce-license-headers) on project sonar-java-plugin: Some files do not have the expected license header -> [Help 1] 
+7
maven sonarqube maven-enforcer-plugin
source share
3 answers

I had this problem myself when developing the plugin. I think you used sonar, an archetype plugin, to create your environment. If you do so, your entire project is under the GNU 3 license, and it is expected that the title in each class will report this. The predefined pom.xml contains the part where it is defined. Find the โ€œlicenseโ€ in your pom.xml and delete this part.

If this is not a fix, you simply add -Dlicense.skip=true to your maven target.

The expected title is similar (note that the first things are set when using -sonar-archetype)

 /* * MyLanguage Plugin * Copyright (C) MyYear MyCompany * dev@sonar.codehaus.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ 
+6
source share

Adding -Dlicense.skip=true to the maven target should help.

In fact, it helps me!

0
source share

Install Sonar Server:

Add the following steps:

 Download Sonar Setup File from http://www.sonarqube.org/downloads/ Extract the Zip file on your location. eg /home/<yourname>/sonar-version Running SonarQube Server: ~/sonar-version/bin/{your_os} > ./sonar.sh start After the server is started you can check it on your browser using url localhost:9000 

Installing the Sonar Eclipse Plugin:

 From your Eclipse search for Sonar in Eclipse Marketplace and install the plugin. In your Eclipse go to. Windows > Preference > Sonar > Server Click Add and in Add Window the Sonar Server URL must be http://localhost:9000. Then you should get the Successfully Connected ! message. Click Finish. Close all the Eclipse pop up windows. 

At this point, you have successfully connected your Eclipse to the Sonar server that you installed earlier.

 Command: mvn sonar:sonar 

Thanks.

-one
source share

All Articles