From 81c50518323b13de8340de915a2bfa18bbe36720 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Wed, 30 May 2018 09:23:00 +0200 Subject: [PATCH] Fixes #715: [xml] ProjectVersionAsDependencyVersion false positive --- docs/pages/release_notes.md | 2 ++ .../resources/category/pom/errorprone.xml | 10 +++++-- .../xml/ProjectVersionAsDependencyVersion.xml | 30 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7719b5d2a3..2da4e9bbde 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -20,6 +20,8 @@ This is a minor release. ### New and noteworthy ### Fixed Issues +* xml + * [#715](https://github.com/pmd/pmd/issues/715): \[xml] ProjectVersionAsDependencyVersion false positive ### API Changes diff --git a/pmd-xml/src/main/resources/category/pom/errorprone.xml b/pmd-xml/src/main/resources/category/pom/errorprone.xml index 65dd9bd49c..952298ee5d 100644 --- a/pmd-xml/src/main/resources/category/pom/errorprone.xml +++ b/pmd-xml/src/main/resources/category/pom/errorprone.xml @@ -61,7 +61,7 @@ The following types are considered valid: pom, jar, maven-plugin, ejb, war, ear, @@ -73,7 +73,13 @@ By far the most common problem is the use of ${project.version} in a BOM or diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml index 0c1f0b7e8a..2f13256ca6 100644 --- a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml +++ b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/pom/rule/errorprone/xml/ProjectVersionAsDependencyVersion.xml @@ -45,4 +45,34 @@ ]]> pom + + #715 [xml] ProjectVersionAsDependencyVersion false positive: Valid usage child modules + 1 + 20 + + 4.0.0 + a-child + + + net.sourceforge.pmd + parent + 1.0.0-SNAPSHOT + + + + + net.sourceforge.pmd + a-different-child + ${project.version} + + + unrelated.group + unrelated-artifact + ${project.version} + + + + ]]> +