You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by phlow <fl...@austria.fm> on 2006/09/22 13:51:08 UTC

externalized assembly descriptors and relative paths

Hi all!

We have the habit of putting some stuff common to all our maven projects
into a folder that we place at the same level as our maven projects,  i.e.

[WORKSPACE]/project1
[WORKSPACE]/project2
[WORKSPACE]/common

The 'common' folder is actually not a maven project.

For generating special assemblies there are assembly descriptors which we
put in 'common/config/assembly/assemblyXYZ.xml'
Projects that build these assemblies reference these assemblies in their
poms like so:

  <descriptor>
     ../common/config/assembly/assemblyXYZ.xml
  </descriptor>

The assembly descriptors themselves reference content in the
'[WORKSPACE]/common/' directory (shell scripts etc.): 

   <fileSet>
      <directory>../common/scripts/unix/</directory>
      <outputDirectory>/scripts/</outputDirectory>
      <lineEnding>unix</lineEnding>
      <fileMode>0755</fileMode>
    </fileSet>

This works fine for simple projects. The problem is that with projects that
have modules in subfolders, this does not work, obviously. We can reference
the assembly descriptors with '../../common/' from there, but inside the
assembly descriptor, the '../common' is hardcoded, and therefore, the
resources are not found by the assembly plugin.

Is there a simple way to circumvent this problem? I tried defining a
property for  '..' or '../..' respectively, but I had to find out that
properties don't work in assemblies yet. 

Any ideas? Has anyone had a similar setup but a better solution?  

greets, 

Flo
-- 
View this message in context: http://www.nabble.com/externalized-assembly-descriptors-and-relative-paths-tf2317329.html#a6445575
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: externalized assembly descriptors and relative paths

Posted by phlow <fl...@austria.fm>.


franz see wrote:
> 
> 
> First, I suggest you try to rethink whether they should be modules of a
> parent project or not. If they are, restructure them. 
> 
> But if they're really not related to each other and it just so happens
> that they have a common descriptor, on top of my head, I'd say try using
> ${user.dir}/../common. AFAIK, ${user.dir} returns the path of the top most
> user-defined parent maven project. Thus, even if your submodules use it,
> you would still start from the parent project.
> 
> Goodluck,
> Franz
> 

Unfortunately, ${user.dir} inside the module's pom.xml seems to hold the
location of the module, not the project containing the module - so that
didn't work...

greets
Flo






-- 
View this message in context: http://www.nabble.com/externalized-assembly-descriptors-and-relative-paths-tf2317329.html#a6449085
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: externalized assembly descriptors and relative paths

Posted by franz see <fr...@gmail.com>.


phlow wrote:
> 
> Hi all!
> 
> We have the habit of putting some stuff common to all our maven projects
> into a folder that we place at the same level as our maven projects,  i.e.
> 
> [WORKSPACE]/project1
> [WORKSPACE]/project2
> [WORKSPACE]/common
> 
> The 'common' folder is actually not a maven project.
> 
> For generating special assemblies there are assembly descriptors which we
> put in 'common/config/assembly/assemblyXYZ.xml'
> Projects that build these assemblies reference these assemblies in their
> poms like so:
> 
>   <descriptor>
>      ../common/config/assembly/assemblyXYZ.xml
>   </descriptor>
> 
> The assembly descriptors themselves reference content in the
> '[WORKSPACE]/common/' directory (shell scripts etc.): 
> 
>    <fileSet>
>       <directory>../common/scripts/unix/</directory>
>       <outputDirectory>/scripts/</outputDirectory>
>       <lineEnding>unix</lineEnding>
>       <fileMode>0755</fileMode>
>     </fileSet>
> 
> This works fine for simple projects. The problem is that with projects
> that have modules in subfolders, this does not work, obviously. We can
> reference the assembly descriptors with '../../common/' from there, but
> inside the assembly descriptor, the '../common' is hardcoded, and
> therefore, the resources are not found by the assembly plugin.
> 
> Is there a simple way to circumvent this problem? I tried defining a
> property for  '..' or '../..' respectively, but I had to find out that
> properties don't work in assemblies yet. 
> 
> Any ideas? Has anyone had a similar setup but a better solution?  
> 
> greets, 
> 
> Flo
> 

Good day to you, phlow,

First, I suggest you try to rethink whether they should be modules of a
parent project or not. If they are, restructure them. 

But if they're really not related to each other and it just so happens that
they have a common descriptor, on top of my head, I'd say try using
${user.dir}/../common. AFAIK, ${user.dir} returns the path of the top most
user-defined parent maven project. Thus, even if your submodules use it, you
would still start from the parent project.

Goodluck,
Franz
-- 
View this message in context: http://www.nabble.com/externalized-assembly-descriptors-and-relative-paths-tf2317329.html#a6446069
Sent from the Maven - Users mailing list archive at Nabble.com.


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