mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 19:26:18 +00:00
[Java-client] Add maven-compiler-plugin in pom.xml and enable linter checks by default (#5866)
* Add maven-compiler-plugin plugin in Java pom.xml and enable linter checks by default * Add maven-compiler-plugin plugin in Java pom.xml and enable linter checks by default
This commit is contained in:
@@ -69,7 +69,7 @@ public class JSON {
|
|||||||
.registerTypeSelector({{classname}}.class, new TypeSelector() {
|
.registerTypeSelector({{classname}}.class, new TypeSelector() {
|
||||||
@Override
|
@Override
|
||||||
public Class getClassForElement(JsonElement readElement) {
|
public Class getClassForElement(JsonElement readElement) {
|
||||||
Map classByDiscriminatorValue = new HashMap();
|
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
|
||||||
{{#mappedModels}}
|
{{#mappedModels}}
|
||||||
classByDiscriminatorValue.put("{{mappingName}}".toUpperCase(Locale.ROOT), {{modelName}}.class);
|
classByDiscriminatorValue.put("{{mappingName}}".toUpperCase(Locale.ROOT), {{modelName}}.class);
|
||||||
{{/mappedModels}}
|
{{/mappedModels}}
|
||||||
|
|||||||
@@ -40,6 +40,19 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<fork>true</fork>
|
||||||
|
<meminitial>128m</meminitial>
|
||||||
|
<maxmem>512m</maxmem>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
|||||||
@@ -40,6 +40,20 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<fork>true</fork>
|
||||||
|
<meminitial>128m</meminitial>
|
||||||
|
<maxmem>512m</maxmem>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
|||||||
@@ -33,6 +33,20 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<fork>true</fork>
|
||||||
|
<meminitial>128m</meminitial>
|
||||||
|
<maxmem>512m</maxmem>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
|||||||
@@ -33,6 +33,19 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<fork>true</fork>
|
||||||
|
<meminitial>128m</meminitial>
|
||||||
|
<maxmem>512m</maxmem>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class JSON {
|
|||||||
.registerTypeSelector(Animal.class, new TypeSelector() {
|
.registerTypeSelector(Animal.class, new TypeSelector() {
|
||||||
@Override
|
@Override
|
||||||
public Class getClassForElement(JsonElement readElement) {
|
public Class getClassForElement(JsonElement readElement) {
|
||||||
Map classByDiscriminatorValue = new HashMap();
|
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
|
||||||
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
||||||
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
||||||
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
||||||
|
|||||||
@@ -33,6 +33,19 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<fork>true</fork>
|
||||||
|
<meminitial>128m</meminitial>
|
||||||
|
<maxmem>512m</maxmem>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class JSON {
|
|||||||
.registerTypeSelector(Animal.class, new TypeSelector() {
|
.registerTypeSelector(Animal.class, new TypeSelector() {
|
||||||
@Override
|
@Override
|
||||||
public Class getClassForElement(JsonElement readElement) {
|
public Class getClassForElement(JsonElement readElement) {
|
||||||
Map classByDiscriminatorValue = new HashMap();
|
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
|
||||||
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
||||||
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
||||||
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class JSON {
|
|||||||
.registerTypeSelector(Animal.class, new TypeSelector() {
|
.registerTypeSelector(Animal.class, new TypeSelector() {
|
||||||
@Override
|
@Override
|
||||||
public Class getClassForElement(JsonElement readElement) {
|
public Class getClassForElement(JsonElement readElement) {
|
||||||
Map classByDiscriminatorValue = new HashMap();
|
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
|
||||||
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
||||||
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
||||||
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user