You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Hugi Thordarson <hu...@karlmenn.is> on 2011/07/31 16:28:05 UTC

Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Hi all!

I just upgraded to Maven 3. Now, when I run "mvn clean" on a multi-module project it will delete each module entirely, rather than just the target directories contained within each module directory (which is how it used to work in Maven 2).

Anyone have any idea what I might be doing wrong here?

Cheers,
- hugi

// Hugi Thordarson
// http://hugi.karlmenn.is/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Benson Margulies <bi...@gmail.com>.
" a digital Ouroboros of disaster" -- that made my day.

On Sun, Jul 31, 2011 at 11:03 AM, Jesse Farinacci <ji...@gmail.com> wrote:
> Greetings,
>
> On Sun, Jul 31, 2011 at 10:53 AM, Hugi Thordarson <hu...@karlmenn.is> wrote:
>> You inspired me to do quick search for "outputDirectory" in all the POMs and I found this little bugger in all the projects' common parent pom:
>>
>> <reporting>
>>        <outputDirectory />
>> </reporting>
>>
>> Not sure what purpose it served - but once removed, the projects behave as expected in Maven 3 :).
>
> Glad you figured it out. Having an empty outputDirectory must make it
> default to the modules working directory. Then your clean would
> convert the build into a digital Ouroboros of disaster.
>
> Maybe Maven 3, in its aim to better inform users about code smells,
> should warn users of this perilous condition.
>
> -Jesse
>
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
> ---------------------------------------------------------------------
> 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: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Mark Derricutt <ma...@talios.com>.
IMHO allowing the configuration <outputDirectory/> just seems silly in itself and should probably throw a MojoException or something.  If you REALLLY wanted that directory then you could use $baseDir or something.

On 1/08/2011, at 3:16 AM, Hugi Thordarson wrote:

> Yes, that would be clever. Although Maven 3 is really just doing the right thing with a somewhat silly configuration :-).


Re: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Jesse Farinacci <ji...@gmail.com>.
http://jira.codehaus.org/browse/MNG-5144

On Sun, Jul 31, 2011 at 2:42 PM, Anders Hammar <an...@hammar.net> wrote:
> If you file a jira ticket ([1]) suggesting this it could actually get
> implemented instead of just being a clever idea...
> [1] http://jira.codehaus.org/browse/MNG

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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


Re: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Anders Hammar <an...@hammar.net>.
I was rather thinking of the warning that Maven could print to the console
output about this kind of bad/strange pom declaration.
(Although the reporting section isn't really touched by Maven 3 core I think
but just the site plugin.)

/Anders

On Sun, Jul 31, 2011 at 20:50, Hugi Thordarson <hu...@karlmenn.is> wrote:

> What!? You mean the developers don't pick up messages telepathically? :o)
>
> But really, I'm not sure if it's really that clever. It's a little like
> filing a ticket saying "rm -rf ~ deletes my home directory".
>
> - hugi
>
>
> On 31.7.2011, at 18:42, Anders Hammar wrote:
>
> > If you file a jira ticket ([1]) suggesting this it could actually get
> > implemented instead of just being a clever idea...
> >
> > /Anders
> >
> > [1] http://jira.codehaus.org/browse/MNG
> >
> > On Sun, Jul 31, 2011 at 17:16, Hugi Thordarson <hu...@karlmenn.is> wrote:
> >
> >> Hi again,
> >>
> >>>> You inspired me to do quick search for "outputDirectory" in all the
> POMs
> >> and I found this little bugger in all the projects' common parent pom:
> >>>>
> >>>> <reporting>
> >>>>       <outputDirectory />
> >>>> </reporting>
> >>>>
> >>>> Not sure what purpose it served - but once removed, the projects
> behave
> >> as expected in Maven 3 :).
> >>>
> >>> Glad you figured it out. Having an empty outputDirectory must make it
> >>> default to the modules working directory. Then your clean would
> >>> convert the build into a digital Ouroboros of disaster.
> >>
> >> Yes, that's what I figured (and confirmed by building some javadocs).
> >>
> >>
> >>> Maybe Maven 3, in its aim to better inform users about code smells,
> >>> should warn users of this perilous condition.
> >>
> >> Yes, that would be clever. Although Maven 3 is really just doing the
> right
> >> thing with a somewhat silly configuration :-).
> >>
> >> Thanks again,
> >> - hugi
> >> ---------------------------------------------------------------------
> >> 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: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Hugi Thordarson <hu...@karlmenn.is>.
What!? You mean the developers don't pick up messages telepathically? :o)

But really, I'm not sure if it's really that clever. It's a little like filing a ticket saying "rm -rf ~ deletes my home directory".

- hugi


On 31.7.2011, at 18:42, Anders Hammar wrote:

> If you file a jira ticket ([1]) suggesting this it could actually get
> implemented instead of just being a clever idea...
> 
> /Anders
> 
> [1] http://jira.codehaus.org/browse/MNG
> 
> On Sun, Jul 31, 2011 at 17:16, Hugi Thordarson <hu...@karlmenn.is> wrote:
> 
>> Hi again,
>> 
>>>> You inspired me to do quick search for "outputDirectory" in all the POMs
>> and I found this little bugger in all the projects' common parent pom:
>>>> 
>>>> <reporting>
>>>>       <outputDirectory />
>>>> </reporting>
>>>> 
>>>> Not sure what purpose it served - but once removed, the projects behave
>> as expected in Maven 3 :).
>>> 
>>> Glad you figured it out. Having an empty outputDirectory must make it
>>> default to the modules working directory. Then your clean would
>>> convert the build into a digital Ouroboros of disaster.
>> 
>> Yes, that's what I figured (and confirmed by building some javadocs).
>> 
>> 
>>> Maybe Maven 3, in its aim to better inform users about code smells,
>>> should warn users of this perilous condition.
>> 
>> Yes, that would be clever. Although Maven 3 is really just doing the right
>> thing with a somewhat silly configuration :-).
>> 
>> Thanks again,
>> - hugi
>> ---------------------------------------------------------------------
>> 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: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Anders Hammar <an...@hammar.net>.
If you file a jira ticket ([1]) suggesting this it could actually get
implemented instead of just being a clever idea...

/Anders

[1] http://jira.codehaus.org/browse/MNG

On Sun, Jul 31, 2011 at 17:16, Hugi Thordarson <hu...@karlmenn.is> wrote:

> Hi again,
>
> >> You inspired me to do quick search for "outputDirectory" in all the POMs
> and I found this little bugger in all the projects' common parent pom:
> >>
> >> <reporting>
> >>        <outputDirectory />
> >> </reporting>
> >>
> >> Not sure what purpose it served - but once removed, the projects behave
> as expected in Maven 3 :).
> >
> > Glad you figured it out. Having an empty outputDirectory must make it
> > default to the modules working directory. Then your clean would
> > convert the build into a digital Ouroboros of disaster.
>
> Yes, that's what I figured (and confirmed by building some javadocs).
>
>
> > Maybe Maven 3, in its aim to better inform users about code smells,
> > should warn users of this perilous condition.
>
> Yes, that would be clever. Although Maven 3 is really just doing the right
> thing with a somewhat silly configuration :-).
>
> Thanks again,
> - hugi
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Hugi Thordarson <hu...@karlmenn.is>.
Hi again,

>> You inspired me to do quick search for "outputDirectory" in all the POMs and I found this little bugger in all the projects' common parent pom:
>> 
>> <reporting>
>>        <outputDirectory />
>> </reporting>
>> 
>> Not sure what purpose it served - but once removed, the projects behave as expected in Maven 3 :).
> 
> Glad you figured it out. Having an empty outputDirectory must make it
> default to the modules working directory. Then your clean would
> convert the build into a digital Ouroboros of disaster.

Yes, that's what I figured (and confirmed by building some javadocs).


> Maybe Maven 3, in its aim to better inform users about code smells,
> should warn users of this perilous condition.

Yes, that would be clever. Although Maven 3 is really just doing the right thing with a somewhat silly configuration :-).

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


Re: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Jesse Farinacci <ji...@gmail.com>.
Greetings,

On Sun, Jul 31, 2011 at 10:53 AM, Hugi Thordarson <hu...@karlmenn.is> wrote:
> You inspired me to do quick search for "outputDirectory" in all the POMs and I found this little bugger in all the projects' common parent pom:
>
> <reporting>
>        <outputDirectory />
> </reporting>
>
> Not sure what purpose it served - but once removed, the projects behave as expected in Maven 3 :).

Glad you figured it out. Having an empty outputDirectory must make it
default to the modules working directory. Then your clean would
convert the build into a digital Ouroboros of disaster.

Maybe Maven 3, in its aim to better inform users about code smells,
should warn users of this perilous condition.

-Jesse


-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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


Re: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Hugi Thordarson <hu...@karlmenn.is>.
Hi Jessie,

You inspired me to do quick search for "outputDirectory" in all the POMs and I found this little bugger in all the projects' common parent pom:

<reporting>
	<outputDirectory />
	[ … ]
</reporting>

Not sure what purpose it served - but once removed, the projects behave as expected in Maven 3 :).

Thanks for the help!
- hugi

// Hugi Thordarson
// http://hugi.karlmenn.is/


On 31.7.2011, at 14:38, Jesse Farinacci wrote:

> Greetings,
> 
> On Sun, Jul 31, 2011 at 10:28 AM, Hugi Thordarson <hu...@karlmenn.is> wrote:
>> I just upgraded to Maven 3. Now, when I run "mvn clean" on a multi-module project it will delete each module entirely, rather than just the target directories contained within each module directory (which is how it used to work in Maven 2).
>> Anyone have any idea what I might be doing wrong here?
> 
> Maven output or it didn't happen. I simply do not believe this is what
> is happening unless you've somehow attached to clean phase an antrun
> execution to delete all your modules.. or you've put them under
> build.outputDirectory.
> 
> -Jesse
> 
> -- 
> There are 10 types of people in this world, those
> that can read binary and those that can not.
> 
> ---------------------------------------------------------------------
> 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: Upgraded to Maven 3 - now the "clean" goal deletes entire module directories?

Posted by Jesse Farinacci <ji...@gmail.com>.
Greetings,

On Sun, Jul 31, 2011 at 10:28 AM, Hugi Thordarson <hu...@karlmenn.is> wrote:
> I just upgraded to Maven 3. Now, when I run "mvn clean" on a multi-module project it will delete each module entirely, rather than just the target directories contained within each module directory (which is how it used to work in Maven 2).
> Anyone have any idea what I might be doing wrong here?

Maven output or it didn't happen. I simply do not believe this is what
is happening unless you've somehow attached to clean phase an antrun
execution to delete all your modules.. or you've put them under
build.outputDirectory.

-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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