You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stéphane Nicoll <St...@bsb.com> on 2004/10/20 15:13:56 UTC

strategy to retrieve the sources of an maven project

Hello,
 
We have multiple maven projects used by different teams and they request us to send soures as well (so that they can debug problems more deeply).
 
The idea would be to generate a artifact-src.jar as well and deploy it somewhere.
 
Is there a standard way to do this?
 
Regards,
 
Stéphane
 
Stéphane Nicoll
Business Solutions Builders
Place de l'Université 25/10
B-1348 Louvain-La-Neuve
 

Re: strategy to retrieve the sources of an maven project

Posted by Krystian Nowak <kr...@man.poznan.pl>.
Eric Pugh wrote:
> Can you file a JIRA issue and add a patch file so this doesn't get lost?
> While we have added a bit of support in Eclipse for source code, it has been
> purely for the convenience of the users and doesn't reflect at all how
> future versions of Maven will handle source.  I should probably add a
> disclaimer on the plugin site!

Done!

http://jira.codehaus.org/browse/MPECLIPSE-60



Regards,
Krystian


-- 
Krystian Nowak
krystian@man.poznan.pl
===========================================
Poznan Supercomputing and Networking Center
Poland, 60-814 Poznan, Zwierzyniecka 20
tel. (+48 61) 8582164 fax. (+48 61) 8582151
http://www.man.poznan.pl
===========================================
BlueEyes - Human-Operator Monitoring System
http://www.blueeyes.prv.pl
http://www.cs.put.poznan.pl/csidc/2001
===========================================

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


RE: strategy to retrieve the sources of an maven project

Posted by Eric Pugh <ep...@upstate.com>.
Can you file a JIRA issue and add a patch file so this doesn't get lost?
While we have added a bit of support in Eclipse for source code, it has been
purely for the convenience of the users and doesn't reflect at all how
future versions of Maven will handle source.  I should probably add a
disclaimer on the plugin site!

eRic

> -----Original Message-----
> From: Krystian Nowak [mailto:krystian@man.poznan.pl]
> Sent: Friday, December 03, 2004 1:36 PM
> To: Maven Users List
> Subject: Re: strategy to retrieve the sources of an maven project
>
>
> Eric Pugh wrote:
> > If what you are looking for is how to download, well I think it's just a
> > call to s static method.  Look at ctmsInstall plugin for an example ;-).
> > It's not slick, but what you see there is how Maven as well does the
> > download, just search for the jellyscript in Maven.
> >
> > Now, what we have right now is loading up from a /src/ directory.
>
> I've attached plugin.jelly for maven-eclipse-plugin downloading sources
> from ${repo}/${groupId}/src/${artifactId}-${version}.zip and installing
> it as ${maven.repo.local}/${groupId}/src/${artifactId}-${version}.zip.
>
> It does it for all jar dependencies having eclipse.source property set
> to true. Example project.xml:
>
> (...)
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<url>http://www.junit.org/</url>
> 			<properties>
> 				<eclipse.source>true</eclipse.source>
> 			</properties>
> 		</dependency>
> 	</dependencies>
> (...)
>
> What you have to do now is to call "maven eclipse" and refresh your
> project in Eclipse.
>
> Have fun!
>
>
> Regards,
> Krystian
>
>
> --
> Krystian Nowak
> krystian@man.poznan.pl
> ===========================================
> Poznan Supercomputing and Networking Center
> Poland, 60-814 Poznan, Zwierzyniecka 20
> tel. (+48 61) 8582164 fax. (+48 61) 8582151
> http://www.man.poznan.pl
> ===========================================
> BlueEyes - Human-Operator Monitoring System
> http://www.blueeyes.prv.pl
> http://www.cs.put.poznan.pl/csidc/2001
> ===========================================
>
>


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


Re: strategy to retrieve the sources of an maven project

Posted by Krystian Nowak <kr...@man.poznan.pl>.
Eric Pugh wrote:
> If what you are looking for is how to download, well I think it's just a
> call to s static method.  Look at ctmsInstall plugin for an example ;-).
> It's not slick, but what you see there is how Maven as well does the
> download, just search for the jellyscript in Maven.
> 
> Now, what we have right now is loading up from a /src/ directory.

I've attached plugin.jelly for maven-eclipse-plugin downloading sources 
from ${repo}/${groupId}/src/${artifactId}-${version}.zip and installing 
it as ${maven.repo.local}/${groupId}/src/${artifactId}-${version}.zip.

It does it for all jar dependencies having eclipse.source property set 
to true. Example project.xml:

(...)
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<url>http://www.junit.org/</url>
			<properties>
				<eclipse.source>true</eclipse.source>
			</properties>
		</dependency>
	</dependencies>
(...)

What you have to do now is to call "maven eclipse" and refresh your 
project in Eclipse.

Have fun!


Regards,
Krystian


