Maven 1.x Javadoc Plugin
  1. Maven 1.x Javadoc Plugin
  2. MPJAVADOC-19

Prevent the plugin from failing when a sourceDirectory exists, but it does not contain Java files

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      2

      Description

      Currently, the javadoc plugin fails when there are no Java sources in the source directory, even though the sourceDirectory exists (and therefore sourcesPresent is true). This situation occurs for instance when you develop a project in another language than Java (in my case, Nice).

      This failure is inconvenient because the site: plugin calls javadoc, and so the site generation fails.

      I have already implemented the change: after knowing the sourceDirectory exist, check if there is any *.java file in it. I'll attach the patch if I find how to. It's pretty simple, it just looks big because of reindentation of the body of the report goal.

      1. javadoc.diff
        15 kB
        Daniel Bonniot
      2. javadoc2.diff
        16 kB
        Daniel Bonniot

        Activity

        Hide
        Daniel Bonniot added a comment -

        Patch against HEAD.

        Show
        Daniel Bonniot added a comment - Patch against HEAD.
        Hide
        Emmanuel Venisse added a comment -

        New patch is apply

        Show
        Emmanuel Venisse added a comment - New patch is apply
        Hide
        Emmanuel Venisse added a comment -

        I think we can change the generation of sourcePresent value by mechanism present in javadoc checkneeded tag. With this checkstyle, sourcexref... reports will don't appears in project reports and we don't have any 404 page.

        sourcePresent = true if a java file exists and not if the source directory exist.

        Show
        Emmanuel Venisse added a comment - I think we can change the generation of sourcePresent value by mechanism present in javadoc checkneeded tag. With this checkstyle, sourcexref... reports will don't appears in project reports and we don't have any 404 page. sourcePresent = true if a java file exists and not if the source directory exist.
        Hide
        Daniel Bonniot added a comment -

        There should probably be sourcesPresent and javaSourcesPresent. Then plugins can decide if they depend on java sources being present, or just any source (for instance those that work on the bytecode generated from the sources, I think jdepend is in this case).

        Show
        Daniel Bonniot added a comment - There should probably be sourcesPresent and javaSourcesPresent. Then plugins can decide if they depend on java sources being present, or just any source (for instance those that work on the bytecode generated from the sources, I think jdepend is in this case).
        Hide
        Brett Porter added a comment -

        already fixed

        Show
        Brett Porter added a comment - already fixed

          People

          • Assignee:
            Brett Porter
            Reporter:
            Daniel Bonniot
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 hour
              1h
              Remaining:
              Remaining Estimate - 1 hour
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified