Skip to content

Commit

Permalink
Simplify Maven configuration by running DiktatSaveSmokeTest as an i…
Browse files Browse the repository at this point in the history
…ntegration test (#1482)

### What's done:

 * Finally, fixes #1478.
  • Loading branch information
0x6675636b796f75676974687562 authored Jul 28, 2022
1 parent afe277e commit e38af67
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 11 deletions.
71 changes: 60 additions & 11 deletions diktat-rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,71 @@

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/DiktatSaveSmokeTest.*</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/DiktatSaveSmokeTest.*</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<!-- Don't produce the JAR during the `package` phase. -->
<!-- These executions complement those defined in the parent pom.xml. -->
<execution>
<id>default-jar</id>
<phase>none</phase>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<!-- Instead, create it immediately before the `test` phase
so that the shade plug-in may use it. -->
<execution>
<id>fat-jar-for-smoke-tests</id>
<phase>process-test-classes</phase>
<id>default-merge</id>
<phase>post-integration-test</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>jacoco.exec</include>
<include>jacoco-it.exec</include>
</includes>
</fileSet>
</fileSets>
<destFile>${project.build.directory}/jacoco-merged.exec</destFile>
</configuration>
</execution>
<execution>
<id>default-report-merged</id>
<goals>
<goal>jar</goal>
<goal>report-integration</goal>
</goals>
<configuration>
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
<dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -188,7 +238,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<!-- Suppress the generation of `dependency-reduced-pom.xml`,
because it will also get installed under `~/.m2`,
Expand Down Expand Up @@ -221,7 +270,7 @@
<executions>
<execution>
<id>fat-jar-for-smoke-tests</id>
<phase>process-test-classes</phase>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
Expand Down

0 comments on commit e38af67

Please sign in to comment.