Copying a single file then renaming it using maven-resources-plugin -- possible?

16.1k views Asked by At

I copy a single WSDL file from a different project tree, using maven-resources-plugin, as follows:

<execution>
    <id>copy-wsdl-and-rename-it</id>
    <phase>validate</phase>
    <goals>
        <goal>copy-resources</goal>
    </goals>
    <configuration>
        <outputDirectory>${basedir}/src/main/wsdl</outputDirectory>
        <resources>
            <resource>
                <directory>${basedir}/../myws/src/main/wsdl</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </configuration>
</execution>

This works well, but now I need to rename the (single) file under that wsdl directory to something else (e.g. from myws.wsdl in the source directory to my.wsdl in the destination directory).

Is there a way to accomplish this, using the maven-resources-plugin, without resorting to another plugin?

1

There are 1 answers

1
Daniel Kaplan On BEST ANSWER

I don't see a way to do exactly what you're asking for. Why do you have the restriction of not using another plugin? If you change your mind about that here's the answer: Renaming resources in Maven