You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "KARR, DAVID" <dk...@att.com> on 2013/08/15 21:42:37 UTC

How to define properties in a parent pom that are referenced in a child pom relative to the parent, not the child?

I'm trying to setup javascript unit tests with phantomjs.  I'm trying to store the phantomjs executable in a parent pom along with a path setting relative to that.  When it's referenced from a child pom, I need the path to be relative to the parent pom, not the child pom.  I have a similar problem with other common resources that are needed for the test infrastructure.  I browsed through the references that describe Maven properties, but I didn't see anything that might help me with this.

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


RE: How to define properties in a parent pom that are referenced in a child pom relative to the parent, not the child?

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: Francesco Mari [mailto:mari.francesco@gmail.com]
> Sent: Thursday, August 15, 2013 1:23 PM
> To: Maven Users List
> Subject: Re: How to define properties in a parent pom that are referenced in
> a child pom relative to the parent, not the child?
> 
> Is the path setting a configuration for a plugin? Is it just a property?
> 
> If I correctly understood the Maven way, you should wrap your
> phantomjs executable in its own project, so to deploy an artifact to
> your repository (or at least to have such an artifact in your reactor
> project). Then you can use the Maven Dependency Plugin to copy the
> phantomjs artifact in the projects which use it.

Unfortunately, running javascript unit tests with Maven isn't yet very convenient.  The javascript testrunner needs to have a physical path for the executable.  It's not really compatible with the "Maven way", much as I'd like it to be that way.

I've settled on the smelly workaround of simply hardcoding a reference to "../src/test/resources/..." for the parent pom.

> 2013/8/15 KARR, DAVID <dk...@att.com>:
> > I'm trying to setup javascript unit tests with phantomjs.  I'm trying to
> store the phantomjs executable in a parent pom along with a path setting
> relative to that.  When it's referenced from a child pom, I need the path to
> be relative to the parent pom, not the child pom.  I have a similar problem
> with other common resources that are needed for the test infrastructure.  I
> browsed through the references that describe Maven properties, but I didn't
> see anything that might help me with this.
> >
> > ---------------------------------------------------------------------
> > 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


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

Re: How to define properties in a parent pom that are referenced in a child pom relative to the parent, not the child?

Posted by Baptiste Mathus <ml...@batmat.net>.
You're right. You shouldn't access things from another module this way.

You could indeed package your dependency as a standard one, or even create
a dedicated plugin) that could use that dependency or even the dirty
decompression work ;)).

Cheers

Le 15 août 2013 22:23, "Francesco Mari" <ma...@gmail.com> a écrit :
>
> Is the path setting a configuration for a plugin? Is it just a property?
>
> If I correctly understood the Maven way, you should wrap your
> phantomjs executable in its own project, so to deploy an artifact to
> your repository (or at least to have such an artifact in your reactor
> project). Then you can use the Maven Dependency Plugin to copy the
> phantomjs artifact in the projects which use it.
>
> 2013/8/15 KARR, DAVID <dk...@att.com>:
> > I'm trying to setup javascript unit tests with phantomjs.  I'm trying
to store the phantomjs executable in a parent pom along with a path setting
relative to that.  When it's referenced from a child pom, I need the path
to be relative to the parent pom, not the child pom.  I have a similar
problem with other common resources that are needed for the test
infrastructure.  I browsed through the references that describe Maven
properties, but I didn't see anything that might help me with this.
> >
> > ---------------------------------------------------------------------
> > 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: How to define properties in a parent pom that are referenced in a child pom relative to the parent, not the child?

Posted by Francesco Mari <ma...@gmail.com>.
Is the path setting a configuration for a plugin? Is it just a property?

If I correctly understood the Maven way, you should wrap your
phantomjs executable in its own project, so to deploy an artifact to
your repository (or at least to have such an artifact in your reactor
project). Then you can use the Maven Dependency Plugin to copy the
phantomjs artifact in the projects which use it.

2013/8/15 KARR, DAVID <dk...@att.com>:
> I'm trying to setup javascript unit tests with phantomjs.  I'm trying to store the phantomjs executable in a parent pom along with a path setting relative to that.  When it's referenced from a child pom, I need the path to be relative to the parent pom, not the child pom.  I have a similar problem with other common resources that are needed for the test infrastructure.  I browsed through the references that describe Maven properties, but I didn't see anything that might help me with this.
>
> ---------------------------------------------------------------------
> 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