Skip to content
Snippets Groups Projects
Commit f0cef524 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-14 cleanup project setup

parent 359d2f16
Branches
Tags
No related merge requests found
......@@ -35,7 +35,7 @@
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<!--
<execution>
<id>test-application</id>
<phase>test</phase>
......@@ -51,7 +51,7 @@
<goal>exec</goal>
</goals>
</execution>
-->
<execution>
<id>build-application</id>
<phase>compile</phase>
......
......@@ -2,21 +2,22 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.itvsh.ozg</groupId>
<artifactId>goofy</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>goofy-server</artifactId>
<name>goofy-server</name>
<description>Goofy Server</description>
<name>goofy server</name>
<description>Projekt packaging deployment artefact</description>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<dependencies>
......@@ -24,40 +25,36 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>${spring.boot.version}</version>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- Util -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<!-- Lombok -->
<!-- Dev -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
......@@ -66,6 +63,16 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......@@ -74,6 +81,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
......@@ -95,6 +103,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.itvsh.goofy.GoofyServerApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package de.itvsh.goofy;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -15,7 +14,8 @@ public class EnvironmentController {
@Value("${goofy.production}")
private boolean production;
@CrossOrigin
//TODO klaeren, warum
// @CrossOrigin
@GetMapping
public FrontendEnvironment getFrontendEnvironment() {
return FrontendEnvironment.builder()//
......
logging:
level:
ROOT: WARN
de.itvsh: INFO
goofy:
production: false
\ No newline at end of file
package de.itvsh.goofy;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;
@SpringBootTest
@AutoConfigureMockMvc
class EnvironmentControllerITCase {
@Autowired
private MockMvc mockMvc;
@Test
void loadEnvironment() throws Exception {
mockMvc.perform(get("/api/environment")).andExpect(status().isOk());
}
@Test
void shouldHaveProductionFalse() throws Exception {
mockMvc.perform(get("/api/environment"))//
.andExpect(jsonPath("$.production").value(false));
}
}
......@@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class GoofyServerApplicationTests {
class GoofyServerApplicationTest {
@Test
void contextLoads() {
......
org.mockito.junit.jupiter.MockitoExtension
\ No newline at end of file
lombok.log.fieldName=LOG
lombok.log.slf4j.flagUsage = ERROR
lombok.log.log4j.flagUsage = ERROR
lombok.data.flagUsage = ERROR
lombok.nonNull.exceptionType = IllegalArgumentException
\ No newline at end of file
......@@ -12,21 +12,54 @@
<modules>
<module>goofy-client</module>
<module>goofy-server</module>
<module>goofy-api</module>
<module>goofy-service</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<java.version>15</java.version>
<!-- TODO use 2.4.0.RELEASE -->
<spring.boot.version>2.3.6.RELEASE</spring.boot.version>
<!-- plugins -->
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<resources.plugin.version>3.1.0</resources.plugin.version>
<spring.boot.version>2.3.5.RELEASE</spring.boot.version>
<commons-lang.version>3.9</commons-lang.version>
<lombok.version>1.18.16</lombok.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- own project -->
<dependency>
<groupId>de.itvsh.ozg</groupId>
<artifactId>goofy-server-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.itvsh.ozg</groupId>
<artifactId>goofy-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.itvsh.ozg</groupId>
<artifactId>goofy-server-base</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
......@@ -40,6 +73,39 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<argLine>
--illegal-access=permit
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<argLine>
--illegal-access=permit
</argLine>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment