You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/01/05 00:02:54 UTC

[GitHub] [maven-pmd-plugin] hedleyproctor opened a new pull request #41: [MPMD-314] Report extension not set correctly when custom format

hedleyproctor opened a new pull request #41:
URL: https://github.com/apache/maven-pmd-plugin/pull/41


   Report extension is currently set to match the format, as in "csv", "html". This fails when you specify the format as a fully qualified class name. Since the renderer interface includes a method defaultFileExtension(), we should use this instead to set the file extension.
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
   - [x ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MPMD) filed
          for the change (usually before you start working on it).  Trivial changes like typos do not
          require a JIRA issue.  Your pull request should address just this issue, without
          pulling in other changes.
    - [x ] Each commit in the pull request should have a meaningful subject line and body.
    - [x ] Format the pull request title like `[MPMD-XXX] - Subject of the JIRA Ticket`,
          where you replace `MPMD-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the
          commit message.
    - [x ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [x ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
          be performed on your pull request automatically.
   [INFO] Tests run: 46, Failures: 0, Errors: 0, Skipped: 0
   [INFO] 
   [INFO] 
   [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ maven-pmd-plugin ---
   [INFO] Building jar: /Users/proctorh/git/maven-pmd-plugin/target/maven-pmd-plugin-3.15.0-SNAPSHOT.jar
   [INFO] 
   [INFO] --- maven-plugin-plugin:3.5.2:addPluginArtifactMetadata (default-addPluginArtifactMetadata) @ maven-pmd-plugin ---
   [INFO] 
   [INFO] --- maven-site-plugin:3.7.1:attach-descriptor (attach-descriptor) @ maven-pmd-plugin ---
   [INFO] Skipping because packaging 'maven-plugin' is not pom.
   [INFO] 
   [INFO] --- maven-checkstyle-plugin:3.0.0:check (checkstyle-check) @ maven-pmd-plugin ---
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  25.390 s
   [INFO] Finished at: 2021-01-04T23:58:52Z
   [INFO] ------------------------------------------------------------------------
    - [ failed] You have run the integration tests successfully (`mvn -Prun-its clean verify`).
   
   This has failed, can you suggest why? I'm running on MacOS, with Java 11 and Maven 3.6.3.
   
   [INFO] --- maven-invoker-plugin:3.2.1:verify (integration-test) @ maven-pmd-plugin ---
   [INFO] -------------------------------------------------
   [INFO] Build Summary:
   [INFO]   Passed: 0, Failed: 33, Errors: 0, Skipped: 5
   [INFO] -------------------------------------------------
   [ERROR] The following builds failed:
   [ERROR] *  MPMD-253-xref-link-multi-module/pom.xml
   [ERROR] *  MPMD-172/pom.xml
   [ERROR] *  MPMD-234-analysis-cache/pom.xml
   [ERROR] *  MPMD-181-no-benchmark/pom.xml
   [ERROR] *  MPMD-165/pom.xml
   [ERROR] *  MPMD-244-logging/pom.xml
   [ERROR] *  MPMD-205-pmd-js-check/pom.xml
   [ERROR] *  MPMD-163/pom.xml
   [ERROR] *  empty-rulesets/pom.xml
   [ERROR] *  mpmd-138/pom.xml
   [ERROR] *  MPMD-128-xref-link/pom.xml
   [ERROR] *  MPMD-258-multiple-executions/pom.xml
   [ERROR] *  MPMD-266-typeresolution-aggregated/pom.xml
   [ERROR] *  MPMD-259-analysis-cache-auxclasspath/pom.xml
   [ERROR] *  mpmd-80-not-included/pom.xml
   [ERROR] *  MPMD-289-format-html-check/pom.xml
   [ERROR] *  mpmd-80-included/pom.xml
   [ERROR] *  mpmd-168-empty-report/pom.xml
   [ERROR] *  MPMD-277-multi-module-check/pom.xml
   [ERROR] *  MPMD-206-sourceDirectories-js/pom.xml
   [ERROR] *  multi-module/pom.xml
   [ERROR] *  MPMD-243-excludeFromFailureFile/pom.xml
   [ERROR] *  MPMD-296-rulesetsTargetDirectory/pom.xml
   [ERROR] *  MPMD-219-pmd-processing-error/pom.xml
   [ERROR] *  MPMD-89-232-typeresolution/pom.xml
   [ERROR] *  MPMD-187/pom.xml
   [ERROR] *  MPMD-181-benchmark/pom.xml
   [ERROR] *  MPMD-268-deprecated-rules/pom.xml
   [ERROR] *  mpmd-168/pom.xml
   [ERROR] *  MPMD-182/pom.xml
   [ERROR] *  MPMD-290-cpd-for-csharp/pom.xml
   [ERROR] *  mpmd-142/pom.xml
   [ERROR] *  MPMD-270-JDK11/pom.xml
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-pmd-plugin] adangel commented on a change in pull request #41: [MPMD-314] Report extension not set correctly when custom format

Posted by GitBox <gi...@apache.org>.
adangel commented on a change in pull request #41:
URL: https://github.com/apache/maven-pmd-plugin/pull/41#discussion_r553814436



##########
File path: src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java
##########
@@ -429,7 +430,7 @@ private void writeFormattedReport( Report report )
             throws MavenReportException
     {
         Renderer renderer = createRenderer( request.getFormat(), request.getOutputEncoding() );
-        writeReport( report, renderer, request.getFormat() );
+        writeReport( report, renderer, renderer.defaultFileExtension() );

Review comment:
       Here a NPE might occur (and it does in the integration test multi-module), if the request format "none" is used, which means "no report" - and then there is no renderer.
   Since write report is a private method, I'll change that to determine the file extension after the check that we have a renderer.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-pmd-plugin] adangel merged pull request #41: [MPMD-314] PMD report extension not set correctly for custom renderer

Posted by GitBox <gi...@apache.org>.
adangel merged pull request #41:
URL: https://github.com/apache/maven-pmd-plugin/pull/41


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-pmd-plugin] adangel merged pull request #41: [MPMD-314] PMD report extension not set correctly for custom renderer

Posted by GitBox <gi...@apache.org>.
adangel merged pull request #41:
URL: https://github.com/apache/maven-pmd-plugin/pull/41


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-pmd-plugin] adangel commented on a change in pull request #41: [MPMD-314] Report extension not set correctly when custom format

Posted by GitBox <gi...@apache.org>.
adangel commented on a change in pull request #41:
URL: https://github.com/apache/maven-pmd-plugin/pull/41#discussion_r553814436



##########
File path: src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java
##########
@@ -429,7 +430,7 @@ private void writeFormattedReport( Report report )
             throws MavenReportException
     {
         Renderer renderer = createRenderer( request.getFormat(), request.getOutputEncoding() );
-        writeReport( report, renderer, request.getFormat() );
+        writeReport( report, renderer, renderer.defaultFileExtension() );

Review comment:
       Here a NPE might occur (and it does in the integration test multi-module), if the request format "none" is used, which means "no report" - and then there is no renderer.
   Since write report is a private method, I'll change that to determine the file extension after the check that we have a renderer.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org