Ошибка плагина Sonar в проекте eclipse maven

Я создаю новый языковой плагин для 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]

person Vishnu    schedule 08.05.2014    source источник


Ответы (3)


У меня была эта проблема сама по себе при разработке плагина. Я думаю, вы использовали архетип сонара-плагина для создания своего окружения. Если вы сделаете это, весь ваш проект находится под лицензией GNU 3, и ожидается, что заголовок в каждом классе будет сообщать об этом. Предопределенный pom.xml содержит часть, в которой это определено. Найдите «лицензию» в вашем pom.xml и удалите эту часть.

Если это не решает вашу проблему, просто добавьте -Dlicense.skip=true к своей цели maven.

Ожидаемый заголовок выглядит примерно так (обратите внимание, что первые вещи устанавливаются при использовании -sonar-archetype)

/*
 * 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
 */
person Krummy    schedule 13.05.2014
comment
Для таких нетерпеливых людей, как я, сработало только добавление -Dlicense.skip=true к mvn install. - person frapen; 14.11.2015

Добавление -Dlicense.skip=true к цели maven должно помочь.

На самом деле, это помогает мне!

person J. R.    schedule 29.09.2017

Установка сервера Sonar:

Добавьте необходимые шаги:

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.

Command: mvn sonar:sonar

Спасибо.

person MrYo    schedule 09.05.2014