2014-05-08 85 views
7

我創造sonarqube在Eclipse中使用Maven項目的新語言的插件,面向下面的錯誤,而建設項目:聲納插件錯誤

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] 

回答

-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 

安裝聲納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 

謝謝。

6

在開發插件時,我自己也有這個問題。 我想你使用的是聲納 - 插件 - 原型來創建你的周圍。如果你這樣做了,你的整個項目都在GNU 3許可證下,並且每個班級都有一個標題可以說明這一點。預定義的pom.xml包含定義它的一部分。在你的pom.xml中搜索「license」並刪除這部分。

如果這不解決問題,只需將-Dlicense.skip=true添加到您的maven目標。

預期的頭就像是(請注意,當你使用-sonar-原型的第一件事情是設置)

/* 
* MyLanguage Plugin 
* Copyright (C) MyYear MyCompany 
* [email protected] 
* 
* 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 
*/ 
+0

對於像我這樣不耐煩的人,只會在'mvn install'中添加'-Dlicense.skip = true'。 – frapen

0

添加-Dlicense.skip=true到maven的目標應該有所幫助。

其實它幫助我!