You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien Stern <ju...@cryptolog.com> on 2008/02/19 16:17:55 UTC
Maven2 / Archiva / Informations about artifacts
Hi list,
I'm using Maven2 and Archiva.
I'm looking for a way to programatically perform the following
(or at least to be able to call it from a CLI):
1) Obtain the available versions of an artifact in my Archiva
2) Retrieve the latest SNAPSHOT of a given version of an artifact
from the Archiva
I did not find any straightforward way to do this, except fetching
the various maven-metadata.xml from all the repositories defined in
the Archiva, parsing them, and deducing available versions and the
correct paths to fetch the latest SNAPSHOT.
This is not terribly complicated, but I felt like reinventing the wheel.
After all, Maven2 is doing essentially this, at least for #2, all the
time, so I'm sure I can re-use some module, or even maybe that this is
done already.
Can I use a Maven2 plugin ? A Maven2 standalone component ?
Thank you for any hint / javadoc links / code samples / etc
Regards,
--
Julien
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Where to put example code
Posted by Wayne Fay <wa...@gmail.com>.
Set up 2 modules with a shared parent, and inherit versions from the
parent. Make one module "api" and the other "example". Set a
dependency in "example" to "api".
Project structure will look like:
parent\pom.xml
parent\api\pom.xml
parent\example\pom.xml
Wayne
On 2/19/08, Richard Chamberlain <ri...@caplin.com> wrote:
> Hi all,
>
> My project is an API for 3rd parties to use.
> My source and test are in standard locations, however I want to have
> some example usage code that gets compiled to a separate artefact.
>
> I would put them in a separate projects; however the example and the API
> are always the same version.
>
> What I think I'd like
> ---------------------
> A src/example/java
> An additional compile task to compile it to target/example-classes
> An additional jar target to jar up the example code
> An additional deploy to the repo as artefactname-VERSION-example.jar
>
> Surely someone has done this sort of thing before? How is the best way
> to set this out?
>
> Thanks,
>
> Richard
>
> ---------------------------------------------------------------------
> 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
Where to put example code
Posted by Richard Chamberlain <ri...@caplin.com>.
Hi all,
My project is an API for 3rd parties to use.
My source and test are in standard locations, however I want to have
some example usage code that gets compiled to a separate artefact.
I would put them in a separate projects; however the example and the API
are always the same version.
What I think I'd like
---------------------
A src/example/java
An additional compile task to compile it to target/example-classes
An additional jar target to jar up the example code
An additional deploy to the repo as artefactname-VERSION-example.jar
Surely someone has done this sort of thing before? How is the best way
to set this out?
Thanks,
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven2 / Archiva / Informations about artifacts
Posted by Julien Stern <ju...@cryptolog.com>.
On Tue, Feb 19, 2008 at 04:30:36PM +0100, VUB Stefan Seidel wrote:
> For 2), use a simple pom that declares a dependency on the artifact,
> using <version>[0,)</version>, then you can use the
> maven-dependency-plugin to do whatever you want with it.
Thank you for your reply.
Do you know if I can do the same dynamically, without writing a pom ?
In the worst case, I can dynamically generate a pom, write if,
and invoke Maven, but I'm sure I can do something for efficient :)
Regards,
--
Julien
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven2 / Archiva / Informations about artifacts
Posted by VUB Stefan Seidel <ss...@vub.de>.
For 2), use a simple pom that declares a dependency on the artifact,
using <version>[0,)</version>, then you can use the
maven-dependency-plugin to do whatever you want with it.
For 1) I don't know.
regards,
Stefan
Julien Stern wrote:
> Hi list,
>
> I'm using Maven2 and Archiva.
>
> I'm looking for a way to programatically perform the following
> (or at least to be able to call it from a CLI):
>
> 1) Obtain the available versions of an artifact in my Archiva
> 2) Retrieve the latest SNAPSHOT of a given version of an artifact
> from the Archiva
>
> I did not find any straightforward way to do this, except fetching
> the various maven-metadata.xml from all the repositories defined in
> the Archiva, parsing them, and deducing available versions and the
> correct paths to fetch the latest SNAPSHOT.
>
> This is not terribly complicated, but I felt like reinventing the wheel.
> After all, Maven2 is doing essentially this, at least for #2, all the
> time, so I'm sure I can re-use some module, or even maybe that this is
> done already.
>
> Can I use a Maven2 plugin ? A Maven2 standalone component ?
>
> Thank you for any hint / javadoc links / code samples / etc
>
> Regards,
>
> --
> Julien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
best regards,
Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel. +49 (341) 9 60 50 07
fax. +49 (341) 9 60 50 92
mail. sseidel@vub.de
web. www.vub.de
HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org