7

I am creating a new language plugin for sonarqube in Eclipse with maven project and facing 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]
Navnath Godse
  • 2,233
  • 2
  • 23
  • 32
Vishnu
  • 71
  • 1
  • 3

3 Answers3

6

I had this problem by myself while developing a plugin. I think you were using the sonar--plugin-archetype to create your surrounding. If you do so your whole project is under GNU 3 license and a header within every class is expected telling this. The predefined pom.xml contains a part where this is defined. Search for "license" in your pom.xml and delete this part.

If this is not fixing you problem just add -Dlicense.skip=true to your maven goal.

The expected header is like (please notice that the first things are set while you use -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
 */
Krummy
  • 658
  • 15
  • 24
  • For the impatient people like me, it only worked adding `-Dlicense.skip=true` to `mvn install`. – frapen Nov 13 '15 at 23:13
0

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

In fact, it help me!

J. R.
  • 11
  • 3
-1

Sonar Server Installation:

Add the steps involved:

Download Sonar Setup File from http://www.sonarqube.org/downloads/
Extract the Zip file on your location. e.g. /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 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 stage you have successfully connected your Eclipse with the Sonar Server you have set up earlier.

Command: mvn sonar:sonar

Thanks.

MrYo
  • 1,797
  • 3
  • 19
  • 33