Skip to content

Commit e38af67

Browse files
Simplify Maven configuration by running DiktatSaveSmokeTest as an integration test (#1482)
### What's done: * Finally, fixes #1478.
1 parent afe277e commit e38af67

File tree

2 files changed

+65
-11
lines changed

2 files changed

+65
-11
lines changed

diktat-rules/pom.xml

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,71 @@
164164

165165
<plugin>
166166
<groupId>org.apache.maven.plugins</groupId>
167-
<artifactId>maven-jar-plugin</artifactId>
167+
<artifactId>maven-surefire-plugin</artifactId>
168+
<configuration>
169+
<excludes>
170+
<exclude>**/DiktatSaveSmokeTest.*</exclude>
171+
</excludes>
172+
</configuration>
173+
</plugin>
174+
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-failsafe-plugin</artifactId>
178+
<configuration>
179+
<includes>
180+
<include>**/DiktatSaveSmokeTest.*</include>
181+
</includes>
182+
</configuration>
183+
<executions>
184+
<execution>
185+
<goals>
186+
<goal>integration-test</goal>
187+
<goal>verify</goal>
188+
</goals>
189+
</execution>
190+
</executions>
191+
</plugin>
192+
193+
<plugin>
194+
<groupId>org.jacoco</groupId>
195+
<artifactId>jacoco-maven-plugin</artifactId>
168196
<executions>
169-
<!-- Don't produce the JAR during the `package` phase. -->
197+
<!-- These executions complement those defined in the parent pom.xml. -->
170198
<execution>
171-
<id>default-jar</id>
172-
<phase>none</phase>
199+
<id>default-prepare-agent-integration</id>
200+
<goals>
201+
<goal>prepare-agent-integration</goal>
202+
</goals>
173203
</execution>
174-
<!-- Instead, create it immediately before the `test` phase
175-
so that the shade plug-in may use it. -->
176204
<execution>
177-
<id>fat-jar-for-smoke-tests</id>
178-
<phase>process-test-classes</phase>
205+
<id>default-merge</id>
206+
<phase>post-integration-test</phase>
207+
<goals>
208+
<goal>merge</goal>
209+
</goals>
210+
<configuration>
211+
<fileSets>
212+
<fileSet>
213+
<directory>${project.build.directory}</directory>
214+
<includes>
215+
<include>jacoco.exec</include>
216+
<include>jacoco-it.exec</include>
217+
</includes>
218+
</fileSet>
219+
</fileSets>
220+
<destFile>${project.build.directory}/jacoco-merged.exec</destFile>
221+
</configuration>
222+
</execution>
223+
<execution>
224+
<id>default-report-merged</id>
179225
<goals>
180-
<goal>jar</goal>
226+
<goal>report-integration</goal>
181227
</goals>
228+
<configuration>
229+
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
230+
<dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
231+
</configuration>
182232
</execution>
183233
</executions>
184234
</plugin>
@@ -188,7 +238,6 @@
188238
<plugin>
189239
<groupId>org.apache.maven.plugins</groupId>
190240
<artifactId>maven-shade-plugin</artifactId>
191-
<version>3.3.0</version>
192241
<configuration>
193242
<!-- Suppress the generation of `dependency-reduced-pom.xml`,
194243
because it will also get installed under `~/.m2`,
@@ -221,7 +270,7 @@
221270
<executions>
222271
<execution>
223272
<id>fat-jar-for-smoke-tests</id>
224-
<phase>process-test-classes</phase>
273+
<phase>package</phase>
225274
<goals>
226275
<goal>shade</goal>
227276
</goals>

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@
278278
<artifactId>maven-failsafe-plugin</artifactId>
279279
<version>3.0.0-M7</version>
280280
</plugin>
281+
<plugin>
282+
<groupId>org.apache.maven.plugins</groupId>
283+
<artifactId>maven-shade-plugin</artifactId>
284+
<version>3.3.0</version>
285+
</plugin>
281286
<plugin>
282287
<groupId>org.codehaus.mojo</groupId>
283288
<artifactId>versions-maven-plugin</artifactId>

0 commit comments

Comments
 (0)