3

I am trying to get this ant-based project's init target to download all the sources and javadocs.

I added the following to my ~/.m2/settings.xml (as per Maven – Always download sources and javadocs) but it doesn't force source downloads when used from ant:

<profiles>
    <profile>
      <id>downloadSources</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <downloadSources>true</downloadSources>
      </properties>
    </profile>
 </profiles>

The only way I could get the sources to download was by hacking build.xml so that all <artifact:dependencies> elements include sourcesFilesetId="sources.dependency.fileset", but this is a pretty distasteful commit that is unlikely to be accepted by the maintainers. A better solution would exist with a property file definition, preferably in the user's settings (not something that mutates the project definition)

Is there a simpler way to ensure that all the sources (and potentially javadocs) are globally downloaded in maven ant tasks?

Community
  • 1
  • 1
fommil
  • 5,757
  • 8
  • 41
  • 81
  • Is there any reason why you try to do that via ant-task instead of maven directly? – khmarbaise Sep 25 '14 at 17:07
  • Because it's an ant project maybe? – fommil Sep 25 '14 at 18:19
  • But it might be better to use maven like `mvn dependency:source` see http://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html – khmarbaise Sep 25 '14 at 19:21
  • 2
    This isn't a maven project. If you'd like to submit a PR to turn it into a maven project, I'm sure they'd welcome that. But since it's the build config for a compiler, with several bootstrapping phases, I can guarantee you that such a port won't be trivial. – fommil Sep 25 '14 at 19:29

0 Answers0