How to install Maven artifact with sources from command line?
JavaEclipseMavenJava Problem Overview
How to install Maven artifact with sources?
so later I don't need to open a project in eclipse to see some code.
EDIT: I do know I can add to pom.xml this code
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
but I would like to do it from command line(to make it more universal).
Java Solutions
Solution 1 - Java
To download sources for your dependencies:
mvn eclipse:eclipse -DdownloadSources=true
To attach sources to an installation:
mvn source:jar install
It's also preferable to use the goal source:jar-no-fork
in your pom as described on the maven-source-plugin page.
Solution 2 - Java
Simple, get your sources and JavaDocs:
mvn dependency:resolve -Dclassifier=javadoc
mvn dependency:resolve -Dclassifier=sources
Solution 3 - Java
Please use mvn source:jar
install to install the Maven artifacts.
Solution 4 - Java
It is quite easy with eclipse, right click the project in project explorer view, click maven menu item , then click download sources..