feat: add backend dockerfile and cloud native config
This commit is contained in:
+288
-2
@@ -31,8 +31,70 @@
|
||||
<!-- Properties -->
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<skip.integration.tests>true</skip.integration.tests>
|
||||
<skip.unit.tests>true</skip.unit.tests>
|
||||
<jacoco.skip>true</jacoco.skip>
|
||||
<checkstyle.skip>true</checkstyle.skip>
|
||||
<checkstyle.failsOnError>true</checkstyle.failsOnError>
|
||||
<checkstyle.includeTestSourceDirectory>true</checkstyle.includeTestSourceDirectory>
|
||||
<jacoco.output.data>${project.build.directory}/coverage-reports</jacoco.output.data>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
|
||||
</properties>
|
||||
|
||||
<!-- Profiles -->
|
||||
<profiles>
|
||||
<!-- All tests -->
|
||||
<profile>
|
||||
<id>tests</id>
|
||||
<properties>
|
||||
<build.profile.id>tests</build.profile.id>
|
||||
<skip.integration.tests>false</skip.integration.tests>
|
||||
<skip.unit.tests>false</skip.unit.tests>
|
||||
<jacoco.skip>false</jacoco.skip>
|
||||
<checkstyle.skip>false</checkstyle.skip>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<!-- Prod -->
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<build.profile.id>prod</build.profile.id>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<!-- Native -->
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<properties>
|
||||
<build.profile.id>native</build.profile.id>
|
||||
<skip.integration.tests>true</skip.integration.tests>
|
||||
<skip.unit.tests>true</skip.unit.tests>
|
||||
<jacoco.skip>true</jacoco.skip>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-native</id>
|
||||
<goals>
|
||||
<goal>compile-no-fork</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<!-- Dependencies -->
|
||||
<dependencies>
|
||||
|
||||
@@ -113,13 +175,11 @@
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>0.12.6</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>0.12.6</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -161,6 +221,232 @@
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>integration-tests</id>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<argLine>@{argLine} -Xmx1024m</argLine>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
<skipTests>${skip.integration.tests}</skipTests>
|
||||
<includes>
|
||||
<include>**/*IntegrationTest.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<configuration>
|
||||
<argLine>@{argLine} -Xmx1024m</argLine>
|
||||
<skipTests>${skip.unit.tests}</skipTests>
|
||||
<excludes>
|
||||
<exclude>**/*IntegrationTest.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.12</version>
|
||||
<configuration>
|
||||
<skip>${jacoco.skip}</skip>
|
||||
<excludes>
|
||||
<exclude>**/config/**</exclude>
|
||||
<exclude>**/dto/**</exclude>
|
||||
<exclude>**/entity/**</exclude>
|
||||
<exclude>**/exception/**</exclude>
|
||||
<exclude>**/filter/**</exclude>
|
||||
<exclude>**/interceptor/**</exclude>
|
||||
<exclude>**/response/**</exclude>
|
||||
<exclude>**/*$*Builder*</exclude>
|
||||
<exclude>**/RestExceptionEndpoint.*</exclude>
|
||||
<exclude>**/BackendStartApiApplication.*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pre-unit-test</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<destFile>${jacoco.output.data}/jacoco-ut.exec</destFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>post-unit-test</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<dataFile>${jacoco.output.data}/jacoco-ut.exec</dataFile>
|
||||
<outputDirectory>${jacoco.output.data}/jacoco-ut</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>pre-integration-test</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>prepare-agent-integration</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<destFile>${jacoco.output.data}/jacoco-it.exec</destFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>post-integration-test</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>report-integration</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<dataFile>${jacoco.output.data}/jacoco-it.exec</dataFile>
|
||||
<outputDirectory>${jacoco.output.data}/jacoco-it</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>merge-unit-and-integration</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>merge</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${jacoco.output.data}</directory>
|
||||
<includes>
|
||||
<include>*.exec</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<destFile>${project.build.directory}/jacoco.exec</destFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>merged-reports</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
|
||||
<outputDirectory>${jacoco.output.data}/merged-test-report</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>coverage-check</id>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<rules>
|
||||
<rule>
|
||||
<element>BUNDLE</element>
|
||||
<limits>
|
||||
<limit>
|
||||
<counter>LINE</counter>
|
||||
<value>COVEREDRATIO</value>
|
||||
<minimum>80%</minimum>
|
||||
</limit>
|
||||
</limits>
|
||||
</rule>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.10.0</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<doctitle>Javadoc Documentation for ${project.name} ${project.version}</doctitle>
|
||||
<windowtitle>${project.name} ${project.version}</windowtitle>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-cli</id>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<rules>
|
||||
<dependencyConvergence />
|
||||
<requireMavenVersion>
|
||||
<version>[3.2,)</version>
|
||||
<message>Invalid Maven version. It should be at least 3.2</message>
|
||||
</requireMavenVersion>
|
||||
<requireJavaVersion>
|
||||
<version>17</version>
|
||||
<message>Invalid Java Version. It should be at least 1.8</message>
|
||||
</requireJavaVersion>
|
||||
<requireNoRepositories>
|
||||
<allowedRepositories>
|
||||
<id>central</id>
|
||||
</allowedRepositories>
|
||||
<allowedPluginRepositories>
|
||||
<id>central</id>
|
||||
</allowedPluginRepositories>
|
||||
</requireNoRepositories>
|
||||
<requireReleaseDeps>
|
||||
<message>No Snapshots Allowed in releases!</message>
|
||||
<onlyWhenRelease>true</onlyWhenRelease>
|
||||
</requireReleaseDeps>
|
||||
<banDuplicatePomDependencyVersions/>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>10.18.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<skip>${checkstyle.skip}</skip>
|
||||
<failsOnError>${checkstyle.failsOnError}</failsOnError>
|
||||
<includeTestSourceDirectory>
|
||||
${checkstyle.includeTestSourceDirectory}
|
||||
</includeTestSourceDirectory>
|
||||
<configLocation>.mvn/google_checks.xml</configLocation>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<linkXRef>false</linkXRef>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>checkstyle</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user