mojohaus / flatten-maven-plugin

Flatten Maven Plugin
https://www.mojohaus.org/flatten-maven-plugin/
Apache License 2.0
201 stars 85 forks source link

Mode resolveCiFriendliesOnly don't resolve variables in <dependency> and <dependenceManagement> in submodules. #422

Open lowcasz opened 1 month ago

lowcasz commented 1 month ago

Plugin with mode resolveCiFriendliesOnly works in parent pom correctly, but in submodules it replace variables in parent and version tags, other occurences are ignored.

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>maven-flatten-plugin.bug</groupId>
    <artifactId>parent</artifactId>
    <version>HERE-WORKS</version>
  </parent>
  <artifactId>demo</artifactId>
  <version>HERE-WORKS</version>
  <packaging>pom</packaging>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>maven-flatten-plugin.bug</groupId>
        <artifactId>dependency-management</artifactId>
        <version>${revision}</version><!------------------------------------- this place is not resolved -->
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>maven-flatten-plugin.bug</groupId>
      <artifactId>dependency</artifactId>
      <version>${revision}</version><!-------------------------------------- this place is not resolved -->
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</project>

The bug demo and sample workaround is available here: https://github.com/lowcasz/maven-flatten-plugin-bug

lowcasz commented 1 month ago

Connected to: #122