【问题标题】:Sonar plugin error in eclipse maven projecteclipse maven项目中的声纳插件错误
【发布时间】:2014-05-08 11:02:24
【问题描述】:

我正在使用 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]

【问题讨论】:

    标签: maven sonarqube maven-enforcer-plugin


    【解决方案1】:

    我自己在开发插件时遇到了这个问题。 我认为您正在使用 sonar--plugin-archetype 来创建您的环境。如果您这样做,您的整个项目都在 GNU 3 许可下,并且每个类中的标题都应该说明这一点。预定义的 pom.xml 包含定义 this 的部分。在你的 pom.xml 中搜索“license”并删除这部分。

    如果这不能解决您的问题,只需将 -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
     */
    

    【讨论】:

    • 对于像我这样没有耐心的人,只需要将-Dlicense.skip=true 添加到mvn install 即可。
    【解决方案2】:

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

    事实上,它对我有帮助!

    【讨论】:

      【解决方案3】:

      声纳服务器安装:

      添加涉及的步骤:

      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
      

      谢谢。

      【讨论】:

        猜你喜欢
        • 2023-03-17
        • 2015-09-15
        • 2014-12-23
        • 2016-01-22
        • 2011-02-05
        • 2013-03-21
        • 1970-01-01
        • 2015-02-09
        • 1970-01-01
        相关资源
        最近更新 更多