-- 
Krystian Nowak
krystian@man.poznan.pl
===========================================
Poznan Supercomputing and Networking Center
Poland, 60-814 Poznan, Zwierzyniecka 20
tel. (+48 61) 8582164 fax. (+48 61) 8582151
http://www.man.poznan.pl
===========================================
BlueEyes - Human-Operator Monitoring System
http://www.blueeyes.prv.pl
http://www.cs.put.poznan.pl/csidc/2001
===========================================

RE: strategy to retrieve the sources of an maven project

Posted by Eric Pugh <ep...@upstate.com>.
Insofar as we are looking for the minimal solution for Eclipse for use
today, I think you oonly want to bother downloading /foo/dist/foo-0.1.zip.
Maven2 or whatever will have better handling of source zips, but that could
a while, so we don't want to wait!

If what you are looking for is how to download, well I think it's just a
call to s static method.  Look at ctmsInstall plugin for an example ;-).
It's not slick, but what you see there is how Maven as well does the
download, just search for the jellyscript in Maven.

Now, what we have right now is loading up from a /src/ directory.  You just
tweak the plugin to read from both places.  Or, just change the directory to
just read from /dist/foo-0.1.zip.

Eric

> -----Original Message-----
> From: Ben Gidley [mailto:bgidley@gmail.com]
> Sent: Tuesday, October 26, 2004 8:17 AM
> To: Maven Users List
> Subject: Re: strategy to retrieve the sources of an maven project
>
>
> I would like to do this to and have started modifying the Eclipse
> plugin to get sources from
> the dist folder on the repository - unfortunately as far as I can tell
> - there is no standard way of getting maven to download the dist
> folder
>
> When uploading you can use the goal to create maven:dist to create the
> following files. Which I belive are meant to be uploaded to the repo
> as follows
>
> /foo/dist/foo-0.1.zip
> /foo/dist/foo-0.1-src.zip
> /foo/dist/foo-0.1.tar.gz
> /foo/dist/foo-0.1-src.tar.gz
>
> The src.zip version works fine when attatched to eclipse.
>
> The zip/tar.gz versions contain classes and javadocs
> The src.zip/tar.gz contain just source
>
> If there was a easy way to fetch these modifying the eclipse plugin to
> add them would be simple. But I cannot find an easy way to fetch them
> - does anyone have any ideas?
>
> Ben Gidley
>
> On Mon, 25 Oct 2004 17:54:49 +0200, Krystian Nowak
> <kr...@man.poznan.pl> wrote:
> > Stéphane Nicoll wrote:
> > > We have multiple maven projects used by different teams and
> they request us to send soures as well (so that they can debug
> problems more deeply).
> > > The idea would be to generate a artifact-src.jar as well and
> deploy it somewhere.
> > > Is there a standard way to do this?
> >
> > I was thinking about more automated approach:
> >
> > When you publish your mavenized project you would be able to select if
> > you are publishing it as:
> > a) code (*.class) only,
> > b) code + javadoc
> > c) code + sources
> > and then if another project is using yours as dependency
> > the descriptor of such a dependency in project.xml would look like this:
> >
> >     <dependency>
> >        <groupId>foo</groupId>
> >        <artifactId>foo-bar</artifactId>
> >        <version>1.4.1</version>
> >        <properties>
> >          <blah.plugin.src>true</blah.plugin.src>
> >         <blah.plugin.javadoc>true</blah.plugin.javadoc>
> >        </properties>
> >      </dependency>
> >
> > Having code + sources (c) we can generate javadoc and include in our
> > project's javadoc report. If developers are using Eclipse we can define
> > e.g. LIB_SRC variable and unpack in LIB_SRC directory all sources from
> > dependencies (if available).
> >
> > It would require a unified file and/or directory structure on remove
> > repository (e.g. ibiblio). Let's say:
> >
> > .../foo/jars/foo-bar-1.4.1.jar
> > .../foo/jars/foo-bar-1.4.1-src.jar
> > .../foo/jars/foo-bar-1.4.1-doc.jar
> >
> > Of course automated deployment to create those jars is required, too.
> >
> > Regards,
> >
> > Krystian
> >
> > --
> > Krystian Nowak
> > krystian{at}man{dot}poznan{dot}pl
> > ===========================================
> > Poznan Supercomputing and Networking Center
> > Poland, 60-814 Poznan, Zwierzyniecka 20
> > tel. (+48 61) 8582164 fax. (+48 61) 8582151
> > http://www.man.poznan.pl
> > ===========================================
> > BlueEyes - Human-Operator Monitoring System
> > http://www.blueeyes.prv.pl
> > http://www.cs.put.poznan.pl/csidc/2001
> > ===========================================
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Thanks
>
> Ben
>
> ---------------------------------------------------------------------
> 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: strategy to retrieve the sources of an maven project

Posted by Ben Gidley <bg...@gmail.com>.
I would like to do this to and have started modifying the Eclipse
plugin to get sources from
the dist folder on the repository - unfortunately as far as I can tell
- there is no standard way of getting maven to download the dist
folder

