Artifactory&Gradle:运行许可证检查

Dav*_*rth 11 artifactory

我们使用Gradle构建Java项目,并将生成的工件推送到Artifactory.

我们使用的摇篮Artifactory的插件,这意味着我们看到建立在Artifactory的接口,我们也看到关于构建使用许可证信息许可证选项卡.

但是,我无法解决可能只使用Gradle插件运行许可证检查.是否有设置让我提供许可证警报的电子邮件地址?或者我是否需要使用其中一个CI集成才能获得该功能?

Von*_*onC 2

Artifactory 确实包含邮件服务器配置部分:

Artifactory 支持发送邮件来通知管理员和其他用户系统中发生的重大事件。

一些例子是:

  • 观看通知
  • 备份警告和错误警报
  • 许可证违规通知

但这是通过 CI 插件使用的,而不仅仅是Gradle Artifactory 插件源代码):请参阅“使用构建许可证

https://www.jfrog.com/confluence/download/attachments/46107598/check_lic.png?version=1&modificationDate=1287503042000&api=v2

您还可以设置收件人列表,以便在发生许可证违规行为时立即收到通知。
这样,每当将具有未知或未经批准的许可证的依赖项添加到构建中时,收件人都会立即收到电子邮件通知,并可能会发现任何潜在的许可证违规行为。

发送许可证违规通知是通过 Artifactory 执行的,并且需要配置有效的邮件服务器。

检查构建信息 json 格式(Artifactory 的 CI 服务器和构建工具的开放集成层。构建信息以 json 格式发送到 Artifactory。)

它确实包括:

"licenseControl" : {    // Artifactory License Control information
    "runChecks" : true, // Artifactory will run automatic license scanning after the build is complete (true/false)
    "includePublishedArtifacts" : true, // Should Artifactory run license checks on the build artifacts, in addition to the build dependecies (true/false) 
    "autoDiscover" : true, // Should Artifactory auto discover licenses (true/false)
    "scopesList" : "", // A space-separated list of dependency scopes/configurations to run license violation checks on. If left empty all dependencies from all scopes will be checked.
    "licenseViolationsRecipientsList" : "" // Emails of recipients that should be notified of license violations in the build info (space-separated list)
  },
Run Code Online (Sandbox Code Playgroud)