-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
575eb6e
commit e386ef7
Showing
31 changed files
with
1,414 additions
and
66 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/it/projects/issue-382-project-version-from-parent-is-not-interpolated/bom/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>issue-382-project-version-from-parent-is-not-interpolated</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>bom</artifactId> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<interpolated-project-version>${project.version}</interpolated-project-version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.grpc</groupId> | ||
<artifactId>grpc-netty</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
</project> |
45 changes: 45 additions & 0 deletions
45
src/it/projects/issue-382-project-version-from-parent-is-not-interpolated/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>issue-382-project-version-from-parent-is-not-interpolated</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<interpolated-project-version>${project.version}</interpolated-project-version> | ||
</properties> | ||
|
||
<modules> | ||
<module>bom</module> | ||
</modules> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.grpc</groupId> | ||
<artifactId>grpc-netty</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
</dependencyManagement> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<pomElements> | ||
<parent>remove</parent> | ||
<properties>interpolate</properties> | ||
<dependencyManagement>interpolate</dependencyManagement> | ||
</pomElements> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
64 changes: 64 additions & 0 deletions
64
src/it/projects/issue-382-project-version-from-parent-is-not-interpolated/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import groovy.xml.XmlSlurper | ||
|
||
{ | ||
final File parentOriginalFile = new File(basedir, 'pom.xml') | ||
assert parentOriginalFile.exists() | ||
|
||
final parentOriginal = new XmlSlurper().parse(parentOriginalFile) | ||
assert '${project.version}' == parentOriginal.dependencyManagement.dependencies.dependency[0].version.text() | ||
|
||
} | ||
|
||
{ | ||
final File flattenedParentPomFile = new File(basedir, '.flattened-pom.xml') | ||
assert flattenedParentPomFile.exists() | ||
|
||
final flattenedParent = new XmlSlurper().parse(flattenedParentPomFile) | ||
assert 0 == flattenedParent.parent.size() | ||
assert '0.0.1-SNAPSHOT' == flattenedParent.properties.'interpolated-project-version'.text() | ||
assert '0.0.1-SNAPSHOT' == flattenedParent.dependencyManagement.dependencies.dependency[0].version.text() | ||
} | ||
|
||
|
||
{ | ||
final File bomOriginalFile = new File(basedir, 'bom/pom.xml') | ||
assert bomOriginalFile.exists() | ||
|
||
final bomOriginal = new XmlSlurper().parse(bomOriginalFile) | ||
assert '0.0.1-SNAPSHOT' == bomOriginal.parent.version.text() | ||
assert 1 == bomOriginal.parent.size() | ||
assert 1 == bomOriginal.dependencyManagement.size() | ||
assert 1 == bomOriginal.dependencyManagement.dependencies.size() | ||
assert 1 == bomOriginal.dependencyManagement.dependencies.dependency.size() | ||
assert '${project.version}' == bomOriginal.properties.'interpolated-project-version'.text() | ||
assert '${project.version}' == bomOriginal.dependencyManagement.dependencies.dependency[0].version.text() | ||
} | ||
|
||
{ | ||
final File flattenedBomPomFile = new File(basedir, 'bom/.flattened-pom.xml') | ||
assert flattenedBomPomFile.exists() | ||
|
||
final flattenedBom = new XmlSlurper().parse(flattenedBomPomFile) | ||
assert 0 == flattenedBom.parent.size() | ||
assert '${project.version}' == flattenedBom.properties.'interpolated-project-version'.text() | ||
assert '${project.version}' == flattenedBom.dependencyManagement.dependencies.dependency[0].version.text() | ||
} | ||
|
59 changes: 59 additions & 0 deletions
59
src/it/projects/issue-382-properties-from-parent-are-not-interpolated/bom/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>issue-382-properties-from-parent-are-not-interpolated</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>bom</artifactId> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<version.grpc>1.57.1</version.grpc> | ||
<interpolated-version-springboot>${version.springboot}</interpolated-version-springboot> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>${version.springboot}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
|
||
<!-- gRPC/protobuf --> | ||
<dependency> | ||
<groupId>io.grpc</groupId> | ||
<artifactId>grpc-netty</artifactId> | ||
<version>${version.grpc}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<pomElements> | ||
<parent>remove</parent> | ||
<properties>interpolate</properties> | ||
<dependencyManagement>interpolate</dependencyManagement> | ||
</pomElements> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
21 changes: 21 additions & 0 deletions
21
src/it/projects/issue-382-properties-from-parent-are-not-interpolated/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>issue-382-properties-from-parent-are-not-interpolated</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<version.springboot>3.1.2</version.springboot> | ||
</properties> | ||
|
||
|
||
<modules> | ||
<module>bom</module> | ||
</modules> | ||
|
||
|
||
</project> |
51 changes: 51 additions & 0 deletions
51
src/it/projects/issue-382-properties-from-parent-are-not-interpolated/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import groovy.xml.XmlSlurper | ||
|
||
{ | ||
final File bomOriginalFile = new File(basedir, 'bom/pom.xml') | ||
assert bomOriginalFile.exists() | ||
|
||
final bomOriginal = new XmlSlurper().parse(bomOriginalFile) | ||
assert 1 == bomOriginal.parent.size() | ||
assert 1 == bomOriginal.dependencyManagement.size() | ||
assert 1 == bomOriginal.dependencyManagement.dependencies.size() | ||
assert 2 == bomOriginal.dependencyManagement.dependencies.dependency.size() | ||
assert 'grpc-netty' == bomOriginal.dependencyManagement.dependencies.dependency[1].artifactId.text() | ||
assert '${version.grpc}' == bomOriginal.dependencyManagement.dependencies.dependency[1].version.text() | ||
assert 'spring-boot-dependencies' == bomOriginal.dependencyManagement.dependencies.dependency[0].artifactId.text() | ||
assert '${version.springboot}' == bomOriginal.dependencyManagement.dependencies.dependency[0].version.text() | ||
assert '${version.springboot}' == bomOriginal.properties.'interpolated-version-springboot'.text() | ||
} | ||
{ | ||
final File flattenedBomPomFile = new File(basedir, 'bom/.flattened-pom.xml') | ||
assert flattenedBomPomFile.exists() | ||
|
||
final flattenedBom = new XmlSlurper().parse(flattenedBomPomFile) | ||
|
||
assert 1 == flattenedBom.dependencyManagement.size() | ||
assert 1 == flattenedBom.dependencyManagement.dependencies.size() | ||
assert 2 == flattenedBom.dependencyManagement.dependencies.dependency.size() | ||
assert 'grpc-netty' == flattenedBom.dependencyManagement.dependencies.dependency[1].artifactId.text() | ||
assert '1.57.1' == flattenedBom.dependencyManagement.dependencies.dependency[1].version.text() | ||
assert 'spring-boot-dependencies' == flattenedBom.dependencyManagement.dependencies.dependency[0].artifactId.text() | ||
assert '${version.springboot}' == flattenedBom.properties.'interpolated-version-springboot'.text() | ||
assert '${version.springboot}' == flattenedBom.dependencyManagement.dependencies.dependency[0].version.text() | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...sue-382-with-extended_interpolate-project-version-from-parent-is-interpolated/bom/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>issue-382-with-extended_interpolate-project-version-from-parent-is-interpolated</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>bom</artifactId> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<interpolated-project-version>${project.version}</interpolated-project-version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.grpc</groupId> | ||
<artifactId>grpc-netty</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
</project> |
46 changes: 46 additions & 0 deletions
46
...s/issue-382-with-extended_interpolate-project-version-from-parent-is-interpolated/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>issue-382-with-extended_interpolate-project-version-from-parent-is-interpolated</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<version.flatten-maven-plugin>1.0.0-gebit15</version.flatten-maven-plugin> | ||
<interpolated-project-version>${project.version}</interpolated-project-version> | ||
</properties> | ||
|
||
<modules> | ||
<module>bom</module> | ||
</modules> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.grpc</groupId> | ||
<artifactId>grpc-netty</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
</dependencyManagement> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<pomElements> | ||
<parent>remove</parent> | ||
<properties>extended_interpolate</properties> | ||
<dependencyManagement>extended_interpolate</dependencyManagement> | ||
</pomElements> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Oops, something went wrong.