0

Is there a way to get the source jar besides the binary jar by using maven?

user496949
  • 83,087
  • 147
  • 309
  • 426
  • 1
    possible duplicate of [get source jars from maven repository](http://stackoverflow.com/questions/2059431/get-source-jars-from-maven-repository) – Matt Fenwick Oct 11 '13 at 12:32

2 Answers2

4

Try this:

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

This works using Eclipse, otherwise you can do this on the command line:

# mvn dependency:sources
# mvn dependency:resolve -Dclassifier=javadoc
Tim
  • 13,228
  • 36
  • 108
  • 159
  • # mvn dependency:sources # mvn dependency:resolve -Dclassifier=javadoc works. I want to know what is your first solution mean? – user496949 Feb 27 '11 at 08:26
  • The first one is if you use Eclipse and you put this into your `pom.xml` file managing repositories, dependencies and plugins. – Tim Mar 08 '11 at 14:47
1

This might help: Get source JARs from Maven repository

Community
  • 1
  • 1
esaj
  • 15,875
  • 5
  • 38
  • 52