diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2696fcc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM gradle:jdk11 AS build +COPY --chown=gradle:gradle . /home/gradle/src +WORKDIR /home/gradle/src +RUN gradle bootJar --no-daemon + +FROM openjdk:11-jre-slim +EXPOSE 8080 +RUN mkdir /app +COPY --from=build /home/gradle/src/build/libs/*.jar /app/gruppen2.jar +ENTRYPOINT ["java"] +CMD ["-jar", "/app/gruppen2.jar"] diff --git a/build.gradle b/build.gradle index 2c493be..df9564b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import com.github.spotbugs.SpotBugsTask + plugins { id 'org.springframework.boot' version '2.2.5.RELEASE' id 'io.spring.dependency-management' version '1.0.9.RELEASE' @@ -12,14 +14,10 @@ spotbugs{ toolVersion = '4.0.0-RC1' } -tasks.withType(com.github.spotbugs.SpotBugsTask) { +tasks.withType(SpotBugsTask) { reports { - html { - enabled = true - } - xml { - enabled = false - } + xml.enabled = false + html.enabled = true } } @@ -60,8 +58,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'mops:styleguide:2.0.0' - implementation 'org.keycloak:keycloak-spring-boot-starter:9.0.0' - implementation 'org.keycloak.bom:keycloak-adapter-bom:3.3.0.Final' + compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0' + compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'com.h2database:h2' @@ -70,8 +68,10 @@ dependencies { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } testImplementation 'org.springframework.security:spring-security-test' + compile('org.springframework.boot:spring-boot-starter-web') } test { useJUnitPlatform() } + diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 060f0ea..0e70ecf 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -238,12 +238,6 @@ - - - - - - getProducts(){ + List productList = new ArrayList<>(); + productList.add("Honey"); + productList.add("Almond"); + return productList; + } + @RequestMapping(value = "/products", method = RequestMethod.POST) + public String createProduct() { + return "Product is saved successfully"; + } +}