You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris <sh...@yahoo.com> on 2009/08/04 19:45:56 UTC

How to delete a directory?

I'm using maven-dependency-plugin to make a custom directory of 
dependencies. The trouble is that I can't find a way to delete the 
outputDirectory before the plugin runs so I can be sure there aren't any 
old files left over in it.

I tried to use maven-clean-plugin to do it, but it insists on deleting 
the entire /target directory, which I don't want. It looks like there is 
an excludeDefaultDirectories option available on the command line, but 
putting <excludeDefaultDirectories>true</excludeDefaultDirectories> in 
the <configuration> section doesn't work.

Any other suggestions?


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


Re: How to delete a directory?

Posted by Brian Fox <br...@infinity.nu>.
Why don't you just make this folder a subfolder of /target and when you want
this cleaned out, you run clean?

On Tue, Aug 4, 2009 at 3:34 PM, Alexander <th...@gmail.com> wrote:

> Oh, you right. But you already answered your question! [?]
> Use excludeDefaultDirectories. It works fine, really. Be sure you use 2.3
> version of maven-clean-plugin. (as it mentioned in documentation this option
> work only since 2.3)
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-clean-plugin</artifactId>
> <version>2.3</version>
> <configuration>
> <excludeDefaultDirectories>true</excludeDefaultDirectories>
> </configuration>
> </plugin>
>
> 2009/8/5 Chris <sh...@yahoo.com>
>
>> I can delete the directories ok. What I can't do is prevent it from
>> deleting the target directory.
>>
>>
>> Alexander wrote:
>>
>>> No maven-clean-plugin is more flexible. Read there
>>> http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html
>>>  2009/8/5 Chris <shef31@yahoo.com <ma...@yahoo.com>>
>>>
>>>    I'm using maven-dependency-plugin to make a custom directory of
>>>    dependencies. The trouble is that I can't find a way to delete the
>>>    outputDirectory before the plugin runs so I can be sure there aren't
>>>    any old files left over in it.
>>>
>>>    I tried to use maven-clean-plugin to do it, but it insists on
>>>    deleting the entire /target directory, which I don't want. It looks
>>>    like there is an excludeDefaultDirectories option available on the
>>>    command line, but putting
>>>    <excludeDefaultDirectories>true</excludeDefaultDirectories> in the
>>>    <configuration> section doesn't work.
>>>
>>>    Any other suggestions?
>>>
>>>
>>>    ---------------------------------------------------------------------
>>>    To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>    <ma...@maven.apache.org>
>>>    For additional commands, e-mail: users-help@maven.apache.org
>>>    <ma...@maven.apache.org>
>>>
>>>
>>>
>>>
>>> --
>>> Alexander
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> --
> Alexander
>
>

Re: How to delete a directory?

Posted by Chris <sh...@yahoo.com>.
Thanks. It was a version error. 2.3 did the trick.

Alexander wrote:
> Oh, you right. But you already answered your question! 
> 
> Use excludeDefaultDirectories. It works fine, really. Be sure you use 
> 2.3 version of maven-clean-plugin. (as it mentioned in documentation 
> this option work only since 2.3)
> 
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-clean-plugin</artifactId>
> <version>2.3</version>
> <configuration>
> <excludeDefaultDirectories>true</excludeDefaultDirectories>
> </configuration>
> </plugin>
> 
> 2009/8/5 Chris <shef31@yahoo.com <ma...@yahoo.com>>
> 
>     I can delete the directories ok. What I can't do is prevent it from
>     deleting the target directory.
> 
> 
>     Alexander wrote:
> 
>         No maven-clean-plugin is more flexible. Read there
>         http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html
> 
>         2009/8/5 Chris <shef31@yahoo.com <ma...@yahoo.com>
>         <mailto:shef31@yahoo.com <ma...@yahoo.com>>>
> 
> 
>            I'm using maven-dependency-plugin to make a custom directory of
>            dependencies. The trouble is that I can't find a way to
>         delete the
>            outputDirectory before the plugin runs so I can be sure there
>         aren't
>            any old files left over in it.
> 
>            I tried to use maven-clean-plugin to do it, but it insists on
>            deleting the entire /target directory, which I don't want. It
>         looks
>            like there is an excludeDefaultDirectories option available
>         on the
>            command line, but putting
>            <excludeDefaultDirectories>true</excludeDefaultDirectories>
>         in the
>            <configuration> section doesn't work.
> 
>            Any other suggestions?
> 
> 
>          
>          ---------------------------------------------------------------------
>            To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>         <ma...@maven.apache.org>
>            <mailto:users-unsubscribe@maven.apache.org
>         <ma...@maven.apache.org>>
> 
>            For additional commands, e-mail: users-help@maven.apache.org
>         <ma...@maven.apache.org>
>            <mailto:users-help@maven.apache.org
>         <ma...@maven.apache.org>>
> 
> 
> 
> 
>         -- 
>         Alexander
> 
> 
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>     <ma...@maven.apache.org>
>     For additional commands, e-mail: users-help@maven.apache.org
>     <ma...@maven.apache.org>
> 
> 
> 
> 
> -- 
> Alexander
> 


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


