2014-05-08 27 views
7

tôi đang tạo ra một plugin ngôn ngữ mới cho sonarqube trong Eclipse với dự án maven và phải đối mặt với lỗi sau khi xây dựng dự án:Sonar lỗi plugin trong dự án 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] 

Trả lời

-1

Sonar Server Installation:

Thêm các bước liên quan:

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 

Cài đặt 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. 

Ở giai đoạn này, bạn đã kết nối thành công Eclipse của mình với Máy chủ Sonar mà bạn đã thiết lập trước đó.

Command: mvn sonar:sonar 

Cảm ơn.

6

Tôi đã gặp sự cố này khi phát triển plugin. Tôi nghĩ rằng bạn đang sử dụng âm thanh - plugin-nguyên mẫu để tạo xung quanh bạn. Nếu bạn làm như vậy toàn bộ dự án của bạn là theo giấy phép GNU 3 và một tiêu đề trong mỗi lớp được dự kiến ​​sẽ nói điều này. Tệp pom.xml được xác định trước chứa một phần trong đó điều này được xác định. Tìm kiếm "giấy phép" trong tệp pom.xml của bạn và xóa phần này.

Nếu điều này không khắc phục được sự cố, chỉ cần thêm -Dlicense.skip=true vào mục tiêu quạ của bạn.

Tiêu đề dự kiến ​​là như (xin lưu ý rằng những điều đầu tiên được thiết lập khi bạn sử dụng -sonar-nguyên mẫu)

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

Đối với những người thiếu kiên nhẫn như tôi, nó chỉ làm việc thêm '-Dlicense.skip = true' thành' mvn install'. – frapen

0

Thêm -Dlicense.skip=true đến mục tiêu maven sẽ giúp.

Thực tế, nó giúp tôi!

Các vấn đề liên quan