【问题标题】:How do i skip the license check when running the maven install?运行 maven 安装时如何跳过许可证检查?
【发布时间】:2018-03-14 15:32:03
【问题描述】:

我在我从事的一个大型 Java 项目上运行了 mvn clean install,但由于某些文件没有正确的许可证头,它一直失败。好吧,这不是我现在关心的问题,我该如何跳过它?我看到的实际错误是,

Failed to execute goal org.codehaus.mojo:license-maven-plugin:1.14:add-third-party (default) on project test-project: There are some dependencies with no license, please fill the file /Users/test-project/src/license/THIRD-PARTY.properties 

我也试过这个maven命令,但是没用

mvn clean install -Dlicense.skip=true

【问题讨论】:

  • 运行许可插件的哪个目标?它是在您自己的 pom 中还是在某些父 pom 中定义的?第一种情况,你可以从pom中删除,第二种情况,你可以设置一个“skip”参数为true。
  • 这个目标是在父pom中定义的,我认为如果我可以禁用maven命令本身的检查,而不是在父pom中更改会很好

标签: maven license-maven-plugin


【解决方案1】:

尝试使用 -Dlicense.skipAddThirdParty=true 跳过 AddThirdParty mojo。

【讨论】:

    【解决方案2】:

    我觉得这很有帮助

    $ mvn license:help -Ddetail | fgrep skip
    

    这给了我

    -Dlicense.skipDownloadLicenses
    

    您不需要添加=true,因为只需定义它就足够了。

    【讨论】:

      【解决方案3】:

      在我的例子中,它只适用于-Dlicense.skip,没有=true

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
      </plugin>
      

      【讨论】:

        【解决方案4】:

        这个适合我

        -Dlicense.skipCheckLicense
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2015-07-22
          • 2013-06-11
          • 2019-11-14
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-05-28
          • 1970-01-01
          相关资源
          最近更新 更多