Re: How to delete a directory?

Posted by Alexander <th...@gmail.com>.
Oh, you right. But you already answered your question! [?]
Use excludeDefaultDirectories. It works fine, really. Be sure you use 2.3
version of maven-clean-plugin. (as it mentioned in documentation this option
work only since 2.3)

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.3</version>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
</configuration>
</plugin>

2009/8/5 Chris <sh...@yahoo.com>

> I can delete the directories ok. What I can't do is prevent it from
> deleting the target directory.
>
>
> Alexander wrote:
>
>> No maven-clean-plugin is more flexible. Read there
>> http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html
>>  2009/8/5 Chris <shef31@yahoo.com <ma...@yahoo.com>>
>>
>>    I'm using maven-dependency-plugin to make a custom directory of
>>    dependencies. The trouble is that I can't find a way to delete the
>>    outputDirectory before the plugin runs so I can be sure there aren't
>>    any old files left over in it.
>>
>>    I tried to use maven-clean-plugin to do it, but it insists on
>>    deleting the entire /target directory, which I don't want. It looks
>>    like there is an excludeDefaultDirectories option available on the
>>    command line, but putting
>>    <excludeDefaultDirectories>true</excludeDefaultDirectories> in the
>>    <configuration> section doesn't work.
>>
>>    Any other suggestions?
>>
>>
>>    ---------------------------------------------------------------------
>>    To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>    <ma...@maven.apache.org>
>>    For additional commands, e-mail: users-help@maven.apache.org
>>    <ma...@maven.apache.org>
>>
>>
>>
>>
>> --
>> Alexander
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Alexander

Re: How to delete a directory?

Posted by Chris <sh...@yahoo.com>.
I can delete the directories ok. What I can't do is prevent it from 
deleting the target directory.


Alexander wrote:
> No maven-clean-plugin is more flexible. Read 
> there http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html 
> 
> 2009/8/5 Chris <shef31@yahoo.com <ma...@yahoo.com>>
> 
>     I'm using maven-dependency-plugin to make a custom directory of
>     dependencies. The trouble is that I can't find a way to delete the
>     outputDirectory before the plugin runs so I can be sure there aren't
>     any old files left over in it.
> 
>     I tried to use maven-clean-plugin to do it, but it insists on
>     deleting the entire /target directory, which I don't want. It looks
>     like there is an excludeDefaultDirectories option available on the
>     command line, but putting
>     <excludeDefaultDirectories>true</excludeDefaultDirectories> in the
>     <configuration> section doesn't work.
> 
>     Any other suggestions?
> 
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>     <ma...@maven.apache.org>
>     For additional commands, e-mail: users-help@maven.apache.org
>     <ma...@maven.apache.org>
> 
> 
> 
> 
> -- 
> Alexander
> 


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


Re: How to delete a directory?

Posted by Alexander <th...@gmail.com>.
No maven-clean-plugin is more flexible. Read there
http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html
 [?]

2009/8/5 Chris <sh...@yahoo.com>

> I'm using maven-dependency-plugin to make a custom directory of
> dependencies. The trouble is that I can't find a way to delete the
> outputDirectory before the plugin runs so I can be sure there aren't any old
> files left over in it.
>
> I tried to use maven-clean-plugin to do it, but it insists on deleting the
> entire /target directory, which I don't want. It looks like there is an
> excludeDefaultDirectories option available on the command line, but putting
> <excludeDefaultDirectories>true</excludeDefaultDirectories> in the
> <configuration> section doesn't work.
>
> Any other suggestions?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Alexander