12

I have spring framework dependencies in my Maven project. I want to attach the Javadoc for spring framework dependencies.

I added to pom.xml following lines

<repositories>
    <repository>
        <id>springsource-repo</id>
        <name>SpringSource Repository</name>
        <url>http://repo.springsource.org/release</url>
    </repository>
</repositories>

<build>
<plugins>
    ...
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.9</version>
        <configuration>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>true</downloadJavadocs>
        </configuration>
    </plugin>
</plugins>
</build>

I have installed m2eclipse and I also checked option Download Artifact Sources/Javadoc in settings.

When I run mvn eclipse:eclipse, it doesn't show any warnings. But javadoc .jar files aren't downloaded.

Tome
  • 3,234
  • 3
  • 33
  • 36
misco
  • 1,912
  • 4
  • 41
  • 68
  • 2
    The configuration you set should work. But if you first tried without having a repository that provides the artifacts, eclipse plugin will keep a cache of non-available artifacts. Just launch a eclipse:remove-cache to be sure it is not the case here. – Tome Jun 13 '13 at 12:21
  • Are you working with m2e in Eclipse? Which Version of Eclipse? – khmarbaise Jun 13 '13 at 12:30
  • @Tome Your suggest with option `eclipse:remove-cache` helped me. But there was other issue, javadoc for spring version `3.0.2` wasn't on the repository server. So after removing cache I saw this issue and changed version to `3.2.0` and run eclipse:eclipse again. And it works! – misco Jun 13 '13 at 13:28

3 Answers3

30

In Eclipse goto Windows->preferences->Maven and there you check the box with download sources and may be download javadoc as well. That should do the trick.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
1

You can download from this location http://repo.spring.io/libs-release/org/springframework/spring/

Rohitdev
  • 866
  • 6
  • 15
0

With a Maven project, simply run in the command line:

mvn dependency:sources

David L.
  • 3,149
  • 2
  • 26
  • 28