-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Affected version
Apache Maven 4.0.0-SNAPSHOT (b7f9178)
Bug description
With Maven 3.9.x and this configuration:
<build>
<resources>
<resource>
<directory>${project.basedir}/rest</directory>
<targetPath>target-dir</targetPath>
<includes>
<include>**/*.yml</include>
</includes>
</resource>
</resources>
</build>
all files rest/**/*.yml are copied to target/classes/target-dir:
[INFO] --- resources:3.3.1:resources (default-resources) @ project1 ---
[INFO] Copying 36 resources from rest to target/classes/target-dir
But with Maven 4, with same version of Maven resources plugin, all files rest/**/*.yml are copied to root dir target-dir:
[INFO] --- resources:3.3.1:resources (default-resources) @ project1---
[INFO] Copying 36 resources from rest to target-dir
[INFO] ---------------------------------------------
It seams that relative targetPath is not the same as in Maven 3.9.x
A workaround is to prefix targetPath with ${project.build.outputDirectory}/, it works both on Maven 3 and 4:
<build>
<resources>
<resource>
<directory>${project.basedir}/rest</directory>
<targetPath>${project.build.outputDirectory}/target-dir</targetPath>
<includes>
<include>**/*.yml</include>
</includes>
</resource>
</resources>
</build>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working