Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting lift sources from maven repository

I'm trying to learn how to use lift. I can create project skeleton by running maven commands (I had zero maven experience before) from Starting with Lift. It successfully downloads needed dependencies and everything works fine, however it does not download sources - I'd like to see how lift works from inside.

Looks like it downloads dependencies from here and there are compiled .jar files as well as sources - there are lift-mapper-1.0.jar and lift-mapper-1.0-sources.jar, but only lift-mapper-1.0.jar is downloaded to my local repository. I could download sources manually, but there are more than just few folders there. So, is there a way to tell it to Maven to download dependencies with sources?

like image 904
Pavel Feldman Avatar asked Sep 07 '09 07:09

Pavel Feldman


People also ask

How do I force Maven to download dependencies from remote repository?

We can use -U/--update-snapshots flag when building a maven project to force maven to download dependencies from the remote repository. Here, -U,--update-snapshots : Forces a check for missing releases and updated snapshots on remote repositories.

How do I access a Maven repository?

Where is the Maven Central repository? Maven Central can be accessed from https://repo.maven.apache.org/maven2/.

Where are Maven artifacts stored?

Maven's local repository is a directory on the local machine that stores all the project artifacts. When we execute a Maven build, Maven automatically downloads all the dependency jars into the local repository. Usually, this directory is named . m2.

What does Mvn generate sources do?

The “maven-source” plugin is used to pack your source code and deploy along with your project. This is extremely useful, for developers who use your deployed project and also want to attach your source code for debugging.


1 Answers

The maven-dependency-plugin has a sources goal that will obtain the sources for all dependencies that are available. Simply run mvn dependency:sources to obtain the sources.

If you are using Eclipse, the m2eclipse plugin handles source resolution and attachment for you. You can set it to automatically obtain sources in the Maven preferences. Window > Preferences...->Maven, then enable Download Artifact Sources.

You can also manually invoke "Download Sources" action from the Maven popup menu on any jars (including those that are not managed with Maven). Then plugin will use Maven repository indexes to lookup the corresponding Maven artifact and download its sources.

download sources

like image 74
Rich Seller Avatar answered Oct 05 '22 03:10

Rich Seller