Maven Checkstyle Plugin
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-64

Allow inclusion of javadoc source path in check

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      According to the documentation of the maven-javadoc-plugin, the Javadoc resources (like package.html) should be placed in src/main/javadoc. This will cause a checkstyle error for missing package.html files however when enabling the PackageHtml module, since this directory is not included in the checkstyle source path.

      See also: http://maven.apache.org/plugins/maven-javadoc-plugin/faq.html

        Activity

        Hide
        Gregory Kick added a comment -

        I've looked into this and it's actually an issue with the PackageHtmlCheck. Rather than checking the fileset to see that it includes a corresponding package.html, it creates a File for package.html in the same directory as the java file and uses the exists() method. In order for this issue to be resolved, it would require either a fix in checkstyle or a new check implemented specifically for maven. In the end, I like to do things the maven way, but in this particular case, I'm not entirely sure that putting package.html files in a different directory even makes sense anyway. Why put just a small fraction of the javadocs in a different folder? It is a little odd to put resources like images there, but the package.html files just might be better off in src/main/java.

        Show
        Gregory Kick added a comment - I've looked into this and it's actually an issue with the PackageHtmlCheck . Rather than checking the fileset to see that it includes a corresponding package.html , it creates a File for package.html in the same directory as the java file and uses the exists() method. In order for this issue to be resolved, it would require either a fix in checkstyle or a new check implemented specifically for maven. In the end, I like to do things the maven way , but in this particular case, I'm not entirely sure that putting package.html files in a different directory even makes sense anyway. Why put just a small fraction of the javadocs in a different folder? It is a little odd to put resources like images there, but the package.html files just might be better off in src/main/java .
        Hide
        Dennis Lundberg added a comment -

        I think that this is no longer an issue, because of the solution of MCHECKSTYLE-40. The build output directory is now included in the class path available to Checkstyle. The package.html files in src/main/javadoc do get copied to the build output directory, don't they?

        You can try using the latest 2.2-SNAPSHOT version of this plugin.

        Show
        Dennis Lundberg added a comment - I think that this is no longer an issue, because of the solution of MCHECKSTYLE-40 . The build output directory is now included in the class path available to Checkstyle. The package.html files in src/main/javadoc do get copied to the build output directory, don't they? You can try using the latest 2.2-SNAPSHOT version of this plugin.
        Hide
        Benjamin Bentmann added a comment -

        The package.html files in src/main/javadoc do get copied to the build output directory, don't they?

        No, these files are only copied to the report output directory. If they were copied to the build output directory, they would end up in the JAR which is not intended.

        Show
        Benjamin Bentmann added a comment - The package.html files in src/main/javadoc do get copied to the build output directory, don't they? No, these files are only copied to the report output directory. If they were copied to the build output directory, they would end up in the JAR which is not intended.

          People

          • Assignee:
            Unassigned
            Reporter:
            Johan Vanbockryck
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: