哈得逊/詹金斯PMD配置 [英] Hudson/Jenkins PMD Configuration

查看:124
本文介绍了哈得逊/詹金斯PMD配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来詹金斯刚开始配置它。这是我做了什么至今:

I am new to Jenkins and just started configuring it. This is what i have done till now:


  1. 安装并配置詹金斯显示主页。新增PMD插件。

  2. HUDSON_HOME 特定目录> ​​C:\\工作\\詹金斯

  3. 配置了一个测试版本运行一个简单的什么也不做的ant脚本。它成功运行

  1. Installed and configured Jenkins to display the home page. Added PMD plugin.
  2. Set the HUDSON_HOME to a specific directory > C:\Work\Jenkins
  3. Configured a test build to run a simple do-nothing ant script. It runs successfully

写一个独立的 pmdbuild.xml 运行检查,对一组文件在C:\\ MyView的(我使用ClearCase)。这也是XML拷贝输出pmd_results.xml到工作区目录 $ HUDSON_HOME / [作业名] /工作区

Written an independent pmdbuild.xml to run checks on a set of files in C:\myview (I am using clearcase). This xml also copies the output pmd_results.xml to the workspace directory in $HUDSON_HOME/[job-name]/workspace

现在我加入了 pmdbuild.xml 作为我的主要构建了一步。所以我打造了2个步骤:
一个。运行一个简单的脚本,什么也不做。
湾运行P mdbuild.xml 这产生 pmd_results.xml ,并将其放置在 $ HUDSON_HOME / [工作名称] /工作区(硬$ C $光盘作为詹金斯PMD插件预计那里的文件)

Now I added the pmdbuild.xml as a step in my primary build. So my build has 2 steps: a. Run a simple script, do-nothing. b. Run pmdbuild.xml which generate pmd_results.xml and place it in $HUDSON_HOME/[job-name]/workspace (HARD-CODED as Jenkins PMD plugin expects the file there)

詹金斯与插件 pmd_results.xml 自动拾取并显示警告信息,应有尽有。

Jenkins picks up the pmd_results.xml automatically with the plugin and displays warnings and everything.

现在的问题:


  • 如果我点击的PMD结果的文件名,它给出了一个 filenotfound 例外,因为它是在查找源文件$ HUDSON_HOME / [作业名] /工作区

我的Java code文件放在C:\\ MyView的(在ClearCase快照视图)

My java code files are placed in C:\myview (a clearcase snapshot view)

我的问题是,我需要我所有的code文件在里面 $ HUDSON_HOME / [作业名] /工作区 present?这意味着我不能告诉詹金斯寻找在C PMD输入文件:\\ MyView的或任何其他目录,而不是 $ HUDSON_HOME / [作业名] /工作区 ??

My question is, do I need all my code files to be present inside $HUDSON_HOME/[job-name]/workspace ?? Meaning can't I tell Jenkins to look for the PMD input files in C:\myview or any other directory instead of $HUDSON_HOME/[job-name]/workspace ??

对不起,极长的描述。

推荐答案

詹金斯预计,所有code是在工作区中。通常詹金斯是用来检查出code的副本到工作区,然后运行所有建立在资源在Workspace步骤。

Jenkins expects that all the code is in the workspace. Usually Jenkins is used to check out a copy of the code into the workspace, and then runs all build steps on the Sources in the Workspace.

似乎起初约束,但是如果你需要詹金斯移动到另一台服务器,或者创建一个从实例它可以节省你很多的麻烦。

Might seem restraining at first, but it saves you a lot of trouble if you need to move Jenkins to another server, or create a slave instance.

所以我建议你让詹金斯检查你的code(应该有一个ClearCase插件)到工作区,并运行在签出code中的分析。

So I would suggest you let Jenkins check out your code (there should be a clearcase plugin) into the workspace, and run the analysis on the checked out code.

如果有令人信服的理由,为什么你的code一直呆在地方是(C:你的情况\\ MyView的),你仍然可以构建的工作区设置到该目录(找到这个作业中的配置页面,你需要点击扩展按钮来查看选项)。

If there are compelling reasons why your code has to stay where it is (C:\myview in your case) you can still set the workspace of your build to that directory (find this in the job configuration page, you need to click on the 'extended' button to see the option).

这篇关于哈得逊/詹金斯PMD配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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