Skip to content

Commit 738536e

Browse files
committed
Remove unused jackson-jaxrs-json-provider
Fix #27
1 parent e36daa2 commit 738536e

File tree

1 file changed

+28
-8
lines changed
  • openapi-client-maven-template

1 file changed

+28
-8
lines changed

openapi-client-maven-template/pom.xml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@
122122
<groupId>com.fasterxml.jackson.core</groupId>
123123
<artifactId>jackson-databind</artifactId>
124124
</dependency>
125-
<dependency>
126-
<groupId>com.fasterxml.jackson.jaxrs</groupId>
127-
<artifactId>jackson-jaxrs-json-provider</artifactId>
128-
</dependency>
129125
<dependency>
130126
<groupId>com.fasterxml.jackson.datatype</groupId>
131127
<artifactId>jackson-datatype-jsr310</artifactId>
@@ -285,7 +281,7 @@
285281
<profile>
286282
<id>openapi-generator</id>
287283
<properties>
288-
<basePackage>software.xdev.INSERT_NAME_HERE</basePackage>
284+
<componentName>INSERT_NAME_HERE</componentName>
289285

290286
<generatedDirRelative>src/generated/java</generatedDirRelative>
291287
<generatedDir>${project.basedir}/${generatedDirRelative}</generatedDir>
@@ -340,9 +336,9 @@
340336
<configOptions>
341337
<sourceFolder>${openApiRelativeGeneratorDir}</sourceFolder>
342338
<library>apache-httpclient</library>
343-
<apiPackage>${basePackage}.api</apiPackage>
344-
<modelPackage>${basePackage}.model</modelPackage>
345-
<invokerPackage>${basePackage}.client</invokerPackage>
339+
<apiPackage>software.xdev.${componentName}.api</apiPackage>
340+
<modelPackage>software.xdev.${componentName}.model</modelPackage>
341+
<invokerPackage>software.xdev.${componentName}.client</invokerPackage>
346342
<!-- Otherwise throw and catch everywhere -->
347343
<useRuntimeException>true</useRuntimeException>
348344
<!-- Some fields of API have been ignored because they are unused -->
@@ -383,6 +379,30 @@
383379
</execution>
384380
</executions>
385381
</plugin>
382+
<plugin>
383+
<groupId>io.github.floverfelt</groupId>
384+
<artifactId>find-and-replace-maven-plugin</artifactId>
385+
<version>1.1.0</version>
386+
<executions>
387+
<execution>
388+
<id>remove-unused-import-com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider</id>
389+
<phase>process-sources</phase>
390+
<goals>
391+
<goal>find-and-replace</goal>
392+
</goals>
393+
<configuration>
394+
<replacementType>file-contents</replacementType>
395+
<baseDir>${generatedDirRelative}/software/xdev/${componentName}/client/</baseDir>
396+
<fileMask>ApiClient.java</fileMask>
397+
<!-- @formatter:off DO NOT INTRODUCE LINE BREAK -->
398+
<findRegex>^(import com\.fasterxml\.jackson\.jaxrs\.json\.JacksonJsonProvider;)$</findRegex>
399+
<!-- Can't be removed as the plugin isn't supporting empty values -->
400+
<replaceValue>// $1</replaceValue>
401+
<!-- @formatter:on -->
402+
</configuration>
403+
</execution>
404+
</executions>
405+
</plugin>
386406
</plugins>
387407
</build>
388408
</profile>

0 commit comments

Comments
 (0)