Maven 2.x Javadoc Plugin

Resource copying from javadoc dir is incomplete

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.6
  • Fix Version/s: 2.6.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Mac OS X 10.5.7
  • Number of attachments :
    1

Description

The plugin is ignoring my directory src/main/javadoc/resources

I want to put in background images for my stylesheet to use, and I want to overwite inherit.gif (to one with a transparent background, a Java problem since I started with Java back before 1.0, sigh). So I put a bg.gif and a new inherit.gif in src/main/javadoc/resources. It is not copied. I do have <docfilessubdirs> set to true.

I have attached a subset of my project that demonstrates the problem. Unzip and then run mvn javadoc:javadoc. If you look at target/site/apidocs/resources, the file contains only one file, while src/main/javadoc/resources contains three.

Activity

Hide
Ken Arnold added a comment -

After a little more experimentation – the plugin seems only to be looking for files that might otherwise live in the java source tree – overview.html et al, and doc-files dirs. This seems overly restrictive – the reason for the doc-files subdir in a well-formed java source tree is to avoid intermixing the java source and doc files. By separating them out into a javadoc tree, you have already gotten away from this problem.

However, this still leaves me stymied without a way to add overall resources to the javadoc run, and especially without a way to override anything but the stylesheet (which is handled as a special case). I can work around my background image problem by putting it in a top-level doc-files dir, but I can't override inherit.gif that way. I should be able to set the resources dir. (Imagine, for example, a doclet that needed its own resource comparable to inherit.gif – where could it put it, how could it be supported in the plugin?)

Show
Ken Arnold added a comment - After a little more experimentation – the plugin seems only to be looking for files that might otherwise live in the java source tree – overview.html et al, and doc-files dirs. This seems overly restrictive – the reason for the doc-files subdir in a well-formed java source tree is to avoid intermixing the java source and doc files. By separating them out into a javadoc tree, you have already gotten away from this problem. However, this still leaves me stymied without a way to add overall resources to the javadoc run, and especially without a way to override anything but the stylesheet (which is handled as a special case). I can work around my background image problem by putting it in a top-level doc-files dir, but I can't override inherit.gif that way. I should be able to set the resources dir. (Imagine, for example, a doclet that needed its own resource comparable to inherit.gif – where could it put it, how could it be supported in the plugin?)
Hide
Vincent Siveton added a comment -

fixed in r813404, snapshot deployed

Show
Vincent Siveton added a comment - fixed in r813404, snapshot deployed
Hide
Ken Arnold added a comment -

Wow, that was fast. Thanks!

Show
Ken Arnold added a comment - Wow, that was fast. Thanks!
Hide
Christian Vest Hansen added a comment -

It looks like this is not really fixed after all. I just tried generating javadocs for the attached project with both version 2.6.1 and 2.8, and the files are not copied:

[cvh: jd]$ mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /home/cvh/Apps/apache-maven-3.0.3
Java version: 1.6.0_20, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_DK, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-31-generic-pae", arch: "i386", family: "unix"
[cvh: jd]$ mvn javadoc:javadoc -Dquiet
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.simplx:simplx:jar:0.8.4
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 49, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 54, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: commons-io:commons-io:jar -> duplicate declaration of version 1.4 @ line 59, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 64, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 74, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-idea-plugin is missing. @ line 119, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 127, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 140, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. @ line 182, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:cobertura-maven-plugin is missing. @ line 186, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-project-info-reports-plugin is missing. @ line 190, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building simplx 0.8.4
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.8:javadoc (default-cli) @ simplx >>>
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.8:javadoc (default-cli) @ simplx <<<
[INFO] 
[INFO] --- maven-javadoc-plugin:2.8:javadoc (default-cli) @ simplx ---
[WARNING] Source files encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.932s
[INFO] Finished at: Mon May 16 15:24:47 CEST 2011
[INFO] Final Memory: 8M/94M
[INFO] ------------------------------------------------------------------------
[cvh: jd]$ ls target/site/apidocs/resources/
inherit.gif
[cvh: jd]$ ls src/main/javadoc/resources/
bg.jpg  bg.psd  inherit.gif
[cvh: jd]$
Show
Christian Vest Hansen added a comment - It looks like this is not really fixed after all. I just tried generating javadocs for the attached project with both version 2.6.1 and 2.8, and the files are not copied:
[cvh: jd]$ mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /home/cvh/Apps/apache-maven-3.0.3
Java version: 1.6.0_20, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_DK, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-31-generic-pae", arch: "i386", family: "unix"
[cvh: jd]$ mvn javadoc:javadoc -Dquiet
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.simplx:simplx:jar:0.8.4
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 49, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 54, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: commons-io:commons-io:jar -> duplicate declaration of version 1.4 @ line 59, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 64, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.5 @ line 74, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-idea-plugin is missing. @ line 119, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 127, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 140, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. @ line 182, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:cobertura-maven-plugin is missing. @ line 186, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-project-info-reports-plugin is missing. @ line 190, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building simplx 0.8.4
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.8:javadoc (default-cli) @ simplx >>>
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.8:javadoc (default-cli) @ simplx <<<
[INFO] 
[INFO] --- maven-javadoc-plugin:2.8:javadoc (default-cli) @ simplx ---
[WARNING] Source files encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.932s
[INFO] Finished at: Mon May 16 15:24:47 CEST 2011
[INFO] Final Memory: 8M/94M
[INFO] ------------------------------------------------------------------------
[cvh: jd]$ ls target/site/apidocs/resources/
inherit.gif
[cvh: jd]$ ls src/main/javadoc/resources/
bg.jpg  bg.psd  inherit.gif
[cvh: jd]$

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: