Unable to locate Source XRef to link to

白昼怎懂夜的黑 提交于 2019-11-29 22:47:21

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>

Re run it and enjoy.

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

Mind there is also the ability to disable the xref feature by adding

<configuration>
  <linkXRef>false</linkXRef>
</configuration>

to the maven-pmd-plugin plugin. This resolves the warning without making the build even longer due to running an additional reporting plugin. E.g. if you run your builds in Jenkins, the Jenkins PMD plugin can take care of relating PMD warnings to source code, there is no need to run another Maven plugin for this.

You should add the maven-jxr-plugin and run the jxr:jxr goal before the site lifecycle if the maven-jxr-plugin is added as a plugin like in your case:
clean jxr:jxr site

Otherwise you should add it as a report if you want it to work with mvn site. Take a look at the JXR Usage Documentation : JXR Usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!