• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it possible to download source code using maven?

 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope there should be one way to get the source using maven.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you mean the source code for your dependencies. If the dependency source is deployed to the remote repository, you can get it using the Dependency plugin, specifying that you want the "source" classifers, like this:

mvn dependency:copy-dependencies -Dclassifier=source -Dmdep.failOnMissingClassifierArtifact=false

The sources will be in target/dependency.


 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter, Thanks for your reply but I mean source code is a jar file used to attach to eclipse source code. To know how a particular class is implemented.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You never mentioned Eclipse in your original question, so how was I supposed to know? This makes your question one about Eclipse, so I am moving your post.

If you are using m2eclipse, and you have a Maven project, m2eclipse automatically downloads and attaches source JAR files. (Check you project's Build Path, under the Libraries tab expand Maven Dependecnies and then look under each JAR, many of them should have Source Attachment entries - see the attached image.) Of course, the source JARs must be available in the repository for this to work automatically. If there is no source JAR, you can always select Source Attachment, click the Edit button, and then browse to the source location (which you will have to provide yourself).
sourcesjars.png
[Thumbnail for sourcesjars.png]
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic