Skip to content

Commit c11e514

Browse files
committed
Allow individual builds of invoker plugin projects
Clean `${revision}` variables when running invoker based integration tests. Prior to this commit some `${revision}` placeholders remained in the invoker local repository preventing the project from being built outside of the reactor. Fixes gh-10667
1 parent c55b5d7 commit c11e514

File tree

2 files changed

+76
-14
lines changed
  • spring-boot-project/spring-boot-tools

2 files changed

+76
-14
lines changed

spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,52 @@
6161
<groupId>org.apache.maven.plugins</groupId>
6262
<artifactId>maven-invoker-plugin</artifactId>
6363
<configuration>
64-
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
65-
<settingsFile>src/it/settings.xml</settingsFile>
6664
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
67-
<postBuildHookScript>verify</postBuildHookScript>
68-
<addTestClassPath>true</addTestClassPath>
69-
<skipInvocation>${skipTests}</skipInvocation>
70-
<streamLogs>true</streamLogs>
7165
</configuration>
7266
<executions>
7367
<execution>
74-
<id>integration-test</id>
68+
<id>prepare-integration-test</id>
69+
<phase>pre-integration-test</phase>
7570
<goals>
7671
<goal>install</goal>
72+
</goals>
73+
</execution>
74+
<execution>
75+
<id>integration-test</id>
76+
<goals>
77+
<goal>run</goal>
78+
</goals>
79+
<configuration>
80+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
81+
<settingsFile>src/it/settings.xml</settingsFile>
82+
<postBuildHookScript>verify</postBuildHookScript>
83+
<addTestClassPath>true</addTestClassPath>
84+
<skipInvocation>${skipTests}</skipInvocation>
85+
<streamLogs>true</streamLogs>
86+
</configuration>
87+
</execution>
88+
</executions>
89+
</plugin>
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-antrun-plugin</artifactId>
93+
<executions>
94+
<execution>
95+
<id>cleanup-local-integration-repo</id>
96+
<phase>pre-integration-test</phase>
97+
<goals>
7798
<goal>run</goal>
7899
</goals>
100+
<configuration>
101+
<target>
102+
<replaceregexp match="\$\{revision\}" replace="${project.version}"
103+
flags="g" byline="true">
104+
<fileset
105+
dir="${project.build.directory}/local-repo/org/springframework/boot/"
106+
includes="**/*.pom" />
107+
</replaceregexp>
108+
</target>
109+
</configuration>
79110
</execution>
80111
</executions>
81112
</plugin>

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,52 @@
125125
<groupId>org.apache.maven.plugins</groupId>
126126
<artifactId>maven-invoker-plugin</artifactId>
127127
<configuration>
128-
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
129-
<settingsFile>src/it/settings.xml</settingsFile>
130128
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
131-
<postBuildHookScript>verify</postBuildHookScript>
132-
<addTestClassPath>true</addTestClassPath>
133-
<skipInvocation>${skipTests}</skipInvocation>
134-
<streamLogs>true</streamLogs>
135129
</configuration>
136130
<executions>
137131
<execution>
138-
<id>integration-test</id>
132+
<id>prepare-integration-test</id>
133+
<phase>pre-integration-test</phase>
139134
<goals>
140135
<goal>install</goal>
136+
</goals>
137+
</execution>
138+
<execution>
139+
<id>integration-test</id>
140+
<goals>
141+
<goal>run</goal>
142+
</goals>
143+
<configuration>
144+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
145+
<settingsFile>src/it/settings.xml</settingsFile>
146+
<postBuildHookScript>verify</postBuildHookScript>
147+
<addTestClassPath>true</addTestClassPath>
148+
<skipInvocation>${skipTests}</skipInvocation>
149+
<streamLogs>true</streamLogs>
150+
</configuration>
151+
</execution>
152+
</executions>
153+
</plugin>
154+
<plugin>
155+
<groupId>org.apache.maven.plugins</groupId>
156+
<artifactId>maven-antrun-plugin</artifactId>
157+
<executions>
158+
<execution>
159+
<id>cleanup-local-integration-repo</id>
160+
<phase>pre-integration-test</phase>
161+
<goals>
141162
<goal>run</goal>
142163
</goals>
164+
<configuration>
165+
<target>
166+
<replaceregexp match="\$\{revision\}" replace="${project.version}"
167+
flags="g" byline="true">
168+
<fileset
169+
dir="${project.build.directory}/local-repo/org/springframework/boot/"
170+
includes="**/*.pom" />
171+
</replaceregexp>
172+
</target>
173+
</configuration>
143174
</execution>
144175
</executions>
145176
</plugin>

0 commit comments

Comments
 (0)