【问题标题】:How to use lint4j plugin for gradle build and how to configure it for Jenkins?如何使用 lint4j 插件进行 gradle 构建以及如何为 Jenkins 配置它?
【发布时间】:2016-06-23 20:59:06
【问题描述】:

以下插件配置是针对maven的:

<dependency>
  <groupId>lint4j</groupId>
  <artifactId>jutils-lint4j-plugin</artifactId>
  <version>1.3.1</version>
  <type>plugin</type>
</dependency>

然后我可以将以下 sn-p 添加到我的 project.xml 的报告部分

<report>jutils-lint4j-plugin</report>

将以下行添加到项目的 maven.properties 文件中:

maven.repo.remote=http://www.ibiblio.org/maven,http://www.jutils.com/maven

但我想要 gradle 一样的东西。除了所需的 build.gradle 更改之外,我是否需要在项目中更改其他任何内容才能在 Jenkins Job 中查看 lint 报告。

【问题讨论】:

    标签: java maven jenkins gradle lint


    【解决方案1】:

    然后确保您已安装和配置 gradle plugin

    <hudson.plugins.gradle.Gradle plugin="gradle@1.24">
            <description/>
            <switches> -Dtest.single=com/mycomp/test/trusted/**/*Tests
                -Dtest.scaleDefaultWaits=2.0</switches>
            <tasks>clean test</tasks>
            <rootBuildScriptDir/>
            <buildFile/>
            <gradleName>gradle-1.12</gradleName>
            <useWrapper>false</useWrapper>
            <makeExecutable>false</makeExecutable>
            <fromRootBuildScriptDir>true</fromRootBuildScriptDir>
            <useWorkspaceAsHome>false</useWorkspaceAsHome>
        </hudson.plugins.gradle.Gradle>
    

    我确实在网上找到了可以作为指导的:https://github.com/codepath/android_guides/wiki/Building-Gradle-Projects-with-Jenkins-CI#create-the-build-job

    【讨论】:

      【解决方案2】:

      将以下代码添加到 build.gradle 文件中:

      buildscript {
        repositories { jcenter() }
        dependencies {
          classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release'
        }
      }
      
      apply plugin: 'nebula.lint'
      
      gradleLint.rules = ['dependency-parentheses', 'dependency-tuple']
      

      添加您的自定义规则,并忽略大小写。

      【讨论】:

        猜你喜欢
        • 2022-07-23
        • 2015-04-21
        • 2021-06-30
        • 2014-12-09
        • 1970-01-01
        • 2020-07-16
        • 2021-02-02
        • 1970-01-01
        • 2017-05-06
        相关资源
        最近更新 更多