0

I've been trying to accomplish two things that I figured would be pretty trivial with Maven (I'm using 3.0.3 and the latest versions of all the plugins), but no matter what I do I can't seem to make it work. I need to:

  1. Copy all of the files (they're images) from build/javadoc-css/resources/ (relative to project root) to the resources/ directory in the Javadoc output. The stylesheet I'm using references images in that resources directory, and I need to copy the associated images into that resources/ directory. So far, it appears you can only copy files in doc-files/ directories. I'm hoping I'm missing something, because that is seriously lacking.
  2. Copy all of the files (LICENSE.txt and NOTICE.txt, which I figured were common things that everyone needs to copy) from build/jar/META-INF to the META-INF directories in all of my output jars. (Note: I don't want to put the META-INF directory with my LICENSE and NOTICE files in the source directory, because I have many modules, and I don't want many copies of these files.)

To accomplish #1, I have focused my efforts on the <javadocDirectory> and <docfilessubdirs> tags, but these only work with doc-files/ directories it appears.

For #2, I've tried several variations of the <resource> tag:

Variation #1:

<resource>
    <directory>build/jar/META-INF</directory>
    <targetPath>META-INF</targetPath>
    <includes>
        <include>LICENSE.txt</include>
        <include>NOTICE.txt</include>
    </includes>
</resource>

Variation #2:

<resource>
    <directory>build/jar</directory>
    <targetPath>META-INF</targetPath>
    <includes>
        <include>META-INF</include>
    </includes>
</resource>

Variation #3:

<resource>
    <directory>build/jar/META-INF</directory>
    <targetPath>META-INF</targetPath>
    <includes>
        <include>**</include>
    </includes>
</resource>

No errors or files in the wrong place. It's just like my resource tags weren't even there. Nothing happens.

Nick Williams
  • 2,864
  • 5
  • 29
  • 43
  • I figured out the META-INF resources part. My project has multiple modules, and I was placing the above resource declarations in the parent POM. But it needed to be in each of the child POMs. This worked if it was placed in every child POM: ` META-INF ../build/jar/META-INF `. Still no dice on the Javadoc resources/ images. – Nick Williams Jan 25 '13 at 22:36

1 Answers1

0

I would suggest to put the resources for javadoc into the appropriate folder which is in Maven:

yourproject
  |-- src
     |-- main
        |-- java
        |  |-- org
        |     |-- apache
        |        |-- myapp
        |         `-- App.java
        |         `-- package-info.java
        |-- javadoc
         `-- overview.html
           |-resources
           |-- org
              |-- apache
                 |-- myapp
                  `-- package.html
                    |-- doc-files
                     `-- app.png
khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • That does not work. It still only copies files in doc-files directories. My images are directly underneath resources/ and are ignored. – Nick Williams Jan 25 '13 at 08:45