PMT-14: Refactor Generator Config and Setup
All checks were successful
Quality Check / Validate OAS (push) Successful in 3m51s
Quality Check / Testing (push) Successful in 4m58s
Quality Check / Linting (push) Successful in 5m9s
Quality Check / Static Analysis (push) Successful in 5m10s

This commit is contained in:
Dominik Säume 2024-09-27 12:15:35 +02:00
parent 45d6b51967
commit 701c2b7cd3
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
8 changed files with 16 additions and 25 deletions

View file

@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot"> <configuration default="false" name="Run" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="Project_Management_Tool.main" /> <module name="Project_Management_Tool.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="de.hmmh.pmt.ProjectManagementToolApplication" /> <option name="SPRING_BOOT_MAIN_CLASS" value="de.hmmh.pmt.OpenAPISpringBoot" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
<option name="RunConfigurationTask" enabled="false" run_configuration_name="Postgres" run_configuration_type="docker-deploy" /> <option name="RunConfigurationTask" enabled="false" run_configuration_name="Postgres" run_configuration_type="docker-deploy" />

View file

@ -10,7 +10,7 @@ repositories {
plugins { plugins {
java java
checkstyle checkstyle
id("com.github.spotbugs") version "6.0.22" id("com.github.spotbugs") version "6.0.23"
id("org.springframework.boot") version "3.3.3" id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6" id("io.spring.dependency-management") version "1.1.6"
id("org.hidetake.swagger.generator") version "2.19.2" id("org.hidetake.swagger.generator") version "2.19.2"
@ -64,6 +64,7 @@ dependencies {
//OAS //OAS
swaggerCodegen("io.swagger.codegen.v3:swagger-codegen-cli:3.0.61") swaggerCodegen("io.swagger.codegen.v3:swagger-codegen-cli:3.0.61")
implementation("io.swagger.core.v3:swagger-annotations:2.2.22") implementation("io.swagger.core.v3:swagger-annotations:2.2.22")
implementation("jakarta.xml.bind:jakarta.xml.bind-api") //Needed for XML/HTML Validation
} }
swaggerSources { swaggerSources {
@ -73,7 +74,6 @@ swaggerSources {
val validationTask = validation val validationTask = validation
code(delegateClosureOf<GenerateSwaggerCode> { code(delegateClosureOf<GenerateSwaggerCode> {
language = "spring" language = "spring"
components = listOf("models", "apis")
code.rawOptions = code.rawOptions =
listOf("--ignore-file-override=" + file("${rootDir}/src/main/resources/.codegen-ignore").absolutePath) listOf("--ignore-file-override=" + file("${rootDir}/src/main/resources/.codegen-ignore").absolutePath)
dependsOn(validationTask) dependsOn(validationTask)
@ -90,6 +90,7 @@ tasks {
} }
} }
withType<SpotBugsTask> { withType<SpotBugsTask> {
excludeFilter.set(file("${rootDir}/src/main/resources/spotbugs-exclude.xml")) excludeFilter.set(file("${rootDir}/src/main/resources/spotbugs-exclude.xml"))
} }
processResources { processResources {

View file

@ -2,7 +2,7 @@ package de.hmmh.pmt;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import de.hmmh.pmt.oas.DefaultApi; import de.hmmh.pmt.oas.DefaultApi;
import de.hmmh.pmt.oas.models.HelloOut; import de.hmmh.pmt.dtos.HelloOut;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;

View file

@ -1,13 +0,0 @@
package de.hmmh.pmt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ProjectManagementToolApplication {
public static void main(String[] args) {
SpringApplication.run(ProjectManagementToolApplication.class, args);
}
}

View file

@ -1,2 +1,4 @@
**/*ApiController.java **/*ApiController.java
**/org/openapitools/configuration/ **/*application.properties
**/io/swagger/configuration/HomeController.java
**/io/swagger/configuration/SwaggerUiConfiguration.java

View file

@ -6,4 +6,5 @@
<suppressions> <suppressions>
<suppress files="[\\/]de[\\/]hmmh[\\/]pmt[\\/]oas" checks="."/> <suppress files="[\\/]de[\\/]hmmh[\\/]pmt[\\/]oas" checks="."/>
<suppress files="[\\/]de[\\/]hmmh[\\/]pmt[\\/]dtos" checks="."/>
</suppressions> </suppressions>

View file

@ -1,7 +1,7 @@
{ {
"modelPackage": "de.hmmh.pmt.oas.models", "modelPackage": "de.hmmh.pmt.dtos",
"apiPackage": "de.hmmh.pmt.oas", "apiPackage": "de.hmmh.pmt.oas",
"invokerPackage": "de.hmmh.pmt.oas", "invokerPackage": "de.hmmh.pmt",
"java8": false, "java8": false,
"java11": true, "java11": true,
"dateLibrary": "java11", "dateLibrary": "java11",

View file

@ -1,5 +1,5 @@
<FindBugsFilter> <FindBugsFilter xmlns="https://raw.githubusercontent.com/spotbugs/spotbugs/4.8.6/spotbugs/etc/findbugsfilter.xsd">
<Match> <Match>
<Package name="de.hmmh.pmt.oas"/> <Class name="de.hmmh.pmt.OpenAPISpringBoot$ExitException"/>
</Match> </Match>
</FindBugsFilter> </FindBugsFilter>