Skip to content

Commit c3c2972

Browse files
authored
Enforce dependency management (#417)
Builds off of #413 to enable the dependency management plugin in non-report mode.
1 parent 296f30c commit c3c2972

File tree

4 files changed

+70
-4
lines changed

4 files changed

+70
-4
lines changed

.devcontainer/devcontainer.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"github.vscode-github-actions",
4747
"github.vscode-pull-request-github",
4848
"huntertran.auto-markdown-toc",
49+
"redhat.fabric8-analytics",
4950
"vscjava.vscode-java-pack"
5051
]
5152
}

.github/workflows/maven.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ jobs:
7676
cache: 'maven'
7777
distribution: 'temurin'
7878

79-
- name: Package with Maven
80-
run: mvn -B package -P ${{matrix.profile}} --file pom.xml -DskipTests -D descriptors=src/main/assembly/tgz.xml
79+
- name: Package and verify with Maven
80+
run: |
81+
mvn -B package verify -P ${{matrix.profile}} --file pom.xml -DskipTests -D descriptors=src/main/assembly/tgz.xml
8182
8283
- name: Upload TGZ artifact
8384
uses: actions/upload-artifact@v3

.vscode/extensions.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"EditorConfig.EditorConfig",
44
"github.vscode-pull-request-github",
55
"huntertran.auto-markdown-toc",
6+
"redhat.fabric8-analytics",
67
"vscjava.vscode-java-pack"
78
]
89
}

pom.xml

+65-2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<groupId>org.postgresql</groupId>
8585
<artifactId>postgresql</artifactId>
8686
<version>42.6.0</version>
87+
<scope>runtime</scope>
8788
</dependency>
8889
</dependencies>
8990
</profile>
@@ -103,6 +104,7 @@
103104
<groupId>mysql</groupId>
104105
<artifactId>mysql-connector-java</artifactId>
105106
<version>8.0.30</version>
107+
<scope>runtime</scope>
106108
</dependency>
107109
</dependencies>
108110
</profile>
@@ -144,6 +146,7 @@
144146
<groupId>org.mariadb.jdbc</groupId>
145147
<artifactId>mariadb-java-client</artifactId>
146148
<version>3.1.4</version>
149+
<scope>runtime</scope>
147150
</dependency>
148151
</dependencies>
149152
</profile>
@@ -163,6 +166,7 @@
163166
<groupId>com.google.cloud</groupId>
164167
<artifactId>google-cloud-spanner-jdbc</artifactId>
165168
<version>2.10.0</version>
169+
<scope>runtime</scope>
166170
</dependency>
167171
</dependencies>
168172
</profile>
@@ -182,6 +186,7 @@
182186
<groupId>org.postgresql</groupId>
183187
<artifactId>postgresql</artifactId>
184188
<version>42.6.0</version>
189+
<scope>runtime</scope>
185190
</dependency>
186191
</dependencies>
187192
</profile>
@@ -201,6 +206,7 @@
201206
<groupId>org.apache.phoenix</groupId>
202207
<artifactId>phoenix-client-hbase-2.4</artifactId>
203208
<version>5.1.3</version>
209+
<scope>runtime</scope>
204210
</dependency>
205211
</dependencies>
206212
</profile>
@@ -220,6 +226,7 @@
220226
<groupId>com.microsoft.sqlserver</groupId>
221227
<artifactId>mssql-jdbc</artifactId>
222228
<version>11.2.3.jre17</version>
229+
<scope>runtime</scope>
223230
</dependency>
224231
</dependencies>
225232
</profile>
@@ -233,6 +240,7 @@
233240
</dependency>
234241

235242
<dependency>
243+
<!-- Drop-in replacement of log4j -->
236244
<groupId>org.slf4j</groupId>
237245
<artifactId>slf4j-reload4j</artifactId>
238246
<version>2.0.9</version>
@@ -245,6 +253,7 @@
245253
</dependency>
246254

247255
<dependency>
256+
<!-- For templated benchmark -->
248257
<groupId>commons-jxpath</groupId>
249258
<artifactId>commons-jxpath</artifactId>
250259
<version>1.3</version>
@@ -268,6 +277,13 @@
268277
<version>2.15.1</version>
269278
</dependency>
270279

280+
<dependency>
281+
<groupId>org.apache.commons</groupId>
282+
<artifactId>commons-text</artifactId>
283+
<version>1.10.0</version>
284+
<scope>compile</scope>
285+
</dependency>
286+
271287
<dependency>
272288
<groupId>org.apache.commons</groupId>
273289
<artifactId>commons-collections4</artifactId>
@@ -293,15 +309,18 @@
293309
</dependency>
294310

295311
<dependency>
312+
<!-- Used for (currently manual) code generation from xml schema files. -->
296313
<groupId>org.glassfish.jaxb</groupId>
297314
<artifactId>jaxb-runtime</artifactId>
298315
<version>4.0.4</version>
316+
<scope>compile</scope>
299317
</dependency>
300318

301319
<dependency>
302320
<groupId>org.hsqldb</groupId>
303321
<artifactId>hsqldb</artifactId>
304322
<version>2.7.2</version>
323+
<scope>test</scope>
305324
</dependency>
306325

307326
<dependency>
@@ -319,6 +338,13 @@
319338
</dependency>
320339

321340
<dependency>
341+
<groupId>org.codehaus.janino</groupId>
342+
<artifactId>commons-compiler</artifactId>
343+
<version>3.1.11</version>
344+
</dependency>
345+
346+
<dependency>
347+
<!-- Used by the templated benchmark for internal compiling proceedures. -->
322348
<groupId>org.codehaus.janino</groupId>
323349
<artifactId>janino</artifactId>
324350
<version>3.1.11</version>
@@ -365,6 +391,21 @@
365391
</compilerArgs>
366392
</configuration>
367393
</plugin>
394+
<!-- TODO: Use PMD to check for various code health things.plugin>
395+
Invoked with `mvn pmd:check` or `mvn verify`
396+
<plugin>
397+
<groupId>org.apache.maven.plugins</groupId>
398+
<artifactId>maven-pmd-plugin</artifactId>
399+
<version>3.21.2</version>
400+
<configuration>
401+
<excludeRoots>
402+
<excludeRoot>target/generated-sources</excludeRoot>
403+
<excludeRoot>target/generated-test-sources</excludeRoot>
404+
</excludeRoots>
405+
<linkXRef>true</linkXRef>
406+
</configuration>
407+
</plugin>
408+
-->
368409
<plugin>
369410
<groupId>org.apache.maven.plugins</groupId>
370411
<artifactId>maven-jar-plugin</artifactId>
@@ -461,7 +502,30 @@
461502
<goal>analyze-only</goal>
462503
</goals>
463504
<configuration>
464-
<failOnWarning>false</failOnWarning>
505+
<failOnWarning>true</failOnWarning>
506+
507+
<ignoredUnusedDeclaredDependencies>
508+
<!-- Used for (currently manual) code generation from xml schema files. -->
509+
<ignoredUnusedDeclaredDependency>org.glassfish.jaxb:jaxb-runtime:jar</ignoredUnusedDeclaredDependency>
510+
<!-- Drop-in replacement of log4j -->
511+
<ignoredUnusedDeclaredDependency>org.slf4j:slf4j-reload4j:jar</ignoredUnusedDeclaredDependency>
512+
<!-- Used by the templated benchmark for internal compiling proceedures. -->
513+
<ignoredUnusedDeclaredDependency>org.codehaus.janino:janino:jar</ignoredUnusedDeclaredDependency>
514+
<!-- Used by the templated benchmark. -->
515+
<ignoredUnusedDeclaredDependency>commons-jxpath:commons-jxpath:jar</ignoredUnusedDeclaredDependency>
516+
517+
<!--
518+
Need to ignore the following profile specific dependencies since they're runtime only.
519+
-->
520+
<ignoredUnusedDeclaredDependency>org.postgresql:postgresql:jar</ignoredUnusedDeclaredDependency>
521+
<ignoredUnusedDeclaredDependency>mysql:mysql-connector-java:jar</ignoredUnusedDeclaredDependency>
522+
<ignoredUnusedDeclaredDependency>com.oracle.database.jdbc:ojdbc11:jar</ignoredUnusedDeclaredDependency>
523+
<ignoredUnusedDeclaredDependency>org.mariadb.jdbc:mariadb-java-client:jar</ignoredUnusedDeclaredDependency>
524+
<ignoredUnusedDeclaredDependency>com.google.cloud:google-cloud-spanner-jdbc:jar</ignoredUnusedDeclaredDependency>
525+
<ignoredUnusedDeclaredDependency>org.apache.phoenix:phoenix-client-hbase-2.4:jar</ignoredUnusedDeclaredDependency>
526+
<ignoredUnusedDeclaredDependency>com.microsoft.sqlserver:mssql-jdbc:jar</ignoredUnusedDeclaredDependency>
527+
<ignoredUnusedDeclaredDependency>org.xerial:sqlite-jdbc:jar</ignoredUnusedDeclaredDependency>
528+
</ignoredUnusedDeclaredDependencies>
465529
</configuration>
466530
</execution>
467531
</executions>
@@ -476,5 +540,4 @@
476540
</plugin>
477541
</plugins>
478542
</build>
479-
480543
</project>

0 commit comments

Comments
 (0)