无法找到要链接到的源XRef [英] Unable to locate Source XRef to link to

查看:781
本文介绍了无法找到要链接到的源XRef的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大型的maven项目,该项目使用pmd插件进行代码质量检查.

I have a big maven project that uses the pmd plugin for code quality checks.

自从我开始使用pmd插件以来,我收到以下警告消息:

since I started using the pmd plugin i get the following warning message:

[WARNING] Unable to locate Source XRef to link to - DISABLED

我搜索了一下,发现我需要实现jxr插件.

I googled and found that i need to implement the jxr plugin.

所以我将以下内容添加到主pom.xml文件的build属性中.

so I add the following to the build property in the main pom.xml file.

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jxr-plugin</artifactId>
    <version>2.3</version>
  </plugin>

欢迎,它并没有真正改变任何东西.

welp it doesn't really change anything.

我需要采取什么措施来解决此警告消息?

any ideas what I need to implement in order to resolve this warning message?

mvn -version

Apache Maven 3.0.4 (r1232337; 2012-01-17 10:44:56+0200)
Maven home: /usr/share/maven-bin-3.0
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /usr/lib64/icedtea7/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.5.2-gentoo", arch: "amd64", family: "unix"

谢谢!

推荐答案

您应将maven-jxr-plugin添加到 reportingPlugin 部分.

You should add the maven-jxr-plugin to the reportingPlugin section.

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>2.3</version>
        </plugin>
    </plugins>
</reporting>

重新运行并享受.

顺便说一句,也许jxr:jxr目标需要运行一次才能首先生成将由pmd使用的文件.

BTW, maybe you'll need to run once the jxr:jxr goal to first generate some file that will be used by pmd.

这篇关于无法找到要链接到的源XRef的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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