misco
misco

Reputation: 1952

How to download sources and javadoc artifacts with Maven Eclipse plugin from other repository?

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.

Upvotes: 13

Views: 32685

Answers (3)

David L.
David L.

Reputation: 3290

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

mvn dependency:sources

Upvotes: 0

Rohitdev
Rohitdev

Reputation: 880

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

Upvotes: 1

khmarbaise
khmarbaise

Reputation: 97527

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.

Upvotes: 31

Related Questions