1

I am using Maven in Eclipse to manage the project dependencies which are resolved from a local repository (SNAPSHOT). It works fine for compiling, but when I am trying to download the sources of a package (via right-click on package and Maven -> Download Sources) it does not work.

All I am getting is this output, but no information why the plugin is not trying to download the sources:

27.08.09 11:42:24 MESZ: [INFO] User settings file does not exist /home/my-name/.m2/settings.xml
27.08.09 11:42:24 MESZ: [DEBUG] Reading global settings from: /opt/shared/apache-maven/conf/settings.xml
27.08.09 11:42:24 MESZ: [DEBUG] Reading user settings from: null
27.08.09 11:42:24 MESZ: [DEBUG] Settings file is null. Returning null.

The files at the repository look like this:

Collection: /com/my-company/product/0.0.2-SNAPSHOT

# product-0.0.2-20090827.071202-1-sources.jar
# product-0.0.2-20090827.071202-1-sources.jar.md5
# product-0.0.2-20090827.071202-1-sources.jar.sha1
# product-0.0.2-20090827.071202-1.jar
# product-0.0.2-20090827.071202-1.jar.md5
# product-0.0.2-20090827.071202-1.jar.sha1
# product-0.0.2-20090827.071202-1.pom
# product-0.0.2-20090827.071202-1.pom.md5
# product-0.0.2-20090827.071202-1.pom.sha1
# maven-metadata.xml
# maven-metadata.xml.md5
# maven-metadata.xml.sha1

Does anybody have any suggestions why the source download is not working?

Bertolt
  • 995
  • 1
  • 13
  • 37

3 Answers3

0

My maven-installation resides in a version folder (e.g. /opt/shared/apache-maven-2.2.1) and a shared folder is linked to that folder (e.g. /opt/shared/apache-maven). It might be that Eclipse or m2eclipse has problems with symbolic links ...

Because the problem went away after I did the following things:

  1. changed the path of the local Maven installation under Window->Preferences->Maven->Installations from the shared folder to the version folder
  2. Retried downloading sources
  3. changed the path of the local Maven installation to the shared folder again

I don't know what happened exactly, but this solved my problems magically.

Bertolt
  • 995
  • 1
  • 13
  • 37
0

try searching in the m2Eclipse Issues there are a couple of "Download Sources" Issues Maybe this is the Problem you described

Martin Dürrmeier
  • 1,653
  • 5
  • 18
  • 35
0

In my case, and possibly the OP's too, the bad/missing settings.xml file is important. Eclipse will use a default if yours isn't usable (mine specified repos that are inaccessible for some security related reason). From the command line I'd been specifying a --settings value and Eclipse wasn't getting this assistance.

Once I got everything to compile correctly (don't ignore the Eclipse maven build errors) then it was able to download my Spring sources. Hopefully I can do some work now.

Sridhar Sarnobat
  • 25,183
  • 12
  • 93
  • 106