Share specific PMD rulesets across multi module maven project

巧了我就是萌 提交于 2019-12-01 06:40:44

Have a separate module that contains those generic config files like build-tools. Then you can add this module as a dependency to your plugin config and load it.

I have implemented an example of this with a checkstyle config file across a multiple modules in the ksoap2-android project.

https://github.com/mosabua/ksoap2-android/blob/master/pom.xml

I was reading the documentation for the ruleset tag and it says

The rule sets may reside in the classpath, filesystem or at a URL. For rule sets that are bundled with the PMD tool, you do not need to specificy the absolute path of the file. It will be resolved by the plugin. But if the rule set is a custom rule set, you need to specify its absolute path.

I solved the problem of sharing my PMD settings across my multi-maven build by specifying the URL to the ruleset file in my parent pom. (My repo was http accessible). Unfortunately this won't work though if you don't have your repo http accessible, but many people may.

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