eclipse maven项目中的声纳插件错误

时间:2014-05-08 11:02:24

标签: maven sonarqube maven-enforcer-plugin

我正在使用maven项目在Eclipse中为 sonarqube 创建一个新的语言插件,并在构建项目时遇到以下错误:

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]

3 个答案:

答案 0 :(得分:6)

我在开发插件时遇到了这个问题。 我认为你正在使用声纳 - 插件 - 原型来创建你的周围环境。如果您这样做,您的整个项目都在GNU 3许可下,并且每个类中的标题都可以告诉您。预定义的pom.xml包含定义它的部分。搜索"许可证"在你的pom.xml中删除这部分。

如果这不能解决您的问题,只需将-Dlicense.skip=true添加到您的maven目标。

预期的标题就像(请注意在使用-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
 */

答案 1 :(得分:0)

-Dlicense.skip=true添加到maven目标应该会有所帮助。

事实上,它对我有帮助!

答案 2 :(得分:-1)

声纳服务器安装:

添加相关步骤:

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 

安装Sonar Eclipse插件:

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.

在此阶段,您已成功将Eclipse与之前设置的Sonar Server连接。

Command: mvn sonar:sonar

感谢。