Skip to content

Commit

Permalink
implement springboot server with maven configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiastofte committed Nov 1, 2022
1 parent 0afc91e commit 06b95a7
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ image:
tasks:
- init: sdk use java 16.0.1.hs-adpt
command: cd script; mvn compile install
- init: sdk use java 16.0.1.hs-adpt
command: cd script; mvn clean install -DskipUiTests -DskipTests; cd springboot/server; mvn spring-boot:run

ports:
# used by virtual desktop and vnc, supports JavaFX
- port: 6080
- port: 8080

vscode:
extensions:
Expand Down
1 change: 1 addition & 0 deletions script/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<module>core/main</module>
<module>ui</module>
<module>data</module>
<module>springboot/server</module>
<module>report</module>
</modules>
</project>
1 change: 1 addition & 0 deletions script/springboot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# REST-API server med springboot
117 changes: 117 additions & 0 deletions script/springboot/server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>script-springboot.server</artifactId>

<parent>
<groupId>it1901</groupId>
<artifactId>script</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>it1901</groupId>
<artifactId>script-data</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
<!-- web-server-dependencies -->

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.4.4</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<version>2.4.4</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.4.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.13</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
@{jaCoCoArgLine} --add-opens warehouse.springboot.server/springboot.server=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<!-- Run the checkstyle code quality tool -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<!-- Run the spotbugs code quality tool -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>

<!-- Configure jacoco code coverage -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<propertyName>jaCoCoArgLine</propertyName>
</configuration>
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.4</version>
</plugin>
</plugins>
</build>
</project>
14 changes: 14 additions & 0 deletions script/springboot/server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module script.springboot.server {

requires spring.web;
requires spring.beans;
requires spring.boot;
requires spring.context;
requires spring.core;
requires spring.boot.autoconfigure;

requires script.core.main;
requires script.data;

opens springboot.server to spring.beans, spring.context, spring.web, spring.core;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.script.server;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ServerApplication {

public static void main(String[] args) {
SpringApplication.run(ServerApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
server.error.include-message=always

0 comments on commit 06b95a7

Please sign in to comment.