|
161 | 161 | </arguments>
|
162 | 162 | </configuration>
|
163 | 163 | </plugin>
|
| 164 | + |
| 165 | + <plugin> |
| 166 | + <groupId>org.apache.maven.plugins</groupId> |
| 167 | + <artifactId>maven-jar-plugin</artifactId> |
| 168 | + <executions> |
| 169 | + <!-- Don't produce the JAR during the `package` phase. --> |
| 170 | + <execution> |
| 171 | + <id>default-jar</id> |
| 172 | + <phase>none</phase> |
| 173 | + </execution> |
| 174 | + <!-- Instead, create it immediately before the `test` phase |
| 175 | + so that the shade plug-in may use it. --> |
| 176 | + <execution> |
| 177 | + <id>fat-jar-for-smoke-tests</id> |
| 178 | + <phase>process-test-classes</phase> |
| 179 | + <goals> |
| 180 | + <goal>jar</goal> |
| 181 | + </goals> |
| 182 | + </execution> |
| 183 | + </executions> |
| 184 | + </plugin> |
| 185 | + |
| 186 | + <!-- Create a fat JAR to be used in smoke tests, removing the |
| 187 | + circular dependency between `diktat-rules` and `diktat-ruleset`. --> |
| 188 | + <plugin> |
| 189 | + <groupId>org.apache.maven.plugins</groupId> |
| 190 | + <artifactId>maven-shade-plugin</artifactId> |
| 191 | + <version>3.3.0</version> |
| 192 | + <configuration> |
| 193 | + <!-- Suppress the generation of `dependency-reduced-pom.xml`, |
| 194 | + because it will also get installed under `~/.m2`, |
| 195 | + resulting in the `diktat-maven-plugin` build failure |
| 196 | + (the plug-in depends on `diktat-rules`). --> |
| 197 | + <createDependencyReducedPom>false</createDependencyReducedPom> |
| 198 | + <!-- Should be `false`: otherwise, the generated JAR, even |
| 199 | + with a custom classifier, will still be installed/deployed. --> |
| 200 | + <shadedArtifactAttached>false</shadedArtifactAttached> |
| 201 | + <!-- Necessary: otherwise, the artifact produced by the JAR |
| 202 | + plug-in will be overwritten by the fat JAR. --> |
| 203 | + <finalName>${project.name}-${project.version}-fat-jar-for-smoke-tests</finalName> |
| 204 | + <artifactSet> |
| 205 | + <excludes> |
| 206 | + <exclude>com.squareup:kotlinpoet</exclude> |
| 207 | + <exclude>net.java.dev.jna:jna</exclude> |
| 208 | + <exclude>org.jetbrains.intellij.deps:trove4j</exclude> |
| 209 | + <exclude>org.jetbrains.kotlin:kotlin-compiler-embeddable</exclude> |
| 210 | + <exclude>org.jetbrains.kotlin:kotlin-daemon-embeddable</exclude> |
| 211 | + <exclude>org.jetbrains.kotlin:kotlin-reflect</exclude> |
| 212 | + <exclude>org.jetbrains.kotlin:kotlin-script-runtime</exclude> |
| 213 | + <exclude>org.jetbrains.kotlin:kotlin-stdlib-common</exclude> |
| 214 | + <exclude>org.jetbrains.kotlin:kotlin-stdlib-jdk7</exclude> |
| 215 | + <exclude>org.jetbrains.kotlin:kotlin-stdlib-jdk8</exclude> |
| 216 | + <exclude>org.jetbrains.kotlin:kotlin-stdlib</exclude> |
| 217 | + <exclude>org.jetbrains:annotations</exclude> |
| 218 | + </excludes> |
| 219 | + </artifactSet> |
| 220 | + </configuration> |
| 221 | + <executions> |
| 222 | + <execution> |
| 223 | + <id>fat-jar-for-smoke-tests</id> |
| 224 | + <phase>process-test-classes</phase> |
| 225 | + <goals> |
| 226 | + <goal>shade</goal> |
| 227 | + </goals> |
| 228 | + </execution> |
| 229 | + </executions> |
| 230 | + </plugin> |
164 | 231 | </plugins>
|
165 | 232 | </build>
|
166 | 233 |
|
|
0 commit comments