You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Singhal, Pulkit" <pu...@hp.com> on 2009/07/09 21:55:41 UTC

Getting source code for existing JARs

Hello,

I wanted to know if maven can be used to fetch source code for existing jars on a system?
Can I simply point maven to a jar on my system and expect it to do its best to fetch the source code for the correct version according to my jar from its global repository?
Can I do this via an eclipse plugin?

Thanks!

RE: Getting source code for existing JARs

Posted by Martin Gainty <mg...@hotmail.com>.
take a look at maven-emma

http://emma.sourceforge.net/maven-emma-plugin/cvs-usage.html

>maven scm:checkout-project
            -Dmaven.scm.method=cvs
            -Dmaven.scm.cvs.module=plugins/maven/maven-emma-plugin/
            -Dmaven.scm.cvs.root=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/emma
            -Dmaven.scm.checkout.dir=.

With Warm Regards
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: pulkit.singhal@hp.com
> To: users@maven.apache.org
> Date: Thu, 9 Jul 2009 19:55:41 +0000
> Subject: Getting source code for existing JARs
> 
> Hello,
> 
> I wanted to know if maven can be used to fetch source code for existing jars on a system?
> Can I simply point maven to a jar on my system and expect it to do its best to fetch the source code for the correct version according to my jar from its global repository?
> Can I do this via an eclipse plugin?
> 
> Thanks!

_________________________________________________________________
Insert movie times and more without leaving Hotmail®. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

AW: Getting source code for existing JARs

Posted by "Lewis, Eric" <Er...@ipi.ch>.
Well, I don't know if you're using m2eclipse, but with that it's possible. Just open the Maven Dependencies, right-click on some jar and choose "Maven... download sources".

Best regards,
Eric

-----Ursprüngliche Nachricht-----
Von: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] Im Auftrag von Anders Hammar
Gesendet: Freitag, 10. Juli 2009 00:08
An: Maven Users List
Betreff: Re: Getting source code for existing JARs

Hi,

Not the magically way I think you're asking for, no. Not to my knowledge anyhow.
What you could do, is to try to find out what artifact you have an
then, if you're lucky, the source code might exist in a repository
(central for instance). One way to find out what artifact you have is
to use its checksum and then use a Nexus instance to try to find a
match. You can find some info about this in one of Jason van Zyl's
blog posts:
http://www.sonatype.com/people/2009/04/mavenizing-the-appengine-sdk/

/Anders

On Thu, Jul 9, 2009 at 21:55, Singhal, Pulkit<pu...@hp.com> wrote:
> Hello,
>
> I wanted to know if maven can be used to fetch source code for existing jars on a system?
> Can I simply point maven to a jar on my system and expect it to do its best to fetch the source code for the correct version according to my jar from its global repository?
> Can I do this via an eclipse plugin?
>
> Thanks!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Getting source code for existing JARs

Posted by Anders Hammar <an...@hammar.net>.
Hi,

Not the magically way I think you're asking for, no. Not to my knowledge anyhow.
What you could do, is to try to find out what artifact you have an
then, if you're lucky, the source code might exist in a repository
(central for instance). One way to find out what artifact you have is
to use its checksum and then use a Nexus instance to try to find a
match. You can find some info about this in one of Jason van Zyl's
blog posts:
http://www.sonatype.com/people/2009/04/mavenizing-the-appengine-sdk/

/Anders

On Thu, Jul 9, 2009 at 21:55, Singhal, Pulkit<pu...@hp.com> wrote:
> Hello,
>
> I wanted to know if maven can be used to fetch source code for existing jars on a system?
> Can I simply point maven to a jar on my system and expect it to do its best to fetch the source code for the correct version according to my jar from its global repository?
> Can I do this via an eclipse plugin?
>
> Thanks!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Getting source code for existing JARs

Posted by Anders Hammar <an...@hammar.net>.
If I didn't misunderstand the situation, the poster has a runtime
system with a bunch of jars. Thus, no poms.

/Anders

On Fri, Jul 10, 2009 at 02:52, Barrie Treloar<ba...@gmail.com> wrote:
> On Fri, Jul 10, 2009 at 5:25 AM, Singhal, Pulkit<pu...@hp.com> wrote:
>> Hello,
>>
>> I wanted to know if maven can be used to fetch source code for existing jars on a system?
>> Can I simply point maven to a jar on my system and expect it to do its best to fetch the source code for the correct version according to my jar from its global repository?
>> Can I do this via an eclipse plugin?
>>
>> Thanks!
>>
>
> If you have your dependencies declared correctly in a pom you can use
>  mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
>
> to download both the source jar and the javadoc jar (you may need the
> javadoc if the source does not exist)
>
> If you happen to also be using eclipse as your IDE then everything is
> all setup and ready for importing your projects.
>
> If not, you can find the -sources and -javadoc jars in the same
> directory as the base jar in your local m2 repository.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Getting source code for existing JARs

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Jul 10, 2009 at 5:25 AM, Singhal, Pulkit<pu...@hp.com> wrote:
> Hello,
>
> I wanted to know if maven can be used to fetch source code for existing jars on a system?
> Can I simply point maven to a jar on my system and expect it to do its best to fetch the source code for the correct version according to my jar from its global repository?
> Can I do this via an eclipse plugin?
>
> Thanks!
>

If you have your dependencies declared correctly in a pom you can use
  mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true

to download both the source jar and the javadoc jar (you may need the
javadoc if the source does not exist)

If you happen to also be using eclipse as your IDE then everything is
all setup and ready for importing your projects.

If not, you can find the -sources and -javadoc jars in the same
directory as the base jar in your local m2 repository.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org