Maven not including resources from a specific profile in a multi-module project with properties overriding
I'm working on a multi-module Maven project where I have defined multiple profiles. However, when I attempt to build the project using a specific profile, the resources I expect to be included are not being packaged into the final JAR file. Here's a simplified version of my `pom.xml` for the parent module: ```xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>my-parent-module</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>my-module-a</module> <module>my-module-b</module> </modules> <profiles> <profile> <id>dev</id> <properties> <resource.dir>src/main/resources/dev</resource.dir> </properties> <build> <resources> <resource> <directory>${resource.dir}</directory> </resource> </resources> </build> </profile> </profiles> </project> ``` And in the `my-module-a/pom.xml`, I have the following setup: ```xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.example</groupId> <artifactId>my-parent-module</artifactId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>my-module-a</artifactId> </project> ``` When I run the command `mvn clean package -Pdev`, it doesn't include any of the resources from `src/main/resources/dev` into the JAR. Instead, I'm seeing the default resources from `src/main/resources` being packaged. I've confirmed that the folder `src/main/resources/dev` exists and contains `.properties` files. I've also tried specifying the resource directory directly in `my-module-a/pom.xml` but that doesn't seem to make a difference. Additionally, I checked the effective POM using `mvn help:effective-pom` and the profile seems to be activated correctly. What am I missing here? Is there a specific way to ensure that resources from a profile are correctly picked up during the build in a multi-module setup?