This is an automated email from the ASF dual-hosted git repository. adangel pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git
commit f1f79c2eb58204a922af7ee73691f13922cdd5f2 Author: Andreas Dangel <adan...@apache.org> AuthorDate: Fri Dec 15 19:52:33 2017 +0100 [MPMD-247] Upgrade to PMD 6.0.0 --- pom.xml | 9 +++++++-- src/main/java/org/apache/maven/plugins/pmd/PmdReport.java | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 6ada382..499a099 100644 --- a/pom.xml +++ b/pom.xml @@ -91,9 +91,10 @@ under the License. <javaVersion>1.7</javaVersion> <maven.compiler.source>${javaVersion}</maven.compiler.source> <maven.compiler.target>${javaVersion}</maven.compiler.target> - <pmdVersion>5.6.1</pmdVersion> + <pmdVersion>6.0.0</pmdVersion> <sitePluginVersion>3.4</sitePluginVersion> <projectInfoReportsPluginVersion>2.8</projectInfoReportsPluginVersion> + <mavenPluginToolsVersion>3.5</mavenPluginToolsVersion> </properties> <dependencies> @@ -249,6 +250,10 @@ under the License. <rules> <enforceBytecodeVersion> <maxJdkVersion>${javaVersion}</maxJdkVersion> + <ignoreClasses> + <!-- asm dependency from PMD contains a java9 module-info.class --> + <ignoreClass>module-info</ignoreClass> + </ignoreClasses> </enforceBytecodeVersion> </rules> <fail>true</fail> @@ -281,7 +286,7 @@ under the License. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>animal-sniffer-maven-plugin</artifactId> - <version>1.12</version> + <version>1.16</version> <configuration> <signature> <groupId>org.codehaus.mojo.signature</groupId> diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java index 5d8cb8f..3d4abf0 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java +++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java @@ -66,6 +66,7 @@ import net.sourceforge.pmd.renderers.HTMLRenderer; import net.sourceforge.pmd.renderers.Renderer; import net.sourceforge.pmd.renderers.TextRenderer; import net.sourceforge.pmd.renderers.XMLRenderer; +import net.sourceforge.pmd.util.ResourceLoader; import net.sourceforge.pmd.util.datasource.DataSource; import net.sourceforge.pmd.util.datasource.FileDataSource; @@ -388,11 +389,14 @@ public class PmdReport } String encoding = getSourceEncoding(); - if ( StringUtils.isEmpty( encoding ) && !filesToProcess.isEmpty() ) + if ( StringUtils.isEmpty( encoding ) ) { - getLog().warn( "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING - + ", i.e. build is platform dependent!" ); encoding = ReaderFactory.FILE_ENCODING; + if ( !filesToProcess.isEmpty() ) + { + getLog().warn( "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING + + ", i.e. build is platform dependent!" ); + } } pmdConfiguration.setSourceEncoding( encoding ); @@ -468,7 +472,7 @@ public class PmdReport private void processFilesWithPMD( PMDConfiguration pmdConfiguration, List<DataSource> dataSources ) throws MavenReportException { - RuleSetFactory ruleSetFactory = new RuleSetFactory( RuleSetFactory.class.getClassLoader(), + RuleSetFactory ruleSetFactory = new RuleSetFactory( new ResourceLoader(), RulePriority.valueOf( this.minimumPriority ), false, true ); RuleContext ruleContext = new RuleContext(); -- To stop receiving notification emails like this one, please contact "commits@maven.apache.org" <commits@maven.apache.org>.