{"id":391,"date":"2016-10-11T12:43:20","date_gmt":"2016-10-11T17:43:20","guid":{"rendered":"https:\/\/sha.nnoncarey.com\/blog\/?p=391"},"modified":"2016-10-11T12:43:20","modified_gmt":"2016-10-11T17:43:20","slug":"pmd-xpathrule","status":"publish","type":"post","link":"https:\/\/sha.nnoncarey.com\/blog\/archives\/391","title":{"rendered":"PMD XPathRule"},"content":{"rendered":"<p>Getting this exception when creating a custom XPathRule in a PMD ruleset file?<\/p>\n<p>Oct 11, 2016 12:37:05 PM net.sourceforge.pmd.PMD removeBrokenRules<br \/>\nWARNING: Removed misconfigured rule: OldHadoopPackageImport  cause: Missing xPath expression<\/p>\n<p>Make sure your rule definition includes the property element and the value element inside it. For example:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n    &lt;rule name=&quot;OldHadoopPackageImport&quot;\r\n          message=&quot;Avoid importing old Hadoop mapred package, use mapreduce package instead&quot;\r\n          language=&quot;java&quot;\r\n          class=&quot;net.sourceforge.pmd.lang.rule.XPathRule&quot;&gt;\r\n        &lt;properties&gt;\r\n            &lt;property name=&quot;xpath&quot; description=&quot;XPath expression&quot;&gt;\r\n                &lt;value&gt;\r\n                    \/\/ImportDeclaration&#x5B;Name&#x5B;contains(@Image, 'org.apache.hadoop.mapred')]]\r\n                &lt;\/value&gt;\r\n            &lt;\/property&gt;\r\n        &lt;\/properties&gt;\r\n    &lt;\/rule&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Getting this exception when creating a custom XPathRule in a PMD ruleset file? Oct 11, 2016 12:37:05 PM net.sourceforge.pmd.PMD removeBrokenRules WARNING: Removed misconfigured rule: OldHadoopPackageImport cause: Missing xPath expression Make sure your rule definition includes the property element and the value element inside it. For example: &lt;rule name=&quot;OldHadoopPackageImport&quot; message=&quot;Avoid importing old Hadoop mapred package, use &hellip; <a href=\"https:\/\/sha.nnoncarey.com\/blog\/archives\/391\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PMD XPathRule&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":3,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/391\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}