You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daniel Frey <da...@xmatrix.ch> on 2004/06/09 17:43:03 UTC

Best practice: examples, java sources and tests

Hello

I'd like to have in my project structure apart from src/java and src/test
something like src/example. The build artifacts should be accordingly.
However, I don't see a standard way to do that. 

I would like to know how you folks master this situation. How do you manages
examples in your projects? Do you recomend using different projects and do
it with a multiproject goal? Are there other ways?

Thanks
Daniel Frey

RE: Best practice: examples, java sources and tests

Posted by Eric Pugh <ep...@upstate.com>.
To echo Jason's comment, Maven is based around the idea that there is one
artifact per project.   So, if you examples are contained in one jar or
whatever, then put them in an /examples project.  But, if you have multiple
seperate examples (say step1, step2, step3...) where the examples build on
each other, so you want them in the same package namespace etc, then break
them up into multiple projects.  With tools like the multiproject plugin,
maintaining and building lots of projects isn't too bad.

Eric

> -----Original Message-----
> From: Jason van Zyl [mailto:jvanzyl@maven.org]
> Sent: Wednesday, June 09, 2004 7:27 PM
> To: Maven Users List
> Subject: Re: Best practice: examples, java sources and tests
>
>
> On Wed, 2004-06-09 at 13:20, matthew.hawthorne wrote:
> > Daniel Frey wrote:
> > > I would like to know how you folks master this situation. How
> do you manages
> > > examples in your projects? Do you recomend using different
> projects and do
> > > it with a multiproject goal? Are there other ways?
> >
> > I would do what you mentioned, put the examples in another subproject
> > which depends
> > on the main project.
> >
> > Otherwise, it seems you'd have to manually compile the examples in
> > maven.xml.
>
> I would definitely make separate project for your example code, and
> ultimately you might want to have several projects for different
> examples.
>
> --
> jvz.
>
> Jason van Zyl
> jason@maven.org
> http://maven.apache.org
>
> happiness is like a butterfly: the more you chase it, the more it will
> elude you, but if you turn your attention to other things, it will come
> and sit softly on your shoulder ...
>
>  -- Thoreau
>
>
> ---------------------------------------------------------------------
> 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: Best practice: examples, java sources and tests

Posted by Jason van Zyl <jv...@maven.org>.
On Wed, 2004-06-09 at 13:20, matthew.hawthorne wrote:
> Daniel Frey wrote:
> > I would like to know how you folks master this situation. How do you manages
> > examples in your projects? Do you recomend using different projects and do
> > it with a multiproject goal? Are there other ways?
> 
> I would do what you mentioned, put the examples in another subproject 
> which depends
> on the main project.
> 
> Otherwise, it seems you'd have to manually compile the examples in 
> maven.xml.

I would definitely make separate project for your example code, and
ultimately you might want to have several projects for different
examples. 

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


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


Re: Best practice: examples, java sources and tests

Posted by "matthew.hawthorne" <ma...@apache.org>.
Daniel Frey wrote:
> I would like to know how you folks master this situation. How do you manages
> examples in your projects? Do you recomend using different projects and do
> it with a multiproject goal? Are there other ways?

I would do what you mentioned, put the examples in another subproject 
which depends
on the main project.

Otherwise, it seems you'd have to manually compile the examples in 
maven.xml.

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