PMD-Jenkins:如何使用它 [英] PMD-Jenkins: how to use it

查看:147
本文介绍了PMD-Jenkins:如何使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然不知道如何使用PMD-jenkins插件来生成和显示我的结果. 没有人帮助我吗?我已经迷糊了5天了.

I still don't know how to use the PMD-jenkins plugin to generate and show my result. No one helps me? i have been confused for 5 days.

如何在詹金斯中生成和显示PMD结果?

How to generate and show the PMD result in Jenkins?

推荐答案

PMD jenkins插件仅显示PMD检查结果.您需要在由詹金斯(Jenkins)触发的构建中使用Maven运行PMD.例如,这可能类似于您的pom.xml

PMD jenkins plugin is only displaying the PMD check results. You need to run PMD using Maven as part of your build triggered by Jenkins. For example this could look like that in your pom.xml

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>2.7.1</version>
            <configuration>
                <linkXRef>false</linkXRef>
                <targetJdk>1.6</targetJdk>
                <rulesets>
                    <ruleset>/rulesets/basic.xml</ruleset>
                </rulesets>
            </configuration>
        </plugin>
    </plugins>
</reporting>

然后PMD-jenkins将知道在哪里获取结果并将其发布给您.

Then PMD-jenkins will know where to pick up the results and publish them for you.

要获得结果,您需要将此代码添加到pom.xml并在Jenkins中执行相应的目标,是的.

To get the results you will need to add this code to your pom.xml and execute the according target in Jenkins, yes.

请注意,这与Eclipse中的PMD插件无关. Eclipse PMD插件仅显示本地分析的结果,与Jenkins无关.

Note that this is not related to PMD-plugin in Eclipse. The Eclipse PMD plugin just shows the result of the local analysis, not related to Jenkins.

这篇关于PMD-Jenkins:如何使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