Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-278

Plugin does not include javadocDirectory correctly

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.9
    • Labels:
      None
    • Environment:
      Windows XP, RHEL 5.3, maven 2.0.9
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      The maven-javadoc-plugin seem not to include the javadoc resources correctly.

      The files placed in the according folders are not copied to the generated target reports.

      Project structure:

      d:\test
      +---core
          +---src
              +---main
                 +---java
                    +---com
                        +---test
                            +---api
                            +---spi
                 +---javadoc          <-- contains files to be included
                    +---doc-files
                 +---resources
              +---test

      Master POM file is int the d:\test directory. The module POM file under d:\test\core. The parent pom file contains the following configuration for the reporting section:

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.6.1</version>
      		<inherited>true</inherited>
              <configuration>
                <source>1.6</source>
                <aggregate>true</aggregate>
                <minmemory>128m</minmemory>
                <maxmemory>1g</maxmemory>
                <show>private</show>
                <useStandardDocletOptions>true</useStandardDocletOptions>
      		  <verbose>false</verbose>
      
                <groups>
                  <group>
                    <title>BE-Core Packages</title>
                    <packages>com.test.*</packages>
                  </group>
                </groups>
      		  
      		  <detectLinks>true</detectLinks>
      		  <docfilesubdirs>true</docfilesubdirs>
      		  <!--<overview>d:\test\core/src/main/javadoc/overview.html</overview>-->
      		  <javadocDirectory>${basedir}/src/main/javadoc</javadocDirectory>
            
                <links>
                  <link>http://build.cm.trovicor.com/javase/6/docs/api</link>
                </links>
      
                <header>
                  &lt;b&gt;My&lt;br&gt;v${project.version} API-Documentation&lt;/b&gt;
                </header>
                <footer>
                  &lt;b&gt;My&lt;br&gt;v${project.version} API-Documentation&lt;/b&gt;
                </footer>
                <bottom>
                  <![CDATA[<table border=0 background="" cellspacing=0 cellpadding=0 class="footer"><tr><td><center><font size="1" class="footer"><b><font size="+1">My Product</font><br>Copyright {inceptionYear}-{currentYear} ${project.organization.name}. All rights reserved.<br>My Product v${project.version} API Documentation</b></font></center></td></tr></table>]]>
                </bottom>
                <tags>
                  <tag>
                    <name>date</name>
                    <placement>t</placement>
                    <head>Creation Date:</head>
                  </tag>
                </tags>
              </configuration>
            </plugin>

      When executing the report generation, the following output is generated:

      D:\test>mvn javadoc:javadoc -X
      
      D:\test>set MAVEN_OPTS=-XX:MaxPermSize=298m -XX:+CMSClassUnloadingEnabled
      + Error stacktraces are turned on.
      Maven version: 2.0.9
      Java version: 1.6.0_18
      OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
      [INFO] Scanning for projects...
      [INFO] Reactor build order:
      [INFO]   test
      [INFO]   core
      [INFO] Searching repository for plugin with prefix: 'javadoc'.
      [DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
      [DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
      [DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins::10 for project: null:maven-javadoc-plugin:maven-plugin:2.4 from
      the repository.
      [DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent::7 for project: org.apache.maven.plugins:maven-plugins:pom:10 from the rep
      ository.
      [DEBUG] Retrieving parent-POM: org.apache:apache::4 for project: org.apache.maven:maven-parent:pom:7 from the repository.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test
      [INFO]    task-segment: [javadoc:javadoc]
      [INFO] ------------------------------------------------------------------------
      [DEBUG] com:test:pom:1.0-SNAPSHOT (selected for null)
      [DEBUG]   junit:junit:jar:4.4:test (selected for test)
      [DEBUG] Plugin dependencies for:
      
      org.apache.maven.plugins:maven-javadoc-plugin:2.4
      
      are:
         .......
      These will use the artifact files already in the core ClassRealm instead, to allow them to be included in PluginDescriptor.getArtifacts
      ().
      
      
      [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
      [INFO] Setting property: velocimacro.messages.on => 'false'.
      [INFO] Setting property: resource.loader => 'classpath'.
      [INFO] Setting property: resource.manager.logwhenfound => 'false'.
      [INFO] **************************************************************
      [INFO] Starting Jakarta Velocity v1.4
      [INFO] RuntimeInstance initializing.
      [INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
      [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
      [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
      [INFO] ClasspathResourceLoader : initialization starting.
      [INFO] ClasspathResourceLoader : initialization complete.
      [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
      [INFO] Default ResourceManager initialization complete.
      [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
      [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
      [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
      [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
      [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
      [INFO] Created: 20 parsers.
      [INFO] Velocimacro : initialization starting.
      [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
      [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
      [INFO] Velocimacro : error using  VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: U
      nable to find resource 'VM_global_library.vm'
      [INFO] Velocimacro :  VM library template macro registration complete.
      [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
      [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
      [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
      [INFO] Velocimacro : initialization complete.
      [INFO] Velocity successfully started.
      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-javadoc-plugin:2.4:javadoc' -->
      [DEBUG]   (f) aggregate = true
      [DEBUG]   (f) author = true
      [DEBUG]   (f) bottom = <table border=0 background="" cellspacing=0 cellpadding=0 class="footer"><tr><td><center><font size="1" class="f
      ooter"><b><font size="+1">My Product</font><br>Copyright {inceptionYear}-{currentYear} MyCompany. All rights reserved.<br>My Product v1.
      0-SNAPSHOT API Documentation</b></font></center></td></tr></table>
      [DEBUG]   (f) breakiterator = false
      [DEBUG]   (f) charset = ISO-8859-1
      [DEBUG]   (f) debug = false
      [DEBUG]   (f) destDir = apidocs
      [DEBUG]   (f) docfilessubdirs = false
      [DEBUG]   (f) docletArtifact = groupId = 'null'
      artifactId = 'null'
      version = 'null'
      [DEBUG]   (f) docletArtifacts = [Lorg.apache.maven.plugin.javadoc.options.DocletArtifact;@671f95
      [DEBUG]   (f) doctitle = test 1.0-SNAPSHOT API
      [DEBUG]   (f) encoding = ISO-8859-1
      [DEBUG]   (f) footer = <b>My<br>v1.0-SNAPSHOT API-Documentation</b>
      [DEBUG]   (s) title = BE-Core Packages
      [DEBUG]   (s) packages = com.test.*
      [DEBUG]   (f) groups = [Lorg.apache.maven.plugin.javadoc.options.Group;@1754699
      [DEBUG]   (f) header = <b>My<br>v1.0-SNAPSHOT API-Documentation</b>
      [DEBUG]   (f) isOffline = false
      [DEBUG]   (f) javadocDirectory = D:\test\src\main\javadoc
      [DEBUG]   (f) keywords = false
      [DEBUG]   (f) links = [http://build.cm.mycompany.com/javase/6/docs/api]
      [DEBUG]   (f) linksource = false
      [DEBUG]   (f) localRepository = [local] -> file://D:/dev/repository
      [DEBUG]   (f) maxmemory = 1g
      [DEBUG]   (f) minmemory = 128m
      [DEBUG]   (f) nocomment = false
      [DEBUG]   (f) nodeprecated = false
      [DEBUG]   (f) nodeprecatedlist = false
      [DEBUG]   (f) nohelp = false
      [DEBUG]   (f) noindex = false
      [DEBUG]   (f) nonavbar = false
      [DEBUG]   (f) nooverview = false
      [DEBUG]   (f) nosince = false
      [DEBUG]   (f) notimestamp = false
      [DEBUG]   (f) notree = false
      [DEBUG]   (f) offlineLinks = [Lorg.apache.maven.plugin.javadoc.options.OfflineLink;@1a78071
      [DEBUG]   (f) old = false
      [DEBUG]   (f) outputDirectory = D:\test\target\apidocs
      [DEBUG]   (f) overview = D:\test\src\main\javadoc\overview.html
      [DEBUG]   (f) project = MavenProject: com:test:1.0-SNAPSHOT @ D:\test\pom.xml
      [DEBUG]   (f) quiet = false
      [DEBUG]   (f) reactorProjects = [MavenProject: com:test:1.0-SNAPSHOT @ D:\test\pom.xml, MavenProject: com.test.core:core:1.0-SNAPSHOT @
       D:\test\core\pom.xml]
      [DEBUG]   (f) remoteRepositories = [[central] -> http://repo1.cm.mycompany.com:80/artifactory/repo/]
      [DEBUG]   (s) reportOutputDirectory = D:\test\target\site\apidocs
      [DEBUG]   (f) serialwarn = false
      [DEBUG]   (f) settings = org.apache.maven.settings.Settings@691177
      [DEBUG]   (f) show = private
      [DEBUG]   (f) source = 1.6
      [DEBUG]   (f) splitindex = false
      [DEBUG]   (f) stylesheet = java
      [DEBUG]   (f) tagletArtifact = groupId = 'null'
      artifactId = 'null'
      version = 'null'
      [DEBUG]   (f) taglets = [Lorg.apache.maven.plugin.javadoc.options.Taglet;@1b4c1d7
      [DEBUG]   (s) name = date
      [DEBUG]   (s) placement = t
      [DEBUG]   (s) head = Creation Date:
      [DEBUG]   (f) tags = [Lorg.apache.maven.plugin.javadoc.options.Tag;@1f6f27b
      [DEBUG]   (f) use = true
      [DEBUG]   (f) verbose = false
      [DEBUG]   (f) version = true
      [DEBUG]   (f) windowtitle = test 1.0-SNAPSHOT API
      [DEBUG] -- end configuration --
      [INFO] [javadoc:javadoc]
      [DEBUG] com.test.core:core:jar:1.0-SNAPSHOT (selected for null)
      [DEBUG]   junit:junit:jar:4.4:test (selected for test)
      [DEBUG] Compiled artifacts for com.test.core:core:1.0-SNAPSHOT
      
      [DEBUG] D:\dev\jdk1.6.0_18\jre\..\bin\javadoc.exe -J-Xmx1024m -J-Xms128m @options @packages
      Loading source files for package com.test.api...
      Loading source files for package com.test.spi...
      Constructing Javadoc information...
      Standard Doclet version 1.6.0_18
      Building tree for all the packages and classes...
      Generating D:/test/target/site/apidocs\com/test/api/\CopyJob.html...
      Generating D:/test/target/site/apidocs\com/test/spi/\CopyJob.html...
      Generating D:/test/target/site/apidocs\overview-frame.html...
      Generating D:/test/target/site/apidocs\com/test/api/\package-frame.html...
      Generating D:/test/target/site/apidocs\com/test/api/\package-summary.html...
      Generating D:/test/target/site/apidocs\com/test/api/\package-tree.html...
      Generating D:/test/target/site/apidocs\com/test/spi/\package-frame.html...
      Generating D:/test/target/site/apidocs\com/test/spi/\package-summary.html...
      Generating D:/test/target/site/apidocs\com/test/spi/\package-tree.html...
      Generating D:/test/target/site/apidocs\constant-values.html...
      Generating D:/test/target/site/apidocs\com/test/api/\class-use\CopyJob.html...
      Generating D:/test/target/site/apidocs\com/test/spi/\class-use\CopyJob.html...
      Generating D:/test/target/site/apidocs\com/test/api/\package-use.html...
      Generating D:/test/target/site/apidocs\com/test/spi/\package-use.html...
      Building index for all the packages and classes...
      Generating D:/test/target/site/apidocs\overview-tree.html...
      Generating D:/test/target/site/apidocs\index-all.html...
      Generating D:/test/target/site/apidocs\deprecated-list.html...
      Building index for all classes...
      Generating D:/test/target/site/apidocs\allclasses-frame.html...
      Generating D:/test/target/site/apidocs\allclasses-noframe.html...
      Generating D:/test/target/site/apidocs\index.html...
      Generating D:/test/target/site/apidocs\overview-summary.html...
      Generating D:/test/target/site/apidocs\help-doc.html...
      Generating D:/test/target/site/apidocs\stylesheet.css...
      Note: Custom tags that could override future standard tags:  @date. To avoid potential overrides, use at least one period character (.)
       in custom tag names.
      Note: Custom tags that were not seen:  @date
      [INFO] ------------------------------------------------------------------------
      [INFO] Building core
      [INFO]    task-segment: [javadoc:javadoc]
      [INFO] ------------------------------------------------------------------------
      [DEBUG] com.test.core:core:jar:1.0-SNAPSHOT (selected for null)
      [DEBUG]   junit:junit:jar:4.4:test (selected for test)
      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-javadoc-plugin:2.4:javadoc' -->
      [DEBUG]   (f) aggregate = true
      [DEBUG]   (f) author = true
      [DEBUG]   (f) bottom = <table border=0 background="" cellspacing=0 cellpadding=0 class="footer"><tr><td><center><font size="1" class="f
      ooter"><b><font size="+1">My Product</font><br>Copyright {inceptionYear}-{currentYear} myCompany. All rights reserved.<br>My Product v1.
      0-SNAPSHOT API Documentation</b></font></center></td></tr></table>
      [DEBUG]   (f) breakiterator = false
      [DEBUG]   (f) charset = ISO-8859-1
      [DEBUG]   (f) debug = false
      [DEBUG]   (f) destDir = apidocs
      [DEBUG]   (f) docfilessubdirs = false
      [DEBUG]   (f) docletArtifact = groupId = 'null'
      artifactId = 'null'
      version = 'null'
      [DEBUG]   (f) docletArtifacts = [Lorg.apache.maven.plugin.javadoc.options.DocletArtifact;@98ce7e
      [DEBUG]   (f) doctitle = core 1.0-SNAPSHOT API
      [DEBUG]   (f) encoding = ISO-8859-1
      [DEBUG]   (f) footer = <b>My<br>v1.0-SNAPSHOT API-Documentation</b>
      [DEBUG]   (s) title = BE-Core Packages
      [DEBUG]   (s) packages = com.test.*
      [DEBUG]   (f) groups = [Lorg.apache.maven.plugin.javadoc.options.Group;@f8395f
      [DEBUG]   (f) header = <b>My<br>v1.0-SNAPSHOT API-Documentation</b>
      [DEBUG]   (f) isOffline = false
      [DEBUG]   (f) javadocDirectory = D:\test\core\src\main\javadoc
      [DEBUG]   (f) keywords = false
      [DEBUG]   (f) links = [http://build.cm.mycomapny.com/javase/6/docs/api]
      [DEBUG]   (f) linksource = false
      [DEBUG]   (f) localRepository = [local] -> file://D:/dev/repository
      [DEBUG]   (f) maxmemory = 1g
      [DEBUG]   (f) minmemory = 128m
      [DEBUG]   (f) nocomment = false
      [DEBUG]   (f) nodeprecated = false
      [DEBUG]   (f) nodeprecatedlist = false
      [DEBUG]   (f) nohelp = false
      [DEBUG]   (f) noindex = false
      [DEBUG]   (f) nonavbar = false
      [DEBUG]   (f) nooverview = false
      [DEBUG]   (f) nosince = false
      [DEBUG]   (f) notimestamp = false
      [DEBUG]   (f) notree = false
      [DEBUG]   (f) offlineLinks = [Lorg.apache.maven.plugin.javadoc.options.OfflineLink;@7e9ce2
      [DEBUG]   (f) old = false
      [DEBUG]   (f) outputDirectory = D:\test\core\target\apidocs
      [DEBUG]   (f) overview = D:\test\core\src\main\javadoc\overview.html
      [DEBUG]   (f) project = MavenProject: com.test.core:core:1.0-SNAPSHOT @ D:\test\core\pom.xml
      [DEBUG]   (f) quiet = false
      [DEBUG]   (f) reactorProjects = [MavenProject: com:test:1.0-SNAPSHOT @ D:\test\pom.xml, MavenProject: com.test.core:core:1.0-SNAPSHOT @
       D:\test\core\pom.xml]
      [DEBUG]   (f) remoteRepositories = [[central] -> http://repo1.cm.mycomapny.com:80/artifactory/repo/]
      [DEBUG]   (s) reportOutputDirectory = D:\test\core\target\site\apidocs
      [DEBUG]   (f) serialwarn = false
      [DEBUG]   (f) settings = org.apache.maven.settings.Settings@691177
      [DEBUG]   (f) show = private
      [DEBUG]   (f) source = 1.6
      [DEBUG]   (f) splitindex = false
      [DEBUG]   (f) stylesheet = java
      [DEBUG]   (f) tagletArtifact = groupId = 'null'
      artifactId = 'null'
      version = 'null'
      [DEBUG]   (f) taglets = [Lorg.apache.maven.plugin.javadoc.options.Taglet;@6dbdc9
      [DEBUG]   (s) name = date
      [DEBUG]   (s) placement = t
      [DEBUG]   (s) head = Creation Date:
      [DEBUG]   (f) tags = [Lorg.apache.maven.plugin.javadoc.options.Tag;@c6eff5
      [DEBUG]   (f) use = true
      [DEBUG]   (f) verbose = false
      [DEBUG]   (f) version = true
      [DEBUG]   (f) windowtitle = core 1.0-SNAPSHOT API
      [DEBUG] -- end configuration --
      [INFO] [javadoc:javadoc]
      [INFO]
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO] ------------------------------------------------------------------------
      [INFO] test .................................................. SUCCESS [4.251s]
      [INFO] core .................................................. SUCCESS [0.078s]
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4 seconds
      [INFO] Finished at: Mon Mar 08 13:42:17 CET 2010
      [INFO] Final Memory: 8M/123M
      [INFO] ------------------------------------------------------------------------
      

      The files of core/src/main/javadoc are not included. If the parameter <javadocDirectory>$

      {basedir}

      /src/main/javadoc</javadocDirectory> is replaced by a static fixed directory it works - but than what to do with over a 100 modules?

        Activity

        Hide
        Benson Margulies added a comment -

        The IT added here demonstrates that there is no bug here.

        ------------------------------------------------------------------------
        r1384979 | bimargulies | 2012-09-14 20:14:08 -0400 (Fri, 14 Sep 2012) | 3 lines

        MJAVADOC-278: Plugin does not include javadocDirectory correctly
        o add a test that proves that there's no problem here.

        ------------------------------------------------------------------------

        Show
        Benson Margulies added a comment - The IT added here demonstrates that there is no bug here. ------------------------------------------------------------------------ r1384979 | bimargulies | 2012-09-14 20:14:08 -0400 (Fri, 14 Sep 2012) | 3 lines MJAVADOC-278 : Plugin does not include javadocDirectory correctly o add a test that proves that there's no problem here. ------------------------------------------------------------------------
        Hide
        Benson Margulies added a comment -

        Note that resources are not copied unless you have docfilessubdir in the configuration.

        Show
        Benson Margulies added a comment - Note that resources are not copied unless you have docfilessubdir in the configuration.

          People

          • Assignee:
            Benson Margulies
            Reporter:
            Thomas Reitz
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: