Affected version
maven4-rc4
Bug description
- Consider next project structure: parent and child
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>org.example</groupId>
<artifactId>maven4-test-with-profiles</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<profiles>
<profile>
<id>one</id>
<modules>
<module>m1</module>
</modules>
</profile>
</profiles>
</project>
- Subproject is also pretty simple
m1/pom.xml:
<parent>
<groupId>org.example</groupId>
<artifactId>maven4-test-with-profiles</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>m1</artifactId>
-
I use maven4-rc4
-
When I compile the project using ‘mvn compile` I got only maven4-test-with-profiles in reactor. When I run 'mvn -P one compile’ I got two modules in reactor - maven4-test-with-profiles and m1. Everything is ok.
-
Now, lets change model (with schemas) to 4.1.0
-
Regardless of profile flags, m1 is always included into reactor. Even if you run 'mvn -P!one compile’ reactor will contain m1. That means, that you cannot build the project, if m1 contains code/tests which by some reasons are not valid without the profile.
Is it expected behaviour? Documentation says https://maven.apache.org/whatsnewinmaven4.html - However, Maven does not build subprojects unless they are linked from the root POM file.
So, there’s nothing changed in maven4.
We can change modules tag to subprojects, it does not affect the behaviour.
Affected version
maven4-rc4
Bug description
pom.xml:
m1/pom.xml:
I use maven4-rc4
When I compile the project using ‘mvn compile` I got only maven4-test-with-profiles in reactor. When I run 'mvn -P one compile’ I got two modules in reactor - maven4-test-with-profiles and m1. Everything is ok.
Now, lets change model (with schemas) to 4.1.0
Regardless of profile flags, m1 is always included into reactor. Even if you run 'mvn -P!one compile’ reactor will contain m1. That means, that you cannot build the project, if m1 contains code/tests which by some reasons are not valid without the profile.
Is it expected behaviour? Documentation says https://maven.apache.org/whatsnewinmaven4.html - However, Maven does not build subprojects unless they are linked from the root POM file.
So, there’s nothing changed in maven4.
We can change modules tag to subprojects, it does not affect the behaviour.