Hi,

i want to copy a resource. That works fine, as long as the file does not
exist in the target directory. But in this case the file has to exist in the
target directory and has to be overwritten. Here are the two relevant parts
of my pom.xml:

Integration of Resources-Plugin:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.1</version>
</plugin>


Build-Configuration:

<build>
        <resources>
                <resource>
                        <directory>conf/${env}</directory>
                        <targetPath >../app/pages/global/</targetPath>
                        <includes>
                                <include>part.jspx</include>
                        </includes>
                </resource>
        </resources>
…

I’ve found out that an overwrite parameter exists, but I have no idea where
to put this parameter
(http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#overwrite).

I tried:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
                <overwrite>true</overwrite>
      </configuration>
</plugin>

Or:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
                <resources>
                        <overwrite>true</overwrite>
                </resources>
       </configuration>
</plugin>


In the first case the build process works fine, but the file is not being
overwritten. In the second case the following error occurs:

------------------------------------------
Instead of configuring this parameter directly, try configuring your POM or
settings.xml file.

Using the default-value and expression annotations built into the mojo
itself, these values were found in your build:

Value: null
Using the expression:null

Value: null
Using the expression:null

If one of the above expressions rendered a valid value, it may give some
indication of which part of the POM or settings.xml you can modify in order
to change this parameter's value.
-------------------------------------------

How do I configure the overwritte parameter correctly?

-- 
View this message in context: 
http://old.nabble.com/copy-resources-does-not-overwrite-existing-files-tp27127591p27127591.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to