Question

I'm using the maven-resources-plugin 2.6 vith maven 3.0.5 (also tried 3.0.4).

I have different executions :

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <id>dev</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.outputDirectory}/dev</outputDirectory>
                        <filters>
                            <filter>${basedir}/src/main/config/dev-filter.properties</filter>
                        </filters>
                    </configuration>
                </execution>
                <!-- ... -->
            <executions>
        <plugin>
    <plugins>
<build>

When i put the following block

<resources>
    <resource>
            <directory>${basedir}/src/main/resources-env</directory>
            <filtering>true</filtering>
    </resource>
</resources>

inside my <execution> block, it does not work. My files are not copied nor filtered in my output dir.

I need to put it in <build> block. But I don't want to because I have other resource folder with others executions (different output dirs).

Is this an issue ? Because I have no error in my pom.xml when I launch the build.

Was it helpful?

Solution

That resources goal always copies resources from the "build" tag (see here). You should rather use the copy-resources mojo if you want to be able to specify the resources inside the plugin "configuration" tag

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top