Maven 2.x Ant Tasks

Add the ability to download javadoc dependencies

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.6, 2.0.7
  • Fix Version/s: 2.0.9
  • Component/s: dependencies task
  • Labels:
    None
  • Environment:
    Linux JDK 1.5
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

The ant task cannot download the javadocs files of dependencies.
Here a small patch to add this enhancement the same way of downloading sources.

  1. patch.txt
    21/Sep/07 6:28 AM
    4 kB
    Eric Hartmann
  2. patch2.txt
    05/Nov/07 7:26 AM
    4 kB
    Eric Hartmann

Issue Links

Activity

Hide
Herve Boutemy added a comment -

I added

<copy todir="target/files/javadocs">
  <fileset refid="javadocs.fileset"/>
</copy>

in sample.build.xml and the result didn't contain any javadocs but jars, poms, sha1, ...

I don't know where the problem is, but this patch doesn't work at all

Show
Herve Boutemy added a comment - I added
<copy todir="target/files/javadocs">
  <fileset refid="javadocs.fileset"/>
</copy>
in sample.build.xml and the result didn't contain any javadocs but jars, poms, sha1, ... I don't know where the problem is, but this patch doesn't work at all
Hide
Herve Boutemy added a comment -

can you provide a working testcase to add to sample.build.xml?

Show
Herve Boutemy added a comment - can you provide a working testcase to add to sample.build.xml?
Hide
Eric Hartmann added a comment -

Hi Herve,

Sorry, I did not see your comment before today.
I've just checked out the sources, applied the patch then deployed the jar to the lib directory of apache-ant.
Then I added this target to sample.build.xml :

<target name="test-javadoc-deps" depends="initTaskDefs">
<artifact:dependencies filesetId="maven-ant-tasks.dependency.fileset" javadocsFilesetId="javadocs.fileset">
<pom refid="maven.project"/>
</artifact:dependencies>

<copy todir="target/files/javadocs">
<fileset refid="javadocs.fileset"/>
</copy>
</target>

Then :

$ ant -f sample.build.xml test-javadoc-deps
Buildfile: sample.build.xml

initTaskDefs:

test-javadoc-deps:
[artifact:dependencies] Downloading: junit/junit/3.8.1/junit-3.8.1-javadoc.jar
[artifact:dependencies] Downloading: classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2-javadoc.jar
[artifact:dependencies] Downloading: jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-javadoc.jar
[artifact:dependencies] Downloading: ant/ant/1.6.2/ant-1.6.2-javadoc.jar
[artifact:dependencies] Downloading: xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-javadoc.jar

BUILD SUCCESSFUL
Total time: 3 seconds

It seems to work for me.

I've experienced such behaviour working with maven-ant tasks when there is no dependencies (as there is no includes everythings in the repository is copied). I did not have test this case. I will do it right now and submit another patch if it's the problem.

Show
Eric Hartmann added a comment - Hi Herve, Sorry, I did not see your comment before today. I've just checked out the sources, applied the patch then deployed the jar to the lib directory of apache-ant. Then I added this target to sample.build.xml : <target name="test-javadoc-deps" depends="initTaskDefs"> <artifact:dependencies filesetId="maven-ant-tasks.dependency.fileset" javadocsFilesetId="javadocs.fileset"> <pom refid="maven.project"/> </artifact:dependencies> <copy todir="target/files/javadocs"> <fileset refid="javadocs.fileset"/> </copy> </target> Then : $ ant -f sample.build.xml test-javadoc-deps Buildfile: sample.build.xml initTaskDefs: test-javadoc-deps: [artifact:dependencies] Downloading: junit/junit/3.8.1/junit-3.8.1-javadoc.jar [artifact:dependencies] Downloading: classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2-javadoc.jar [artifact:dependencies] Downloading: jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-javadoc.jar [artifact:dependencies] Downloading: ant/ant/1.6.2/ant-1.6.2-javadoc.jar [artifact:dependencies] Downloading: xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-javadoc.jar BUILD SUCCESSFUL Total time: 3 seconds It seems to work for me. I've experienced such behaviour working with maven-ant tasks when there is no dependencies (as there is no includes everythings in the repository is copied). I did not have test this case. I will do it right now and submit another patch if it's the problem.
Hide
Eric Hartmann added a comment -

Here is a patch containing the test in sample.build.xml and the correction when there is no dependency to prevent the copy of all files.

Show
Eric Hartmann added a comment - Here is a patch containing the test in sample.build.xml and the correction when there is no dependency to prevent the copy of all files.
Hide
Herve Boutemy added a comment -

fixed in trunk r615579 and 2.0.x branch r615580
I did much refactorings in the code, since this javadocs handling code was causing really too much copy/paste: the result is really a lot better than the initial code without javadoc feature
thanks for your help

Show
Herve Boutemy added a comment - fixed in trunk r615579 and 2.0.x branch r615580 I did much refactorings in the code, since this javadocs handling code was causing really too much copy/paste: the result is really a lot better than the initial code without javadoc feature thanks for your help
Hide
Herve Boutemy added a comment -

I just renamed javadocsFilesetId to javadocFilesetId (without s) to be consistent with Maven classifier

Show
Herve Boutemy added a comment - I just renamed javadocsFilesetId to javadocFilesetId (without s) to be consistent with Maven classifier

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: