Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-8188

[REGRESSION] Property not resolved in profile pluginManagement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.9.8
    • 3.9.9
    • POM, Profiles
    • None

    Description

      Hello,

      Consider the following POM file:

      <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      	<modelVersion>4.0.0</modelVersion>
      
      	<groupId>foo</groupId>
      	<artifactId>foo</artifactId>
      	<version>foo</version>
      
      	<properties>
      		<version.spring-boot>3.3.1</version.spring-boot>
      	</properties>
      
      	<build>
      		<pluginManagement>
      			<plugins>
      				<plugin>
      					<groupId>org.springframework.boot</groupId>
      					<artifactId>spring-boot-maven-plugin</artifactId>
      					<version>${version.spring-boot}</version>
      				</plugin>
      			</plugins>
      		</pluginManagement>
      	</build>
      
      	<profiles>
      		<profile>
      			<id>foo</id>
      			<build>
      				<pluginManagement>
      					<plugins>
      						<plugin>
      							<groupId>org.springframework.boot</groupId>
      							<artifactId>spring-boot-maven-plugin</artifactId>
      							<version>${version.spring-boot}</version>
      						</plugin>
      					</plugins>
      				</pluginManagement>
      			</build>
      		</profile>
      	</profiles>
      </project>
      

      Using this command: mvn help:effective-pom

      The "version.spring-boot" property is resolved in the first case, but not in the second one. The property should be resolved everywhere.

      Snippet of the generated effective POM:

      […]
          <profile>
            <id>foo</id>
            <build>
              <pluginManagement>
                <plugins>
                  <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${version.spring-boot}</version>
                  </plugin>
                </plugins>
              </pluginManagement>
            </build>
          </profile>
      […]
      

      Attachments

        1. pom.xml
          1 kB
          Alexis Jehan

        Issue Links

          Activity

            People

              cstamas Tamas Cservenak
              alexisj Alexis Jehan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: