You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Richard Chamberlain <ri...@caplin.com> on 2008/02/19 17:12:28 UTC

Where to put example code

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: 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