You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Jubenville, Russ" <Ru...@solcorp.com> on 2005/03/29 01:02:44 UTC

Depend on this project's classes during its build vs. its artifact during other builds??

We have a project, "ProjectA", that contains some JUnit tests, where
those tests require our database to be initialized with data.  We have a
goal called initdb that loads that data, but it needs to use our java
classes within ProjectA to accomplish its task.

The problem occurs when we need to run the initdb goal both within
Project A's normal compile-test-build cycle, as well as on its own,
perhaps as a pregoal to another goal in ProjectB.

So the classpath for initdb in ProjectA needs to include ProjectA's
${maven.build.dest}, in order to ensure that ProjectA's data load is
using the current versions of the classes comprising ProjectA.  However,
when running the initdb goal from ProjectB, we need it to pick up
ProjectA's jar file artifact instead.

initdb is a goal in our parent project (which is parent to both ProjectA
and ProjectB).  We're struggling with trying to determine how to
dynamically set the classpath to include the ${maven.build.dest} if
we're in the middle of a ProjectA build (including reactor builds, etc.)
but to use ProjectA's artifact in the classpath when running initdb from
ProjectB.

Any help will be greatly appreciated.

> Russ Jubenville, Senior Technical Consultant
Consulting Services, EDS Canada
177 Lake Shore Blvd. E.  *  Toronto, ON  M5A 1B7
> (416) 673-6210 ext. 5338
> russ.jubenville@solcorp.com
russ.jubenville@eds.com


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by NetIQ MailMarshal
#####################################################################################

Re: Depend on this project's classes during its build vs. its artifact during other builds??

Posted by Ha ryon <ha...@gmail.com>.
else you could have initdb depend on a property, that you would set in
projectA to ${maven.build.dest} and in projectB project.properties you
would change it to something else. would it work ? If initbd is called
from projectB probably.


On Mon, 28 Mar 2005 15:20:50 -0800, dan tran <da...@gmail.com> wrote:
> http://maven.apache.org/using/bestpractices.html#Refactor_Your_Build
> 
> -D
> 
> On Mon, 28 Mar 2005 18:02:44 -0500, Jubenville, Russ
> <Ru...@solcorp.com> wrote:
> > We have a project, "ProjectA", that contains some JUnit tests, where
> > those tests require our database to be initialized with data.  We have a
> > goal called initdb that loads that data, but it needs to use our java
> > classes within ProjectA to accomplish its task.
> >
> > The problem occurs when we need to run the initdb goal both within
> > Project A's normal compile-test-build cycle, as well as on its own,
> > perhaps as a pregoal to another goal in ProjectB.
> >
> > So the classpath for initdb in ProjectA needs to include ProjectA's
> > ${maven.build.dest}, in order to ensure that ProjectA's data load is
> > using the current versions of the classes comprising ProjectA.  However,
> > when running the initdb goal from ProjectB, we need it to pick up
> > ProjectA's jar file artifact instead.
> >
> > initdb is a goal in our parent project (which is parent to both ProjectA
> > and ProjectB).  We're struggling with trying to determine how to
> > dynamically set the classpath to include the ${maven.build.dest} if
> > we're in the middle of a ProjectA build (including reactor builds, etc.)
> > but to use ProjectA's artifact in the classpath when running initdb from
> > ProjectB.
> >
> > Any help will be greatly appreciated.
> >
> > > Russ Jubenville, Senior Technical Consultant
> > Consulting Services, EDS Canada
> > 177 Lake Shore Blvd. E.  *  Toronto, ON  M5A 1B7
> > > (416) 673-6210 ext. 5338
> > > russ.jubenville@solcorp.com
> > russ.jubenville@eds.com
> >
> > #####################################################################################
> > This e-mail message has been scanned for Viruses and Content and cleared
> > by NetIQ MailMarshal
> > #####################################################################################
> >
> >
> 
> ---------------------------------------------------------------------
> 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: Depend on this project's classes during its build vs. its artifact during other builds??

Posted by dan tran <da...@gmail.com>.
http://maven.apache.org/using/bestpractices.html#Refactor_Your_Build

-D


On Mon, 28 Mar 2005 18:02:44 -0500, Jubenville, Russ
<Ru...@solcorp.com> wrote:
> We have a project, "ProjectA", that contains some JUnit tests, where
> those tests require our database to be initialized with data.  We have a
> goal called initdb that loads that data, but it needs to use our java
> classes within ProjectA to accomplish its task.
> 
> The problem occurs when we need to run the initdb goal both within
> Project A's normal compile-test-build cycle, as well as on its own,
> perhaps as a pregoal to another goal in ProjectB.
> 
> So the classpath for initdb in ProjectA needs to include ProjectA's
> ${maven.build.dest}, in order to ensure that ProjectA's data load is
> using the current versions of the classes comprising ProjectA.  However,
> when running the initdb goal from ProjectB, we need it to pick up
> ProjectA's jar file artifact instead.
> 
> initdb is a goal in our parent project (which is parent to both ProjectA
> and ProjectB).  We're struggling with trying to determine how to
> dynamically set the classpath to include the ${maven.build.dest} if
> we're in the middle of a ProjectA build (including reactor builds, etc.)
> but to use ProjectA's artifact in the classpath when running initdb from
> ProjectB.
> 
> Any help will be greatly appreciated.
> 
> > Russ Jubenville, Senior Technical Consultant
> Consulting Services, EDS Canada
> 177 Lake Shore Blvd. E.  *  Toronto, ON  M5A 1B7
> > (416) 673-6210 ext. 5338
> > russ.jubenville@solcorp.com
> russ.jubenville@eds.com
> 
> #####################################################################################
> This e-mail message has been scanned for Viruses and Content and cleared
> by NetIQ MailMarshal
> #####################################################################################
> 
>

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