You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thai Dang Vu <dx...@yahoo.com> on 2014/05/30 05:28:58 UTC

How to move the of a multi-module project?

Hi All,

I have a multi-module project in the /home/me/projects/grandfather like this:

grandfather
     |
     |---- pom.xml
     |
     |---- father
              |
              |---- pom.xml
              |
              |---- son
                     |
                     |---- pom.xml

If I build that project, I will have these target directories: /home/me/projects/grandfather/target, /home/me/projects/grandfather/father/target and /home/me/projects/grandfather/father/son/target. 


Is there anyway to modify only 1 pom.xml (it doesn't matter if it is grandfather's or father's or son's) so that the target directories are /tmp/grandfather/target, /tmp/grandfather/father/target and /tmp/grandfather/father/son/target?

Regards.

Re: How to move the of a multi-module project?

Posted by John Patrick <nh...@gmail.com>.
You can't do exactly what you are aiming to do dynamically but you could
hard code that structure into your pom's.

Look into the property;

project.build.directory

If you defined that in the respective pom's as below;

project.build.directory=/tmp/grandfarther/target
project.build.directory=/tmp/grandfarther/farther/target
project.build.directory=/tmp/grandfarther/farther/son/target

in the respective pom's you could create the structure your after.

Because grandfarther, farther, son are arbitrary directory names and maven
doesn't care what it's currently directory name is and only modules
configuration only needs to point to a directory with a pom in.

Another question is why do you want/need this structure as i often find the
answer to that the real root cause.

John





On 30 May 2014 04:28, Thai Dang Vu <dx...@yahoo.com> wrote:

> Hi All,
>
> I have a multi-module project in the /home/me/projects/grandfather like
> this:
>
> grandfather
>      |
>      |---- pom.xml
>      |
>      |---- father
>               |
>               |---- pom.xml
>               |
>               |---- son
>                      |
>                      |---- pom.xml
>
> If I build that project, I will have these target directories:
> /home/me/projects/grandfather/target,
> /home/me/projects/grandfather/father/target and
> /home/me/projects/grandfather/father/son/target.
>
>
> Is there anyway to modify only 1 pom.xml (it doesn't matter if it is
> grandfather's or father's or son's) so that the target directories are
> /tmp/grandfather/target, /tmp/grandfather/father/target and
> /tmp/grandfather/father/son/target?
>
> Regards.

Re: How to move the of a multi-module project?

Posted by John Patrick <nh...@gmail.com>.
So I'm guessing you then have mapped tmp to a ram drive, otherwise tmp will
still be on your SSD unless you also have a non-SSD too which is mapped to
tmp.

Honestly as long as it's a new ish SSD, your not writing GB and GB per hour
constantly 24/7, your SSD is under about 60% full then I would not worry
that much.

They are designed to wear the drive evenly which is an issue if you want to
get ride of the SSD as dban won't correctly scrub the disk as the disk lies
about which sector is being written too.

My development laptop is 12 months old with a 512GB SSD, about 50% full and
I'm doing several builds an hour, with one full clean install per hour and
I'm expecting it to last lots more years before it dies.

John



On 30 May 2014 10:48, Thai Dang Vu <dx...@yahoo.com> wrote:

>
> Thanks, John, for answering my question. There's no special reason, I have
> the project on a SSD drive and don't want to write to that so often.
>
>
>
> On Friday, May 30, 2014 5:28 AM, Karl Heinz Marbaise <kh...@gmx.de>
> wrote:
>
>
>
> Hi,
>
>
> >
> > grandfather
> >       |
> >       |---- pom.xml
> >       |
> >       |---- father
> >                |
> >                |---- pom.xml
> >                |
> >                |---- son
> >                       |
> >                       |---- pom.xml
> >
> > If I build that project, I will have these target directories:
> /home/me/projects/grandfather/target,
> /home/me/projects/grandfather/father/target and
> /home/me/projects/grandfather/father/son/target.
> >
> >
> > Is there anyway to modify only 1 pom.xml (it doesn't matter if it is
> grandfather's or father's or son's) so that the target directories are
> /tmp/grandfather/target, /tmp/grandfather/father/target and
> /tmp/grandfather/father/son/target?
>
> So my question to this is: Why do want to do this? What's the reason to
> use a folder outside the modules ? Can you explain your use case and why
> you need it such that way and can't stuck with the conventions
> project/target ?
>
> Kind regards
> Karl-Heinz Marbaise
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Re: How to move the of a multi-module project?

Posted by Thai Dang Vu <dx...@yahoo.com>.
Thanks, John, for answering my question. There's no special reason, I have the project on a SSD drive and don't want to write to that so often.



On Friday, May 30, 2014 5:28 AM, Karl Heinz Marbaise <kh...@gmx.de> wrote:
 


Hi,


>
> grandfather
>       |
>       |---- pom.xml
>       |
>       |---- father
>                |
>                |---- pom.xml
>                |
>                |---- son
>                       |
>                       |---- pom.xml
>
> If I build that project, I will have these target directories: /home/me/projects/grandfather/target, /home/me/projects/grandfather/father/target and /home/me/projects/grandfather/father/son/target.
>
>
> Is there anyway to modify only 1 pom.xml (it doesn't matter if it is grandfather's or father's or son's) so that the target directories are /tmp/grandfather/target, /tmp/grandfather/father/target and /tmp/grandfather/father/son/target?

So my question to this is: Why do want to do this? What's the reason to 
use a folder outside the modules ? Can you explain your use case and why 
you need it such that way and can't stuck with the conventions 
project/target ?

Kind regards
Karl-Heinz Marbaise


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

Re: How to move the of a multi-module project?

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,


 >
> grandfather
>       |
>       |---- pom.xml
>       |
>       |---- father
>                |
>                |---- pom.xml
>                |
>                |---- son
>                       |
>                       |---- pom.xml
>
> If I build that project, I will have these target directories: /home/me/projects/grandfather/target, /home/me/projects/grandfather/father/target and /home/me/projects/grandfather/father/son/target.
>
>
> Is there anyway to modify only 1 pom.xml (it doesn't matter if it is grandfather's or father's or son's) so that the target directories are /tmp/grandfather/target, /tmp/grandfather/father/target and /tmp/grandfather/father/son/target?

So my question to this is: Why do want to do this? What's the reason to 
use a folder outside the modules ? Can you explain your use case and why 
you need it such that way and can't stuck with the conventions 
project/target ?

Kind regards
Karl-Heinz Marbaise


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