Skip to content

Commit d8e7f3a

Browse files
committed
switch to expand and adapt test case accordingly
as discussed with @jglick as the intention of the flatten plugin here is to have a self contained pom - this will switch to expand which will also have the benefit of picking up any <dependencyManagement> configured in the parent(s).
1 parent 30885c8 commit d8e7f3a

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1313,9 +1313,9 @@
13131313
</goals>
13141314
<phase>process-resources</phase>
13151315
<configuration>
1316-
<!-- flattenMode:oss does not keep dependecnyMangement or will promote all transitive dependencies to direct ones, changing resolution order -->
1316+
<!-- flattenMode:oss does not keep dependencyMangement or will promote all transitive dependencies to direct ones, changing resolution order -->
13171317
<pomElements>
1318-
<dependencyManagement>interpolate</dependencyManagement>
1318+
<dependencyManagement>expand</dependencyManagement>
13191319
<!-- from https://github.com/mojohaus/flatten-maven-plugin/blob/flatten-maven-plugin-1.3.0/src/main/java/org/codehaus/mojo/flatten/FlattenMode.java#L100 -->
13201320
<ciManagement>expand</ciManagement>
13211321
<contributors>expand</contributors>

src/it/incrementals-and-plugin-bom/postbuild.groovy

+6-12
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@ String pomXml = new File(basedir, '../../local-repo/io/jenkins/plugins/increment
44
assert pomXml.contains('version>1.0-rc1234.deadbeef5678</version>')
55
// https://github.com/jenkinsci/plugin-pom/issues/705
66
// line endings need normalising
7-
assert pomXml.replace("\r\n", "\n").contains('''
8-
<dependencyManagement>
9-
<dependencies>
10-
<dependency>
11-
<groupId>io.jenkins.tools.bom</groupId>
12-
<artifactId>bom-2.361.x</artifactId>
13-
<version>1580.v47b_429a_c853a</version>
14-
<type>pom</type>
15-
<scope>import</scope>
16-
</dependency>
17-
</dependencies>
18-
</dependencyManagement>'''.replace("\r\n", "\n"))
7+
assert pomXml.matches('(?s).*<dependencyManagement>\\s*<dependencies>'
8+
// something from the parent pom dependencyManagement
9+
+ '.*<dependency>\\s*<groupId>javax.servlet</groupId>\\s*<artifactId>javax.servlet-api</artifactId>\\s*<version>3.1.0</version>\\s*</dependency>'
10+
// something from the bom
11+
+ '.*<dependency>\\s*<groupId>io.jenkins.plugins</groupId>\\s*<artifactId>caffeine-api</artifactId>\\s*<version>2.9.3-65.v6a_47d0f4d1fe</version>\\s*</dependency>'
12+
+ '.*</dependencies>\\s*</dependencyManagement>.*')
1913
return true

0 commit comments

Comments
 (0)