You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Damian Krzeminski <da...@pingtel.com> on 2006/02/09 16:36:55 UTC

[m2] path relative to parent/reactor pom.xml

What's the recommended way of specifying paths that are always relative to parent pom (regardless if 
I am building from parent directory or from any of the subprojects directories)?

All my subprojects are sharing the same checkstyle.xml file. I am trying to configure my checkstyle 
plugin in parent pom:

     <pluginManagement>
       <plugins>
         <plugin>
           <artifactId>maven-checkstyle-plugin</artifactId>
           <configuration>
             <configLocation>meta/checkstyle.xml</configLocation>
             ...


but configLocation is always relative to current directory (user.dir)

Is the any way I can configure it without using environment variables or absolute paths?
Damian


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


Re: [m2] path relative to parent/reactor pom.xml

Posted by Damian Krzeminski <da...@pingtel.com>.
Lee Meador wrote:
> I have all my projects as siblings in the file system. My checkstyle xml
> file is in the same folder as all those folders which means that its path in
> all the POMs (which they inheirit from the parent) is ../chk.xml.
> 
> That same folder is the root of the project in svn.
> 
> That seems to work.

I tried this, but it only worked when I was starting build from one of 
the subproject repositories, but not when I was doing that from parent 
directory.

For now I ended up defining environment variable that specifies my 
parent pom location and referencing it as maven property.

> 
> On 2/9/06, Wendy Smoak <ws...@gmail.com> wrote:
>> On 2/9/06, Damian Krzeminski <da...@pingtel.com> wrote:
>>
>>> What's the recommended way of specifying paths that are always relative
>> to parent pom (regardless if
>>> I am building from parent directory or from any of the subprojects
>> directories)?
>>> All my subprojects are sharing the same checkstyle.xml file. I am trying
>> to configure my checkstyle
>>> plugin in parent pom:
>> We use svn:externals for this, to include a directory with common
>> build information "under" each sub-project.  With the additional
>> 'current' external that pulls in the trunk of each sub-project, it
>> looks like this:
>>
>> struts/current/action
>> struts/current/action/build
>> struts/current/build
>> struts/current/taglib
>> struts/current/taglib/build
>>
>> All three of those 'build' directories are really /struts/build/trunk/
>> in the svn repo.
>>
>> That won't really help if you're not using Subversion. :)  But I'm
>> also interested to know if there's a way to do this with just Maven.
>> It would seem like that file becomes a dependency... maybe it somehow
>> needs to be in the Maven repository.

Thanks. We do use subversion but I am not a big fan of svn:externals - 
mostly because of problems when branching.

I really like your suggestion of making this somehow into a project 
repository. If someone ever figures out how to do that please share it 
on the list.

>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> --
> -- Lee Meador
> Sent from gmail. My real email address is lee@leemeador.com
> 


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


Re: [m2] path relative to parent/reactor pom.xml

Posted by Lee Meador <le...@leemeador.com>.
I have all my projects as siblings in the file system. My checkstyle xml
file is in the same folder as all those folders which means that its path in
all the POMs (which they inheirit from the parent) is ../chk.xml.

That same folder is the root of the project in svn.

That seems to work.

On 2/9/06, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 2/9/06, Damian Krzeminski <da...@pingtel.com> wrote:
>
> > What's the recommended way of specifying paths that are always relative
> to parent pom (regardless if
> > I am building from parent directory or from any of the subprojects
> directories)?
> >
> > All my subprojects are sharing the same checkstyle.xml file. I am trying
> to configure my checkstyle
> > plugin in parent pom:
>
> We use svn:externals for this, to include a directory with common
> build information "under" each sub-project.  With the additional
> 'current' external that pulls in the trunk of each sub-project, it
> looks like this:
>
> struts/current/action
> struts/current/action/build
> struts/current/build
> struts/current/taglib
> struts/current/taglib/build
>
> All three of those 'build' directories are really /struts/build/trunk/
> in the svn repo.
>
> That won't really help if you're not using Subversion. :)  But I'm
> also interested to know if there's a way to do this with just Maven.
> It would seem like that file becomes a dependency... maybe it somehow
> needs to be in the Maven repository.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
-- Lee Meador
Sent from gmail. My real email address is lee@leemeador.com

Re: [m2] path relative to parent/reactor pom.xml

Posted by Wendy Smoak <ws...@gmail.com>.
On 2/9/06, Damian Krzeminski <da...@pingtel.com> wrote:

> What's the recommended way of specifying paths that are always relative to parent pom (regardless if
> I am building from parent directory or from any of the subprojects directories)?
>
> All my subprojects are sharing the same checkstyle.xml file. I am trying to configure my checkstyle
> plugin in parent pom:

We use svn:externals for this, to include a directory with common
build information "under" each sub-project.  With the additional
'current' external that pulls in the trunk of each sub-project, it
looks like this:

struts/current/action
struts/current/action/build
struts/current/build
struts/current/taglib
struts/current/taglib/build

All three of those 'build' directories are really /struts/build/trunk/
in the svn repo.

That won't really help if you're not using Subversion. :)  But I'm
also interested to know if there's a way to do this with just Maven. 
It would seem like that file becomes a dependency... maybe it somehow
needs to be in the Maven repository.

--
Wendy

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


Re: [m2] path relative to parent/reactor pom.xml

Posted by Daniel Kulp <da...@iona.com>.

On Thursday 09 February 2006 10:36, Damian Krzeminski wrote:
> What's the recommended way of specifying paths that are always relative
> to parent pom (regardless if I am building from parent directory or
> from any of the subprojects directories)?


The only way we got this to work is to use properties to define the 
location of the parent pom.

The parent pom has something like:
    <properties>
        <topDirectoryLocation>.</topDirectoryLocation>
    <properties>

All the children poms have:
    <properties>
        <topDirectoryLocation>..</topDirectoryLocation>
    </properties>

The path then becomes:
<configLocation>${basedir}/${topDirectoryLocation}/checkstyle.xml</configLocation>


Not "elegant", but it seems to work OK.  

I DON'T think it will work with continuum.   If you don't use continuum 
(we ditched it for Cruisecontrol), you should be OK.

Enjoy!
-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727  C: 508-380-7194
daniel.kulp@iona.com

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