├── .asf.yaml
├── .github
├── ISSUE_TEMPLATE
│ ├── BUG.yml
│ ├── FEATURE.yml
│ └── config.yml
├── dependabot.yml
├── pull_request_template.md
├── release-drafter.yml
└── workflows
│ ├── maven-verify.yml
│ ├── pr-automation.yml
│ ├── release-drafter.yml
│ └── stale.yml
├── .gitignore
├── Jenkinsfile
├── README.md
├── pom.xml
└── src
├── config
└── checkstyle-suppressions.xml
├── it
├── MPMD-128-xref-link
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ ├── config
│ │ │ └── pmd
│ │ │ │ └── rules.xml
│ │ │ └── java
│ │ │ └── mpmd128
│ │ │ └── App.java
│ └── verify.groovy
├── MPMD-163
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-165
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ └── verify.groovy
├── MPMD-172
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── my.properties
│ └── verify.groovy
├── MPMD-181-benchmark
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ └── verify.groovy
├── MPMD-181-no-benchmark
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ └── verify.groovy
├── MPMD-182
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── RunnableTest.java
├── MPMD-187
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── App.java
│ └── verify.groovy
├── MPMD-205-pmd-js-check
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── javascript
│ │ │ └── PmdJsCheck.js
│ └── verify.groovy
├── MPMD-206-sourceDirectories-js
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── javascript
│ │ │ └── PmdJsCheck.js
│ └── verify.groovy
├── MPMD-219-pmd-processing-error
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── BrokenFile.java
│ └── verify.groovy
├── MPMD-234-analysis-cache
│ ├── custom-analysis-cache
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ ├── default-analysis-cache
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ ├── invoker.properties
│ ├── no-analysis-cache
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-243-excludeFromFailureFile
│ ├── config
│ │ ├── pmd-exclude.properties
│ │ └── ruleset.xml
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ ├── A.java
│ │ │ └── ClassWithLotsOfStaticImports.java
│ └── verify.groovy
├── MPMD-244-logging
│ ├── invoker.properties
│ ├── logging-enabled
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── BrokenFile.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-253-xref-link-multi-module
│ ├── invoker.properties
│ ├── module
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── app
│ │ │ └── App.java
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── config
│ │ │ └── pmd
│ │ │ └── rules.xml
│ └── verify.groovy
├── MPMD-258-multiple-executions
│ ├── invoker.properties
│ ├── mod1
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── hello
│ │ │ └── Test.java
│ ├── mod2
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── hello
│ │ │ └── Test.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-259-analysis-cache-auxclasspath
│ ├── invoker.properties
│ ├── missing-compile
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ ├── missing-test
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── Hello.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-266-typeresolution-aggregated
│ ├── invoker.properties
│ ├── module-a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── a
│ │ │ ├── IModuleA.java
│ │ │ └── ModuleA.java
│ ├── module-b
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── b
│ │ │ └── ModuleB.java
│ ├── pom.xml
│ ├── ruleset.xml
│ └── verify.groovy
├── MPMD-268-deprecated-rules
│ ├── invoker.properties
│ ├── pom.xml
│ ├── ruleset.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── sample
│ │ │ └── Sample.java
│ └── verify.groovy
├── MPMD-270-325-JDK11
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-277-multi-module-check
│ ├── invoker.properties
│ ├── module-a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── a
│ │ │ ├── IModuleA.java
│ │ │ └── ModuleA.java
│ ├── module-b
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── b
│ │ │ └── ModuleB.java
│ ├── pom.xml
│ ├── ruleset.xml
│ └── verify.groovy
├── MPMD-280-JDK12
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-283-aggregated-pmd
│ ├── invoker.properties
│ ├── module-a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── a
│ │ │ ├── IModuleA.java
│ │ │ └── ModuleA.java
│ ├── module-b
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── b
│ │ │ └── ModuleB.java
│ ├── pom.xml
│ ├── ruleset.xml
│ └── verify.groovy
├── MPMD-289-format-html-check
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ └── App.java
│ └── verify.groovy
├── MPMD-290-cpd-for-csharp
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── cs
│ │ │ ├── Sample1.cs
│ │ │ └── Sample2.cs
│ └── verify.groovy
├── MPMD-295-JDK13
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-296-rulesetsTargetDirectory
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ └── verify.groovy
├── MPMD-302-JDK14
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-302-JDK15
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-304-toolchain-support
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── sample
│ │ │ ├── Name.java
│ │ │ ├── Name2.java
│ │ │ └── Sample.java
│ └── verify.groovy
├── MPMD-312-JDK16
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-312-JDK17
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-317-auxclasspath-provided
│ ├── invoker.properties
│ ├── module-a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── a
│ │ │ └── ModuleA.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-318-auxclasspath-includeTests
│ ├── invoker.properties
│ ├── module-a
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ └── module
│ │ │ │ └── a
│ │ │ │ └── ModuleA.java
│ │ │ └── test
│ │ │ └── java
│ │ │ └── module
│ │ │ └── a
│ │ │ └── ModuleATest.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-323-multi-module-basedir
│ ├── config
│ │ └── pmd
│ │ │ └── ruleset.xml
│ ├── invoker.properties
│ ├── module-a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── a
│ │ │ └── ModuleA.java
│ ├── module-b
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── module
│ │ │ └── b
│ │ │ └── ModuleB.java
│ ├── pom.xml
│ └── verify.groovy
├── MPMD-323-ruleset-basedir-jgitver
│ ├── .mvn
│ │ └── extensions.xml
│ ├── config
│ │ └── pmd
│ │ │ └── ruleset.xml
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── sample
│ │ │ └── Sample.java
│ └── verify.groovy
├── MPMD-332-JDK18
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-335-aggregate-classpath-repositories
│ ├── invoker.properties
│ ├── mpmd335-module1
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── example
│ │ │ └── Foo.java
│ ├── pom.xml
│ ├── private-repo
│ │ └── org
│ │ │ └── apache
│ │ │ └── maven
│ │ │ └── plugins
│ │ │ └── pmd
│ │ │ └── it
│ │ │ └── mpmd335-dependency1
│ │ │ └── 1.0.0-SNAPSHOT
│ │ │ └── mpmd335-dependency1-1.0.0-SNAPSHOT.pom
│ └── verify.groovy
├── MPMD-348-JDK19
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-365-JDK20
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-379-JDK21
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── MPMD-89-232-typeresolution
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ │ └── pmd
│ │ │ │ └── ruleset.xml
│ │ └── test
│ │ │ └── java
│ │ │ └── it
│ │ │ ├── NoTestsHere.java
│ │ │ └── TestSupport.java
│ └── verify.groovy
├── empty-rulesets
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mycompany
│ │ │ └── app
│ │ │ ├── App.java
│ │ │ └── Foo.java
│ └── verify.groovy
├── mpmd-138
│ ├── invoker.properties
│ ├── mod-1
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ ├── mod-2
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ ├── mod-3
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ ├── MyClass.java
│ │ │ └── sub
│ │ │ └── MyClass.java
│ ├── mod-4
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ ├── MyClass.java
│ │ │ ├── OtherClass.java
│ │ │ └── sub
│ │ │ └── MyClass.java
│ ├── pom.xml
│ └── verify.groovy
├── mpmd-142
│ ├── invoker.properties
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── test
│ │ └── MyClass.java
├── mpmd-168-empty-report
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── def
│ │ │ └── Hello.java
│ └── verify.groovy
├── mpmd-168
│ ├── invoker.properties
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── def
│ │ │ └── Hello.java
│ └── verify.groovy
├── mpmd-80-included
│ ├── pom.xml
│ └── verify.groovy
├── mpmd-80-not-included
│ ├── pom.xml
│ └── verify.groovy
├── multi-module
│ ├── mod-1
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── config
│ │ │ └── pmd
│ │ │ │ ├── latin-1.xml
│ │ │ │ └── utf-8.xml
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ ├── mod-2
│ │ ├── pom.xml
│ │ ├── rulesets
│ │ │ └── java
│ │ │ │ └── basic.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ ├── mod-3
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── config
│ │ │ └── pmd
│ │ │ │ ├── abs.xml
│ │ │ │ └── rel.xml
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ ├── mod-4
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── test
│ │ │ └── MyClass.java
│ ├── pom.xml
│ └── verify.bsh
└── settings.xml
├── main
├── java
│ └── org
│ │ └── apache
│ │ └── maven
│ │ └── plugins
│ │ └── pmd
│ │ ├── AbstractPmdReport.java
│ │ ├── AbstractPmdViolationCheckMojo.java
│ │ ├── AggregatorCpdReport.java
│ │ ├── AggregatorCpdViolationCheckMojo.java
│ │ ├── AggregatorPmdNoForkReport.java
│ │ ├── AggregatorPmdReport.java
│ │ ├── AggregatorPmdViolationCheckMojo.java
│ │ ├── ConfigurationService.java
│ │ ├── CpdReport.java
│ │ ├── CpdReportRenderer.java
│ │ ├── CpdViolationCheckMojo.java
│ │ ├── ExcludeDuplicationsFromFile.java
│ │ ├── ExcludeFromFile.java
│ │ ├── ExcludeViolationsFromFile.java
│ │ ├── PmdFileInfo.java
│ │ ├── PmdReport.java
│ │ ├── PmdReportRenderer.java
│ │ ├── PmdViolationCheckMojo.java
│ │ ├── ViolationDetails.java
│ │ └── exec
│ │ ├── CpdExecutor.java
│ │ ├── CpdReportConsumer.java
│ │ ├── CpdRequest.java
│ │ ├── CpdResult.java
│ │ ├── CpdServiceExecutor.java
│ │ ├── Executor.java
│ │ ├── PmdExecutor.java
│ │ ├── PmdRequest.java
│ │ ├── PmdResult.java
│ │ ├── PmdServiceExecutor.java
│ │ └── ServiceExecutor.java
├── mdo
│ ├── cpd.mdo
│ └── pmd.mdo
└── resources
│ ├── cpd-report.properties
│ ├── cpd-report_de.properties
│ ├── cpd-report_en.properties
│ ├── cpd-report_fr.properties
│ ├── cpd-report_it.properties
│ ├── cpd-report_nl.properties
│ ├── cpd-report_pt_BR.properties
│ ├── cpd-report_sv.properties
│ ├── pmd-report.properties
│ ├── pmd-report_de.properties
│ ├── pmd-report_en.properties
│ ├── pmd-report_fr.properties
│ ├── pmd-report_it.properties
│ ├── pmd-report_nl.properties
│ ├── pmd-report_pt_BR.properties
│ ├── pmd-report_sv.properties
│ └── rulesets
│ ├── java
│ └── maven-pmd-plugin-default.xml
│ └── maven.xml
├── site
├── apt
│ ├── examples
│ │ ├── aggregate.apt.vm
│ │ ├── cpdCsharp.apt.vm
│ │ ├── differentRulesetForTests.apt.vm
│ │ ├── javascriptReport.apt.vm
│ │ ├── jspReport.apt.vm
│ │ ├── multi-module-config.apt.vm
│ │ ├── removeReport.apt.vm
│ │ ├── targetJdk.apt.vm
│ │ ├── upgrading-PMD-at-runtime.apt.vm
│ │ ├── usingRuleSets.apt.vm
│ │ ├── violation-exclusions.apt.vm
│ │ └── violationChecking.apt.vm
│ ├── index.apt.vm
│ └── usage.apt.vm
├── fml
│ └── faq.fml
├── markdown
│ └── releasenotes.md
├── resources
│ └── download.cgi
├── site.xml
└── xdoc
│ └── download.xml.vm
└── test
├── java
└── org
│ └── apache
│ └── maven
│ └── plugins
│ └── pmd
│ ├── AbstractPmdReportTestCase.java
│ ├── CapturingPrintStream.java
│ ├── CpdReportTest.java
│ ├── CpdViolationCheckMojoTest.java
│ ├── DependencyArtifactStubFactory.java
│ ├── PmdReportTest.java
│ ├── PmdViolationCheckMojoTest.java
│ ├── exec
│ └── ExecutorTest.java
│ └── stubs
│ ├── CustomConfigurationMavenProjectStub.java
│ ├── DefaultArtifactHandlerStub.java
│ ├── DefaultConfigurationMavenProjectStub.java
│ ├── InvalidFormatMavenProjectStub.java
│ ├── PmdPluginArtifactStub.java
│ └── PmdProjectStub.java
└── resources
├── simplelogger.properties
└── unit
├── CpdReportTest
└── with-cpd-errors
│ ├── pom.xml
│ └── src
│ └── main
│ └── java
│ └── sample
│ └── BadFile.java
├── custom-configuration
├── cpd-check-exception-test-plugin-config.xml
├── cpd-custom-configuration-plugin-config.xml
├── cpd-txt-format-configuration-plugin-config.xml
├── custom-configuration-plugin-config.xml
├── custom
│ └── configuration
│ │ ├── AnotherSample.java
│ │ ├── App.java
│ │ ├── AppSample.java
│ │ └── Sample.java
├── pmd-check-exception-test-plugin-config.xml
├── resources
│ └── rulesets
│ │ └── custom.xml
└── skip-plugin-config.xml
├── default-configuration
├── cpd-check-cpd-exclusions-configuration-plugin-config.xml
├── cpd-check-default-configuration-plugin-config.xml
├── cpd-check-notfailonviolation-plugin-config.xml
├── cpd-default-configuration-plugin-config.xml
├── cpd-encoding-configuration-plugin-config.xml
├── cpd-javascript-plugin-config.xml
├── cpd-jsp-plugin-config.xml
├── cpd-report-cpd-exclusions-configuration-plugin-config.xml
├── cpd-report-include-xml-in-reports-config.xml
├── def
│ └── configuration
│ │ ├── App.java
│ │ ├── App2.java
│ │ └── AppSample.java
├── default-configuration-plugin-config.xml
├── javascript-configuration-plugin-config.xml
├── js
│ ├── Sample.js
│ └── SampleDup.js
├── jsp-configuration-plugin-config.xml
├── jsp
│ ├── sample.jsp
│ └── sampleDup.jsp
├── jxr-files
│ └── xref
│ │ ├── allclasses-frame.html
│ │ ├── def
│ │ └── configuration
│ │ │ ├── App.html
│ │ │ ├── AppSample.html
│ │ │ ├── package-frame.html
│ │ │ └── package-summary.html
│ │ ├── index.html
│ │ ├── overview-frame.html
│ │ ├── overview-summary.html
│ │ └── stylesheet.css
├── pmd-check-default-configuration-plugin-config.xml
├── pmd-check-failandwarnonpriority-plugin-config.xml
├── pmd-check-failmaxviolation-plugin-config.xml
├── pmd-check-failonpriority-plugin-config.xml
├── pmd-check-notfailmaxviolation-plugin-config.xml
├── pmd-check-notfailonviolation-plugin-config.xml
├── pmd-check-pmd-exclusions-configuration-plugin-config.xml
├── pmd-report-custom-rules.xml
├── pmd-report-include-xml-in-reports-config.xml
├── pmd-report-no-render-violations-by-priority.xml
├── pmd-report-not-render-rule-priority-plugin-config.xml
├── pmd-report-pmd-exclusions-configuration-plugin-config.xml
├── pmd-report-resolve-rulesets.xml
├── pmd-with-analysis-cache-plugin-config.xml
├── pmd-with-suppressMarker-no-render-plugin-config.xml
├── pmd-with-suppressMarker-plugin-config.xml
└── rulesets
│ ├── custom-rules.xml
│ ├── sonar-main-page.html
│ └── sonar-way-ruleset.xml
├── empty-report
├── cpd-empty-report-plugin-config.xml
├── cpd-skip-empty-report-plugin-config.xml
├── empty-report-plugin-config.xml
├── java
│ └── def
│ │ └── Hello.java
└── skip-empty-report-plugin-config.xml
├── exclude-roots
├── baseroot
│ ├── src1
│ │ └── PMDViolationExample.java
│ └── src2
│ │ └── PMDViolationExample.java
├── othersrc
│ └── PMDViolationExample.java
├── pmd-exclude-roots-plugin-config.xml
└── src
│ └── PMDViolationExample.java
├── excludes
├── my-exclude-cpd.properties
└── pmd_exclude.properties
├── invalid-format
├── cpd-invalid-format-plugin-config.xml
├── invalid-format-plugin-config.xml
├── invalid-target-jdk-plugin-config.xml
└── invalid
│ └── format
│ ├── App.java
│ └── AppSample.java
└── processing-error
├── pmd-processing-error-no-report-plugin-config.xml
├── pmd-processing-error-plugin-config.xml
├── pmd-processing-error-skip-plugin-config.xml
└── src
└── BrokenFile.java
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | version: 2
19 | updates:
20 | - package-ecosystem: "maven"
21 | directory: "/"
22 | schedule:
23 | interval: "daily"
24 | - package-ecosystem: "github-actions"
25 | directory: "/"
26 | schedule:
27 | interval: "daily"
28 |
--------------------------------------------------------------------------------
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | _extends: maven-gh-actions-shared
19 | tag-template: maven-pmd-plugin-$NEXT_MINOR_VERSION
20 |
--------------------------------------------------------------------------------
/.github/workflows/maven-verify.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: Verify
19 |
20 | on:
21 | push:
22 | pull_request:
23 |
24 | jobs:
25 | build:
26 | name: Verify
27 | uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
28 | with:
29 | maven4-enabled: true
30 |
--------------------------------------------------------------------------------
/.github/workflows/pr-automation.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: PR Automation
19 | on:
20 | pull_request_target:
21 | types:
22 | - closed
23 |
24 | jobs:
25 | pr-automation:
26 | name: PR Automation
27 | uses: apache/maven-gh-actions-shared/.github/workflows/pr-automation.yml@v4
28 |
--------------------------------------------------------------------------------
/.github/workflows/release-drafter.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: Release Drafter
19 | on:
20 | push:
21 | branches:
22 | - master
23 | workflow_dispatch:
24 |
25 | jobs:
26 | update_release_draft:
27 | uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4
28 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: Stale
19 |
20 | on:
21 | schedule:
22 | - cron: '56 1 * * *'
23 | issue_comment:
24 | types: [ 'created' ]
25 |
26 | jobs:
27 | stale:
28 | uses: 'apache/maven-gh-actions-shared/.github/workflows/stale.yml@v4'
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | .project
3 | .classpath
4 | .settings/
5 | .svn/
6 | bin/
7 | # Intellij
8 | *.ipr
9 | *.iml
10 | .idea
11 | out/
12 | .DS_Store
13 | /bootstrap
14 | /dependencies.xml
15 | .java-version
16 | .checkstyle
17 | .factorypath
18 |
--------------------------------------------------------------------------------
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | asfMavenTlpPlgnBuild()
21 |
--------------------------------------------------------------------------------
/src/config/checkstyle-suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-128-xref-link/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean site
--------------------------------------------------------------------------------
/src/it/MPMD-128-xref-link/src/main/config/pmd/rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-128-xref-link/src/main/java/mpmd128/App.java:
--------------------------------------------------------------------------------
1 | package mpmd128;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 |
29 | public static void main( String[] args )
30 | {
31 | System.out.println( "Hello World!" );
32 | return; // Unnecessary return.
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/src/it/MPMD-128-xref-link/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 |
24 | File report = new File( basedir, 'target/site/pmd.html' )
25 | assert report.exists()
26 |
27 | assert 1 == report.getText().count( 'xref/mpmd128/App.html#L32' )
28 |
--------------------------------------------------------------------------------
/src/it/MPMD-163/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean pmd:check
--------------------------------------------------------------------------------
/src/it/MPMD-163/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/MPMD-163/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.util.ArrayList;
21 | public class Foo
22 | {
23 | public Foo(final ArrayList foo)
24 | {
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/it/MPMD-165/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean pmd:pmd
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-165/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | return; // This is a UnnecessaryReturn violation
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-165/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File pmdHtml = new File( basedir, "target/reports/pmd.html" );
21 | assert pmdHtml.exists()
22 |
23 | // Groovy's getText() automatically detects the correct encoding, so that UTF-16 works out of the box
24 | // see also http://groovy.codehaus.org/api/groovy/util/CharsetToolkit.html
25 | def html = pmdHtml.text;
26 | assert html.contains( '' );
27 |
--------------------------------------------------------------------------------
/src/it/MPMD-172/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify jxr:jxr pmd:pmd
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-172/src/main/resources/my.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | some.property = value
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-172/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 |
23 | // This warning should not appear in the log
24 | assert 0 == buildLog.getText().count('[WARNING] Unable to locate Source XRef to link to - DISABLED')
25 |
--------------------------------------------------------------------------------
/src/it/MPMD-181-benchmark/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify pmd:pmd
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-181-benchmark/src/main/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-181-benchmark/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File defaultBenchmarkFile = new File( basedir, 'target/pmd-benchmark.txt' )
21 | assert !defaultBenchmarkFile.exists()
22 |
23 | File customBenchmarkFile = new File( basedir, 'target/my-own-pmd-benchmark.txt' )
24 | assert customBenchmarkFile.exists()
25 |
--------------------------------------------------------------------------------
/src/it/MPMD-181-no-benchmark/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify pmd:pmd
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-181-no-benchmark/src/main/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-181-no-benchmark/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File defaultBenchmarkFile = new File( basedir, 'target/pmd-benchmark.txt' )
21 | assert !defaultBenchmarkFile.exists()
22 |
23 | File customBenchmarkFile = new File( basedir, 'target/my-own-pmd-benchmark.txt' )
24 | assert !customBenchmarkFile.exists()
25 |
--------------------------------------------------------------------------------
/src/it/MPMD-182/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify pmd:pmd
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-187/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify -Dpmd.skip=true -Dcpd.skip=true
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-187/src/main/java/App.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class App
21 | {
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-187/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 |
23 | File pmdXml = new File( basedir, "target/pmd.xml" )
24 | assert !pmdXml.exists()
25 |
26 | File cpdXml = new File( basedir, "target/cpd.xml" )
27 | assert !cpdXml.exists()
28 |
--------------------------------------------------------------------------------
/src/it/MPMD-205-pmd-js-check/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.buildResult = failure
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-205-pmd-js-check/src/main/javascript/PmdJsCheck.js:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | (function() {
21 |
22 | var i = 1; // this semicolon should have been a comma
23 | j = 2; // that's why "j" is now a global variable
24 |
25 | })();
--------------------------------------------------------------------------------
/src/it/MPMD-205-pmd-js-check/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 |
23 | assert buildLog.getText().contains("[WARNING] PMD Failure: PmdJsCheck.js:23 Rule:GlobalVariable Priority:1 Avoid using global variables.");
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-206-sourceDirectories-js/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-206-sourceDirectories-js/src/main/javascript/PmdJsCheck.js:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | (function() {
21 |
22 | var i = 1; // this semicolon should have been a comma
23 | j = 2; // that's why "j" is now a global variable
24 |
25 | })();
--------------------------------------------------------------------------------
/src/it/MPMD-206-sourceDirectories-js/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 |
23 | File pmd = new File( basedir, 'target/pmd.xml' )
24 | assert pmd.exists()
25 | assert pmd.getText().contains("GlobalVariable")
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-219-pmd-processing-error/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean pmd:check
19 | invoker.buildResult = failure
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-219-pmd-processing-error/src/main/java/BrokenFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class BrokenFile
21 | {
22 |
23 | // This file has a parse error, so PMD will fail to parse it
24 | broken!!
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/MPMD-219-pmd-processing-error/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 | assert buildLog.text.contains( "PMD processing errors" )
23 | assert buildLog.text.contains( "ParseException: Parse exception in file" )
24 | assert buildLog.text.contains( "BrokenFile.java" )
25 |
--------------------------------------------------------------------------------
/src/it/MPMD-234-analysis-cache/custom-analysis-cache/src/main/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-234-analysis-cache/default-analysis-cache/src/main/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-234-analysis-cache/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify pmd:pmd
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-234-analysis-cache/no-analysis-cache/src/main/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-243-excludeFromFailureFile/config/pmd-exclude.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | com.example.ClassWithLotsOfStaticImports=TooManyStaticImports
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-243-excludeFromFailureFile/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean pmd:check
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-243-excludeFromFailureFile/src/main/java/com/example/A.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class A {
23 | public static final int A = 1;
24 | public static final int B = 1;
25 | public static final int C = 1;
26 | public static final int D = 1;
27 | public static final int E = 1;
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-244-logging/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean pmd:check
19 | invoker.debug = true
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-244-logging/logging-enabled/src/main/java/BrokenFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class BrokenFile
21 | {
22 |
23 | // This file has a parse error, so PMD will fail to parse it
24 | broken!!
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/MPMD-253-xref-link-multi-module/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean site
--------------------------------------------------------------------------------
/src/it/MPMD-253-xref-link-multi-module/module/src/main/java/app/App.java:
--------------------------------------------------------------------------------
1 | package app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Hello world!
24 | *
25 | */
26 | public class App
27 | {
28 |
29 | public static void main( String[] args )
30 | {
31 | System.out.println( "Hello World!" );
32 | return; // Unnecessary return.
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/src/it/MPMD-253-xref-link-multi-module/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 |
24 | File report = new File( basedir, 'target/site/pmd.html' )
25 | assert report.exists()
26 |
27 | assert 1 == report.getText().count( 'xref/app/App.html#L32' )
28 |
--------------------------------------------------------------------------------
/src/it/MPMD-258-multiple-executions/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean compile pmd:pmd
19 | invoker.debug = true
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-258-multiple-executions/mod1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 | 4.0.0
24 |
25 |
26 | org.apache.maven.plugins.pmd.its
27 | MPMD-258-multiple-executions
28 | 1.0-SNAPSHOT
29 |
30 | MPMD-258-multiple-executions-mod1
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/it/MPMD-258-multiple-executions/mod1/src/main/java/hello/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package hello;
21 |
22 | public class Test {
23 | String foo;
24 |
25 | public Test() {
26 | for (; true;) {
27 | System.out.println(this.foo);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-258-multiple-executions/mod2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 | 4.0.0
24 |
25 |
26 | org.apache.maven.plugins.pmd.its
27 | MPMD-258-multiple-executions
28 | 1.0-SNAPSHOT
29 |
30 | MPMD-258-multiple-executions-mod2
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/it/MPMD-258-multiple-executions/mod2/src/main/java/hello/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package hello;
21 |
22 | public class Test {
23 | String foo;
24 |
25 | public Test() {
26 | for (; true;) {
27 | System.out.println(this.foo);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-259-analysis-cache-auxclasspath/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-259-analysis-cache-auxclasspath/missing-compile/src/test/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-259-analysis-cache-auxclasspath/missing-test/src/main/java/com/mycompany/app/Hello.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-259-analysis-cache-auxclasspath/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 |
23 | assert !buildLog.text.contains( '[ERROR] Incremental analysis can\'t check auxclasspath contents' )
24 | assert !buildLog.text.contains( '[WARNING] Failure executing PMD: java.io.FileNotFoundException' )
25 |
--------------------------------------------------------------------------------
/src/it/MPMD-266-typeresolution-aggregated/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.goals.2 = verify site -DskipTests
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-266-typeresolution-aggregated/module-a/src/main/java/module/a/IModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public interface IModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-266-typeresolution-aggregated/module-a/src/main/java/module/a/ModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleA implements IModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-268-deprecated-rules/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.debug = false
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-268-deprecated-rules/src/main/java/sample/Sample.java:
--------------------------------------------------------------------------------
1 | package sample;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Sample
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-268-deprecated-rules/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File buildLog = new File( basedir, 'build.log' )
21 | assert buildLog.exists()
22 | assert buildLog.text.contains( "Use Rule name category/java/codestyle.xml/ControlStatementBraces instead of the deprecated Rule name" )
23 |
--------------------------------------------------------------------------------
/src/it/MPMD-270-325-JDK11/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 11+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-270-325-JDK11/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-270-325-JDK11/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-270-325-JDK11/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-277-multi-module-check/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean package
19 | invoker.goals.2 = verify
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-277-multi-module-check/module-a/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 | 4.0.0
24 |
25 |
26 | org.apache.maven.plugins.pmd.it
27 | MPMD-277-multi-module-check-parent
28 | 1.0-SNAPSHOT
29 |
30 |
31 | MPMD-277-multi-module-check-module-a
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/it/MPMD-277-multi-module-check/module-a/src/main/java/module/a/IModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public interface IModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-277-multi-module-check/module-a/src/main/java/module/a/ModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleA implements IModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-277-multi-module-check/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File pmdXml = new File( basedir, "target/pmd.xml" )
21 | assert pmdXml.exists()
22 | assert !pmdXml.text.contains( "Avoid unused private methods such as 'doSomething(IModuleA)'." )
23 | assert !pmdXml.text.contains( "Avoid unused private methods such as 'aPrivateMethod(FieldElement)'." )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-280-JDK12/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 12+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-280-JDK12/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-280-JDK12/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-280-JDK12/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-283-aggregated-pmd/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify site
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-283-aggregated-pmd/module-a/src/main/java/module/a/IModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public interface IModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-283-aggregated-pmd/module-a/src/main/java/module/a/ModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleA implements IModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-289-format-html-check/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-289-format-html-check/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-290-cpd-for-csharp/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.buildResult = failure
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-290-cpd-for-csharp/src/main/cs/Sample1.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | class Sample1 {
21 | public void bar() {
22 | int x = 1;
23 | int y = 2;
24 | int z = x + y;
25 | }
26 | }
--------------------------------------------------------------------------------
/src/it/MPMD-290-cpd-for-csharp/src/main/cs/Sample2.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | class Sample2 {
21 | public void bar() {
22 | int x = 1;
23 | int y = 2;
24 | int z = x + y;
25 | }
26 | }
--------------------------------------------------------------------------------
/src/it/MPMD-295-JDK13/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 13+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-295-JDK13/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-295-JDK13/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-295-JDK13/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-296-rulesetsTargetDirectory/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals.1 = clean verify
19 | invoker.profiles.1 =
20 | # no clean for the next executions, otherwise we can't verify
21 | invoker.goals.2 = verify
22 | invoker.profiles.2 = customTargetOld
23 | invoker.goals.3 = verify
24 | invoker.profiles.3 = customTarget
25 |
--------------------------------------------------------------------------------
/src/it/MPMD-296-rulesetsTargetDirectory/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK14/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 14+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK14/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK14/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK14/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK15/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 15+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK15/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK15/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-302-JDK15/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-304-toolchain-support/src/main/java/sample/Name.java:
--------------------------------------------------------------------------------
1 | package sample;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Name extends Thread
23 | {
24 | private final String name;
25 |
26 | public Name( String name )
27 | {
28 | this.name = name;
29 | }
30 |
31 | @Override
32 | public String toString()
33 | {
34 | return name;
35 | }
36 | }
--------------------------------------------------------------------------------
/src/it/MPMD-304-toolchain-support/src/main/java/sample/Name2.java:
--------------------------------------------------------------------------------
1 | package sample;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Name2 extends Thread
23 | {
24 | private final String name;
25 |
26 | public Name2( String name )
27 | {
28 | this.name = name;
29 | }
30 |
31 | @Override
32 | public String toString()
33 | {
34 | return name;
35 | }
36 | }
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK16/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 16+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK16/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK16/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK16/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK17/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 17+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-312-JDK17/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-317-auxclasspath-provided/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.goals.2 = clean verify -Daggregate=true
20 | invoker.debug = true
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-317-auxclasspath-provided/module-a/src/main/java/module/a/ModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-318-auxclasspath-includeTests/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.goals.2 = clean verify -Daggregate=true
20 | invoker.debug = true
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-318-auxclasspath-includeTests/module-a/src/main/java/module/a/ModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-318-auxclasspath-includeTests/module-a/src/test/java/module/a/ModuleATest.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleATest
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-323-multi-module-basedir/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-323-multi-module-basedir/module-a/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 | 4.0.0
24 |
25 |
26 | org.apache.maven.plugins.pmd.it
27 | MPMD-323-multi-module-basedir-parent
28 | 1.0-SNAPSHOT
29 |
30 |
31 | MPMD-323-multi-module-basedir-module-a
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/it/MPMD-323-multi-module-basedir/module-a/src/main/java/module/a/ModuleA.java:
--------------------------------------------------------------------------------
1 | package module.a;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleA
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-323-multi-module-basedir/module-b/src/main/java/module/b/ModuleB.java:
--------------------------------------------------------------------------------
1 | package module.b;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class ModuleB
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-323-multi-module-basedir/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | String[] files = [ "module-a/target/pmd.xml", "module-a/target/pmd/rulesets/001-ruleset.xml",
21 | "module-b/target/pmd.xml", "module-b/target/pmd/rulesets/001-ruleset.xml" ]
22 |
23 | files.each
24 | {
25 | File f = new File( basedir, it )
26 | assert f.exists()
27 | }
28 |
29 | return true
30 |
--------------------------------------------------------------------------------
/src/it/MPMD-323-ruleset-basedir-jgitver/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 | invoker.java.version = 11+
20 |
21 | # TODO investigate on Maven 4
22 | # [ERROR] detection of jgitver old setting mechanism: jgitver must now use maven core extensions only -> [Help 1]
23 | invoker.maven.version=!4+
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-323-ruleset-basedir-jgitver/src/main/java/sample/Sample.java:
--------------------------------------------------------------------------------
1 | package sample;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Sample
23 | {
24 | }
--------------------------------------------------------------------------------
/src/it/MPMD-323-ruleset-basedir-jgitver/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File pmdXml = new File( basedir, "target/pmd.xml" )
21 | assert pmdXml.exists()
22 |
--------------------------------------------------------------------------------
/src/it/MPMD-332-JDK18/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.java.version = 18+
19 | invoker.goals = clean verify
20 | invoker.buildResult = failure
21 |
--------------------------------------------------------------------------------
/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-332-JDK18/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-335-aggregate-classpath-repositories/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = verify
19 |
--------------------------------------------------------------------------------
/src/it/MPMD-335-aggregate-classpath-repositories/mpmd335-module1/src/main/java/org/example/Foo.java:
--------------------------------------------------------------------------------
1 | package org.example;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | public class Foo
24 | {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/it/MPMD-348-JDK19/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-348-JDK19/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-348-JDK19/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-365-JDK20/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-365-JDK20/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-365-JDK20/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-379-JDK21/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | # available toolchains under linux:
19 | # https://github.com/apache/infrastructure-p6/blob/production/modules/build_nodes/files/toolchains.xml
20 | # https://github.com/apache/infrastructure-puppet/blob/deployment/modules/build_slaves/files/toolchains.xml
21 |
22 | # the jdk toolchain "21" is selected in pom.xml
23 | invoker.toolchain.jdk.version = 21
24 |
25 | invoker.goals = clean verify
26 | invoker.buildResult = failure
27 |
--------------------------------------------------------------------------------
/src/it/MPMD-379-JDK21/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/MPMD-379-JDK21/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.ArrayList;
23 |
24 | public class Foo
25 | {
26 | public Foo( final ArrayList foo )
27 | {
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/it/MPMD-379-JDK21/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
23 | assert buildLog.text.contains( '[WARNING] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24 |
--------------------------------------------------------------------------------
/src/it/MPMD-89-232-typeresolution/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean test-compile
19 | invoker.buildResult = failure
20 |
--------------------------------------------------------------------------------
/src/it/MPMD-89-232-typeresolution/src/test/java/it/TestSupport.java:
--------------------------------------------------------------------------------
1 | package it;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.custommonkey.xmlunit.XMLTestCase;
23 |
24 | public abstract class TestSupport
25 | extends XMLTestCase
26 | {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/MPMD-89-232-typeresolution/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File pmdXml = new File( basedir, "target/pmd.xml" );
21 | assert pmdXml.exists()
22 |
--------------------------------------------------------------------------------
/src/it/empty-rulesets/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
19 |
--------------------------------------------------------------------------------
/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java:
--------------------------------------------------------------------------------
1 | package com.mycompany.app;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class App
23 | {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import java.util.ArrayList;
21 |
22 | public class Foo
23 | {
24 | public Foo( final ArrayList foo )
25 | {
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/empty-rulesets/verify.groovy:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | File buildLog = new File( basedir, 'build.log' )
22 | assert buildLog.exists()
--------------------------------------------------------------------------------
/src/it/mpmd-138/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify
--------------------------------------------------------------------------------
/src/it/mpmd-138/mod-1/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/mpmd-138/mod-2/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 | private String x;
25 | }
--------------------------------------------------------------------------------
/src/it/mpmd-142/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean site
--------------------------------------------------------------------------------
/src/it/mpmd-142/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/mpmd-168-empty-report/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify site
19 |
--------------------------------------------------------------------------------
/src/it/mpmd-168-empty-report/src/main/java/def/Hello.java:
--------------------------------------------------------------------------------
1 | package def;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mpmd-168/invoker.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | invoker.goals = clean verify site
19 |
--------------------------------------------------------------------------------
/src/it/mpmd-168/src/main/java/def/Hello.java:
--------------------------------------------------------------------------------
1 | package def;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/it/mpmd-80-included/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File targetDir = new File( basedir, "target" );
21 | File siteDir = new File( targetDir, "site" );
22 |
23 | File pmdXmlInSite = new File( siteDir, "pmd.xml" )
24 | assert pmdXmlInSite.exists()
25 |
26 | File cpdXmlInSite = new File( siteDir, "cpd.xml" )
27 | assert cpdXmlInSite.exists()
28 |
--------------------------------------------------------------------------------
/src/it/mpmd-80-not-included/verify.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | File targetDir = new File( basedir, "target" );
21 | File siteDir = new File( targetDir, "site" );
22 |
23 | File pmdXmlInSite = new File( siteDir, "pmd.xml" )
24 | assert !pmdXmlInSite.exists()
25 |
26 | File cpdXmlInSite = new File( siteDir, "cpd.xml" )
27 | assert !cpdXmlInSite.exists()
28 |
--------------------------------------------------------------------------------
/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/maven-pmd-plugin/29543178ae61cd678fb1b869b33b63a4a5b7f602/src/it/multi-module/mod-1/src/main/config/pmd/latin-1.xml
--------------------------------------------------------------------------------
/src/it/multi-module/mod-1/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/multi-module/mod-2/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/multi-module/mod-3/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/it/multi-module/mod-4/src/main/java/test/MyClass.java:
--------------------------------------------------------------------------------
1 | package test;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class MyClass
23 | {
24 |
25 | public static void main( String[] args )
26 | {
27 | ;
28 | return;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=Duplicate code detection.
20 | report.cpd.title=CPD Results
21 | report.cpd.column.file=File
22 | report.cpd.column.project=Project
23 | report.cpd.column.line=Line
24 | report.cpd.cpdlink=The following document contains the results of PMD's
25 | report.cpd.dupes=Duplications
26 | report.cpd.noProblems=CPD found no problems in your source code.
27 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_de.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=Erkennung duplizierter Codestellen.
20 | report.cpd.title=CPD Ergebnisse
21 | report.cpd.column.file=Datei
22 | report.cpd.column.project=Projekt
23 | report.cpd.column.line=Zeile
24 | report.cpd.cpdlink=Dieses Dokument enth\u00e4lt die Ergebnisse von PMD's
25 | report.cpd.dupes=Duplikationen
26 | report.cpd.noProblems=CPD hat keine Probleme in dem Quellcode gefunden.
27 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_en.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | # NOTE:
19 | # This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
20 | # must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
21 | # JVM's default locale (which need not be "en"). See the method javadoc about
22 | # ResourceBundle.getBundle(String, Locale, ClassLoader)
23 | # for a full description of the lookup strategy.
24 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_fr.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=D\u00E9tection de code dupliqu\u00E9
20 | report.cpd.title=R\u00E9sultats CPD
21 | report.cpd.column.file=Fichier
22 | report.cpd.column.project=Projet
23 | report.cpd.column.line=Ligne
24 | report.cpd.cpdlink=Le document suivant contient les r\u00E9sultats de l'inspection CPD
25 | report.cpd.dupes=Duplicatas
26 | report.cpd.noProblems=CPD a trouv\u00E9 les probl\u00E8mes suivants dans votre code source
27 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_it.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=Rilevamento dei duplicati nei sorgenti.
20 | report.cpd.title=Risultati CPD
21 | report.cpd.column.file=File
22 | report.cpd.column.project=Progetto
23 | report.cpd.column.line=Linea
24 | report.cpd.cpdlink=Il seguente documento contiene i risultati di PMD
25 | report.cpd.dupes=Duplicati
26 | report.cpd.noProblems=CPD non ha rilevato nessun problema nei tuoi sorgenti.
27 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_nl.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=Dubbele code detectie.
20 | report.cpd.title=CPD Resultaten
21 | report.cpd.column.file=Bestand
22 | report.cpd.column.project=Project
23 | report.cpd.column.line=Regel
24 | report.cpd.cpdlink=Het volgende document bevat de resultaten van PMD's
25 | report.cpd.dupes=Dubbelingen
26 | report.cpd.noProblems=CPD heeft geen fouten gevonden in de code.
27 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_pt_BR.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=Detec\u00e7\u00e3o de c\u00f3digo duplicado.
20 | report.cpd.title=Resultados do CPD
21 | report.cpd.column.file=Arquivo
22 | report.cpd.column.project=Projeto
23 | report.cpd.column.line=Linha
24 | report.cpd.cpdlink=O seguinte documento cont\u00e9m os resultados do CPD
25 | report.cpd.dupes=Duplicados
26 | report.cpd.noProblems=O CPD n\u00e3o encontrou problemas no seu c\u00f3digo fonte.
27 |
--------------------------------------------------------------------------------
/src/main/resources/cpd-report_sv.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.cpd.name=CPD
19 | report.cpd.description=Duplicerad kod detektering.
20 | report.cpd.title=CPD-resultat
21 | report.cpd.column.file=Fil
22 | report.cpd.column.project=Projekt
23 | report.cpd.column.line=Rad
24 | report.cpd.cpdlink=F\u00f6ljande dokument inneh\u00e5ller resultatet av PMD's
25 | report.cpd.dupes=Dupliceringar
26 | report.cpd.noProblems=CPD hittade inga problem i din k\u00e4llkod.
27 |
--------------------------------------------------------------------------------
/src/main/resources/pmd-report_en.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | # NOTE:
19 | # This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
20 | # must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
21 | # JVM's default locale (which need not be "en"). See the method javadoc about
22 | # ResourceBundle.getBundle(String, Locale, ClassLoader)
23 | # for a full description of the lookup strategy.
24 |
--------------------------------------------------------------------------------
/src/main/resources/pmd-report_fr.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.pmd.name=PMD
19 | report.pmd.description=V\u00E9rification des r\u00E8gles de codage.
20 | report.pmd.title=R\u00E9sultats PMD
21 | report.pmd.column.violation=Violation
22 | report.pmd.column.line=Ligne
23 | report.pmd.pmdlink=Le document suivant contient les r\u00E9sultats de
24 | report.pmd.files=Fichiers
25 |
--------------------------------------------------------------------------------
/src/main/resources/pmd-report_it.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.pmd.name=PMD
19 | report.pmd.description=Verifica delle regole nei sorgenti.
20 | report.pmd.title=Risultati PMD
21 | report.pmd.column.violation=Violazione
22 | report.pmd.column.line=Linee
23 | report.pmd.pmdlink=Il seguente documento contiene i risultati di
24 | report.pmd.files=File
25 | report.pmd.noProblems=PMD non ha rilevato problemi nei tuoi sorgenti.
26 |
--------------------------------------------------------------------------------
/src/main/resources/pmd-report_nl.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.pmd.name=PMD
19 | report.pmd.description=Controle van programmeerregels.
20 | report.pmd.title=PMD Resultaten
21 | report.pmd.column.violation=Overtreding
22 | report.pmd.column.line=Regel
23 | report.pmd.pmdlink=Het volgende document bevat de resultaten van
24 | report.pmd.files=Bestanden
25 | report.pmd.noProblems=PMD heeft geen fouten gevonden in de code.
26 |
--------------------------------------------------------------------------------
/src/main/resources/pmd-report_pt_BR.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.pmd.name=PMD
19 | report.pmd.description=Verifica\u00e7\u00e3o das regras de codifica\u00e7\u00e3o.
20 | report.pmd.title=Resultados do PMD
21 | report.pmd.column.violation=Viola\u00e7\u00e3o
22 | report.pmd.column.line=Linha
23 | report.pmd.pmdlink=O seguinte documento cont\u00e9m os resultados do
24 | report.pmd.files=Arquivos
25 | report.pmd.noProblems=O PMD n\u00e3o encontrou problemas no seu c\u00f3digo fonte.
26 |
--------------------------------------------------------------------------------
/src/main/resources/pmd-report_sv.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | report.pmd.name=PMD
19 | report.pmd.description=Verifiering av kodningsregler.
20 | report.pmd.title=PMD-resultat
21 | report.pmd.column.violation=\u00d6vertr\u00e4delse
22 | report.pmd.column.line=Rad
23 | report.pmd.pmdlink=F\u00f6ljande dokument inneh\u00e5ller resultatet av
24 | report.pmd.files=Filer
25 | report.pmd.noProblems=PMD hittade inga problem i din k\u00e4llkod.
26 |
--------------------------------------------------------------------------------
/src/site/resources/download.cgi:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | #
20 | # Just call the standard mirrors.cgi script. It will use download.html
21 | # as the input template.
22 | exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*
--------------------------------------------------------------------------------
/src/test/resources/unit/CpdReportTest/with-cpd-errors/src/main/java/sample/BadFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package sample;
20 |
21 | public class BadFile {
22 | public void foo() {
23 | // this is a bad character � it's U+FFFD REPLACEMENT CHARACTER
24 | int a�b = 1;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/resources/unit/default-configuration/def/configuration/App2.java:
--------------------------------------------------------------------------------
1 | package def.configuration;
2 | /*
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing,
14 | * software distributed under the License is distributed on an
15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | * KIND, either express or implied. See the License for the
17 | * specific language governing permissions and limitations
18 | * under the License.
19 | */
20 |
21 | //trigger unused import
22 | import java.io.File;
23 | /**
24 | * This is a sample class used for testing
25 | *
26 | * @author Maria Odea Ching
27 | */
28 | public class App2
29 | {
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/resources/unit/default-configuration/js/Sample.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | (function() {
21 |
22 | globalVariable = 1;
23 |
24 | })();
--------------------------------------------------------------------------------
/src/test/resources/unit/default-configuration/js/SampleDup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | (function() {
21 |
22 | globalVariable = 1;
23 |
24 | })();
--------------------------------------------------------------------------------
/src/test/resources/unit/default-configuration/jsp/sample.jsp:
--------------------------------------------------------------------------------
1 | <%-- This file will fail the Apache Rat tests if it does not contain the license,
2 | therefore, the license is included. --%>
3 |
4 | <%--
5 | * Licensed to the Apache Software Foundation (ASF) under one
6 | * or more contributor license agreements. See the NOTICE file
7 | * distributed with this work for additional information
8 | * regarding copyright ownership. The ASF licenses this file
9 | * to you under the Apache License, Version 2.0 (the
10 | * "License"); you may not use this file except in compliance
11 | * with the License. You may obtain a copy of the License at
12 | *
13 | * http://www.apache.org/licenses/LICENSE-2.0
14 | *
15 | * Unless required by applicable law or agreed to in writing,
16 | * software distributed under the License is distributed on an
17 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 | * KIND, either express or implied. See the License for the
19 | * specific language governing permissions and limitations
20 | * under the License.
21 | --%>
22 |
23 | <%-- Introduce unsanitized JSP expression --%>
24 | ${my.variable.is.bad}
25 | <%-- Introduce inline style --%>
26 | Inline Styles are bad.
--------------------------------------------------------------------------------
/src/test/resources/unit/default-configuration/jsp/sampleDup.jsp:
--------------------------------------------------------------------------------
1 | <%-- This file will fail the Apache Rat tests if it does not contain the license,
2 | therefore, the license is included. --%>
3 |
4 | <%--
5 | * Licensed to the Apache Software Foundation (ASF) under one
6 | * or more contributor license agreements. See the NOTICE file
7 | * distributed with this work for additional information
8 | * regarding copyright ownership. The ASF licenses this file
9 | * to you under the Apache License, Version 2.0 (the
10 | * "License"); you may not use this file except in compliance
11 | * with the License. You may obtain a copy of the License at
12 | *
13 | * http://www.apache.org/licenses/LICENSE-2.0
14 | *
15 | * Unless required by applicable law or agreed to in writing,
16 | * software distributed under the License is distributed on an
17 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 | * KIND, either express or implied. See the License for the
19 | * specific language governing permissions and limitations
20 | * under the License.
21 | --%>
22 |
23 | <%-- Introduce unsanitized JSP expression --%>
24 | ${my.variable.is.bad}
25 | <%-- Introduce inline style --%>
26 | Inline Styles are bad.
--------------------------------------------------------------------------------
/src/test/resources/unit/empty-report/java/def/Hello.java:
--------------------------------------------------------------------------------
1 | package def;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | public class Hello
23 | {
24 | public static void main( String[] args )
25 | {
26 | System.out.println( args[0] );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/resources/unit/exclude-roots/baseroot/src1/PMDViolationExample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class PMDViolationExample {
21 | public void jumbledIncrementer() {
22 | for (int i = 0; i < 10; i++) { // only references 'i'
23 | for (int k = 0; k < 20; i++) { // references both 'i' and 'k'
24 | System.out.println("Hello");
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/test/resources/unit/exclude-roots/baseroot/src2/PMDViolationExample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class PMDViolationExample {
21 | public void jumbledIncrementer() {
22 | for (int i = 0; i < 10; i++) { // only references 'i'
23 | for (int k = 0; k < 20; i++) { // references both 'i' and 'k'
24 | System.out.println("Hello");
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/test/resources/unit/exclude-roots/othersrc/PMDViolationExample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class PMDViolationExample {
21 | // OverrideBothEqualsAndHashcode!
22 | @Override
23 | public int hashCode() {
24 | return 0;
25 | }
26 | }
--------------------------------------------------------------------------------
/src/test/resources/unit/exclude-roots/src/PMDViolationExample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class PMDViolationExample {
21 | public void forLoopShouldBeWhileLoop() {
22 | for (;true;) true; // No Init or Update part, may as well be: while (true)
23 | }
24 | }
--------------------------------------------------------------------------------
/src/test/resources/unit/excludes/my-exclude-cpd.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing,
13 | # software distributed under the License is distributed on an
14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | # KIND, either express or implied. See the License for the
16 | # specific language governing permissions and limitations
17 | # under the License.
18 | #
19 | def.configuration.App,def.configuration.AppSample
20 |
--------------------------------------------------------------------------------
/src/test/resources/unit/excludes/pmd_exclude.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing,
13 | # software distributed under the License is distributed on an
14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | # KIND, either express or implied. See the License for the
16 | # specific language governing permissions and limitations
17 | # under the License.
18 | #
19 | def.configuration.App=UnusedPrivateField,EmptyCatchBlock,UselessParentheses
20 | def.configuration.App2=UnnecessaryImport
21 | def.configuration.AppSample=UnusedPrivateField,UnusedFormalParameter,UnusedPrivateMethod,UselessParentheses
22 |
--------------------------------------------------------------------------------
/src/test/resources/unit/processing-error/src/BrokenFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | public class BrokenFile {
21 |
22 | // This file has a parse error, so PMD will fail to parse it
23 | broken!!
24 |
25 | }
26 |
--------------------------------------------------------------------------------