Skip to content

Commit 322836e

Browse files
authored
chore: flatten pom, add licences to jar (#1806)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent ce6c3e2 commit 322836e

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build
66
.idea
77
specification.json
88
target
9+
.flattened-pom.xml
910
.DS_Store
1011
.cursor/
1112

pom.xml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,22 @@
111111
</dependency>
112112

113113
<dependency>
114+
<!-- compile-time annotation processor; not needed by consumers at runtime -->
114115
<groupId>org.projectlombok</groupId>
115116
<artifactId>lombok</artifactId>
116117
<version>1.18.42</version>
117118
<scope>provided</scope>
119+
<optional>true</optional>
118120
</dependency>
119121

120122
<dependency>
121123
<!-- used so that lombok can generate suppressions for spotbugs. It needs to find it on the relevant classpath -->
124+
<!-- compile-time only; not needed by consumers at runtime -->
122125
<groupId>com.github.spotbugs</groupId>
123126
<artifactId>spotbugs</artifactId>
124127
<version>4.9.8</version>
125128
<scope>provided</scope>
129+
<optional>true</optional>
126130
</dependency>
127131

128132
<!-- end provided -->
@@ -258,6 +262,59 @@
258262
</argLine>
259263
</configuration>
260264
</plugin>
265+
266+
<!-- flatten the POM that gets deployed to Maven Central, removing test deps, and in-lining parent elements -->
267+
<plugin>
268+
<groupId>org.codehaus.mojo</groupId>
269+
<artifactId>flatten-maven-plugin</artifactId>
270+
<version>1.7.0</version>
271+
<configuration>
272+
<flattenMode>ossrh</flattenMode>
273+
</configuration>
274+
<executions>
275+
<execution>
276+
<id>flatten</id>
277+
<phase>process-resources</phase>
278+
<goals>
279+
<goal>flatten</goal>
280+
</goals>
281+
</execution>
282+
<execution>
283+
<id>flatten.clean</id>
284+
<phase>clean</phase>
285+
<goals>
286+
<goal>clean</goal>
287+
</goals>
288+
</execution>
289+
</executions>
290+
</plugin>
291+
292+
<!-- bundle the root LICENSE file into published JARs -->
293+
<plugin>
294+
<groupId>org.apache.maven.plugins</groupId>
295+
<artifactId>maven-resources-plugin</artifactId>
296+
<version>3.5.0</version>
297+
<executions>
298+
<execution>
299+
<id>copy-license</id>
300+
<phase>process-resources</phase>
301+
<goals>
302+
<goal>copy-resources</goal>
303+
</goals>
304+
<configuration>
305+
<outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
306+
<resources>
307+
<resource>
308+
<directory>${maven.multiModuleProjectDirectory}</directory>
309+
<includes>
310+
<include>LICENSE</include>
311+
</includes>
312+
</resource>
313+
</resources>
314+
</configuration>
315+
</execution>
316+
</executions>
317+
</plugin>
261318
</plugins>
262319
</build>
263320
<profiles>

0 commit comments

Comments
 (0)