When uploading you can use the goal to create maven:dist to create the
following files. Which I belive are meant to be uploaded to the repo
as follows

/foo/dist/foo-0.1.zip
/foo/dist/foo-0.1-src.zip
/foo/dist/foo-0.1.tar.gz
/foo/dist/foo-0.1-src.tar.gz

The src.zip version works fine when attatched to eclipse.

The zip/tar.gz versions contain classes and javadocs
The src.zip/tar.gz contain just source 

If there was a easy way to fetch these modifying the eclipse plugin to
add them would be simple. But I cannot find an easy way to fetch them
- does anyone have any ideas?

Ben Gidley

On Mon, 25 Oct 2004 17:54:49 +0200, Krystian Nowak
<kr...@man.poznan.pl> wrote:
> Stéphane Nicoll wrote:
> > We have multiple maven projects used by different teams and they request us to send soures as well (so that they can debug problems more deeply).
> > The idea would be to generate a artifact-src.jar as well and deploy it somewhere.
> > Is there a standard way to do this?
> 
> I was thinking about more automated approach:
> 
> When you publish your mavenized project you would be able to select if
> you are publishing it as:
> a) code (*.class) only,
> b) code + javadoc
> c) code + sources
> and then if another project is using yours as dependency
> the descriptor of such a dependency in project.xml would look like this:
> 
>     <dependency>
>        <groupId>foo</groupId>
>        <artifactId>foo-bar</artifactId>
>        <version>1.4.1</version>
>        <properties>
>          <blah.plugin.src>true</blah.plugin.src>
>         <blah.plugin.javadoc>true</blah.plugin.javadoc>
>        </properties>
>      </dependency>
> 
> Having code + sources (c) we can generate javadoc and include in our
> project's javadoc report. If developers are using Eclipse we can define
> e.g. LIB_SRC variable and unpack in LIB_SRC directory all sources from
> dependencies (if available).
> 
> It would require a unified file and/or directory structure on remove
> repository (e.g. ibiblio). Let's say:
> 
> .../foo/jars/foo-bar-1.4.1.jar
> .../foo/jars/foo-bar-1.4.1-src.jar
> .../foo/jars/foo-bar-1.4.1-doc.jar
> 
> Of course automated deployment to create those jars is required, too.
> 
> Regards,
> 
> Krystian
> 
> --
> Krystian Nowak
> krystian{at}man{dot}poznan{dot}pl
> ===========================================
> Poznan Supercomputing and Networking Center
> Poland, 60-814 Poznan, Zwierzyniecka 20
> tel. (+48 61) 8582164 fax. (+48 61) 8582151
> http://www.man.poznan.pl
> ===========================================
> BlueEyes - Human-Operator Monitoring System
> http://www.blueeyes.prv.pl
> http://www.cs.put.poznan.pl/csidc/2001
> ===========================================
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
Thanks

Ben

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


Re: strategy to retrieve the sources of an maven project

Posted by Krystian Nowak <kr...@man.poznan.pl>.
Stéphane Nicoll wrote:
> We have multiple maven projects used by different teams and they request us to send soures as well (so that they can debug problems more deeply).
> The idea would be to generate a artifact-src.jar as well and deploy it somewhere.
> Is there a standard way to do this?

I was thinking about more automated approach:

When you publish your mavenized project you would be able to select if 
you are publishing it as:
a) code (*.class) only,
b) code + javadoc
c) code + sources
and then if another project is using yours as dependency
the descriptor of such a dependency in project.xml would look like this:

    <dependency>
       <groupId>foo</groupId>
       <artifactId>foo-bar</artifactId>
       <version>1.4.1</version>
       <properties>
         <blah.plugin.src>true</blah.plugin.src>
	<blah.plugin.javadoc>true</blah.plugin.javadoc>
       </properties>
     </dependency>

Having code + sources (c) we can generate javadoc and include in our 
project's javadoc report. If developers are using Eclipse we can define 
e.g. LIB_SRC variable and unpack in LIB_SRC directory all sources from 
dependencies (if available).

It would require a unified file and/or directory structure on remove 
repository (e.g. ibiblio). Let's say:

.../foo/jars/foo-bar-1.4.1.jar
.../foo/jars/foo-bar-1.4.1-src.jar
.../foo/jars/foo-bar-1.4.1-doc.jar


Of course automated deployment to create those jars is required, too.


Regards,

Krystian



-- 
Krystian Nowak
krystian{at}man{dot}poznan{dot}pl
===========================================
Poznan Supercomputing and Networking Center
Poland, 60-814 Poznan, Zwierzyniecka 20
tel. (+48 61) 8582164 fax. (+48 61) 8582151
http://www.man.poznan.pl
===========================================
BlueEyes - Human-Operator Monitoring System
http://www.blueeyes.prv.pl
http://www.cs.put.poznan.pl/csidc/2001
===========================================

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