You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dušan Rychnovský <ge...@gmail.com> on 2011/07/07 11:22:10 UTC

maven-resources-plugin - copying custom nonpackaged resources - rewrite existing files

Hi all,

I use the maven-resources-plugin to copy some configuration files to the
same directory as the resulting jar goes to (which is different from the
standard target directory - I changed that using the maven-jar-plugin's
outputDirectory configuration selection). It works fine, there's just one
issue. If a file with the same name (but different content) already exists
in the directory, maven won't copy the new version of the file (and thus
rewrite the old one).

I don't want to delete the whole directory before the copying phase, because
there might be other files, which I don't won't to lose.

I have searched google and it seems to me that it is not possible to
configure the plugin the way I need. Please prove me wrong or advise me what
is the best way to get the behaviour I need.

I'm using maven version 2.2.1.

Please excuse my improper english.

Thanks a lot!
Dusan

Re: maven-resources-plugin - copying custom nonpackaged resources - rewrite existing files

Posted by Guillaume Polet <gu...@agilebirds.com>.
Have you tried with the overwrite property in your resource plugin:
http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#overwrite

Yet your configuration seems kind of odd and not very robust if you 
cannot clean the output directory before packaging. One of the purpose 
of Maven is to have reproductible and consistent build. It seems that 
the way you manage your build is going in the opposite direction.

Guillaume

Le 7/07/2011 11:22, Dušan Rychnovský a écrit :
> Hi all,
>
> I use the maven-resources-plugin to copy some configuration files to the
> same directory as the resulting jar goes to (which is different from the
> standard target directory - I changed that using the maven-jar-plugin's
> outputDirectory configuration selection). It works fine, there's just one
> issue. If a file with the same name (but different content) already exists
> in the directory, maven won't copy the new version of the file (and thus
> rewrite the old one).
>
> I don't want to delete the whole directory before the copying phase, because
> there might be other files, which I don't won't to lose.
>
> I have searched google and it seems to me that it is not possible to
> configure the plugin the way I need. Please prove me wrong or advise me what
> is the best way to get the behaviour I need.
>
> I'm using maven version 2.2.1.
>
> Please excuse my improper english.
>
> Thanks a lot!
> Dusan
>


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