Commit 374c59c5 authored by João Lino's avatar João Lino

Initial commit.

parents
##LDE specific
.project
*.iml
*.idea
<?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>
<groupId>org.example</groupId>
<artifactId>demo-spring-microservice-profile</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Demo Spring Microservice Profile</name>
<description>Microservice managing Profile entities.</description>
<organization>
<name>João Lino</name>
<url>https://www.joaolino.com</url>
</organization>
<scm>
<connection>scm:git:https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile.git</connection>
<developerConnection>scm:git:https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile.git</developerConnection>
<url>scm:git:https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile.git</url>
</scm>
<issueManagement>
<system>GitLab</system>
<url>https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile/-/issues/</url>
</issueManagement>
<ciManagement>
<system>Jenkins</system>
<url>https://joaolino.com/jenkins/job/demo/job/demo%252Fdemo-spring-microservice-profile/</url>
</ciManagement>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>João Lino demo release repository</name>
<url>https://joaolino.com/nexus/content/repositories/releases/</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>João Lino demo snapshot repository</name>
<url>https://joaolino.com/nexus/content/repositories/snapshots/</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<properties>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<resource.delimiter>@</resource.delimiter>
<spring-boot.version>2.2.6.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<springdoc.version>1.2.25</springdoc.version>
<targetJdk>${java.version}</targetJdk>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc.version}</version>
</dependency>
<!-- Inclusion of common modules -->
<dependency>
<groupId>com.joaolino</groupId>
<artifactId>demo-spring-common-error</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.joaolino</groupId>
<artifactId>demo-spring-common-stream</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Others -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<!-- No common repositories should be defined in pom's. -->
<repositories />
<pluginRepositories />
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/application*.yml</include>
<include>**/application*.yaml</include>
<include>**/application*.properties</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/application*.yml</exclude>
<exclude>**/application*.yaml</exclude>
<exclude>**/application*.properties</exclude>
</excludes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<parameters>true</parameters>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<delimiters>
<delimiter>${resource.delimiter}</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>2.11.0</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Sorting properties is not dangerous. Sorting dependencies, plugins and modules might be. -->
<sortProperties>true</sortProperties>
<keepBlankLines>true</keepBlankLines>
<createBackupFile>false</createBackupFile>
<lineSeparator>\n</lineSeparator>
<expandEmptyElements>false</expandEmptyElements>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<!-- Dependency analysis to keep the dependency graph in check -->
<execution>
<id>look-for-unnecessary-or-unused-dependencies</id>
<goals>
<goal>analyze-only</goal>
</goals>
<configuration>
<failOnWarning>false</failOnWarning>
<!-- To keep out unwanted dependencies -->
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>com.google.code.findbugs:jsr305</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>javax.inject:javax.inject</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.gatling:gatling-commons</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.gatling:gatling-core</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.gatling:gatling-app</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.gatling:gatling-http</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.gatling:gatling-test-framework</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.gatling.highcharts:gatling-charts-highcharts</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>mysql:mysql-connector-java</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.activemq:activemq-openwire-legacy</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.logging.log4j:log4j-core</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.apache.logging.log4j:log4j-slf4j-impl</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.eclipse.jetty:jetty-util</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.eclipse.jetty:jetty-http</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish.hk2.external:javax.inject</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish.jersey.containers:jersey-container-jetty-http</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish.jersey.core:jersey-client</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish.jersey.ext:jersey-bean-validation</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.hibernate.validator:hibernate-validator</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>javax.el:javax.el-api</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish.jersey.inject:jersey-hk2</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.slf4j:slf4j-api</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>javax.servlet:javax.servlet-api</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<deployAtEnd>true</deployAtEnd>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<!-- Exclude test dependencies -->
<exclude>com.h2database</exclude>
<exclude>junit</exclude>
<exclude>org.mockito</exclude>
<!-- Exclude logback I use log4j2 -->
<exclude>ch.qos.logback</exclude>
<!-- Exclude libraries related to log4j1 -->
<exclude>log4j:log4j</exclude>
<exclude>org.slf4j:log4j-over-slf4j</exclude>
</excludes>
<includes>
<!--only test scoped versions test libraries are allowed -->
<include>com.h2database:*:*:jar:test</include>
<include>junit:*:*:jar:test</include>
<include>org.mockito:*:*:jar:test</include>
<include>io.gatling.*:*:*:jar:test</include>
</includes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
<execution>
<id>enforce-maven-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.0</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<!--suppress UnresolvedMavenProperty -->
<Implementation-Commit-Id>${git.commit.id}</Implementation-Commit-Id>
<!--suppress UnresolvedMavenProperty -->
<Implementation-Commit-Id-describe>${git.commit.id.describe}</Implementation-Commit-Id-describe>
<!--suppress UnresolvedMavenProperty -->
<Implementation-Git-Remote-Origin-Url>${git.remote.origin.url}</Implementation-Git-Remote-Origin-Url>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>create-test-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>javadoc</id>
<phase>process-sources</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
<configuration>
<failOnError>true</failOnError>
<quiet>true</quiet>
<charset>${project.reporting.outputEncoding}</charset>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<tagNameFormat>demo-spring-@{project.version}</tagNameFormat>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
</dependency>
</dependencies>
<configuration>
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables>
<log.dir>target/log</log.dir>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- Reporting plugins -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<!-- unit test coverage -->
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- integration test coverage -->
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<!-- merged coverage -->
<execution>
<id>default-merge</id>
<phase>verify</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration combine.children="append">
<destFile>${project.build.directory}/jacoco-merged.exec</destFile>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>*.exec</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-report-integration</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
<execution>
<id>merged-report</id>
<goals>
<goal>report</goal>
</goals>
<configuration combine.children="append">
<dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-merged</outputDirectory>
</configuration>
</execution>
<!-- coverage requirements -->
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration combine.children="append">
<dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
<haltOnFailure>true</haltOnFailure>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<!-- 85% coverage required -->
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>85%</minimum>
</limit>
<!-- no exceptions -->
<limit>
<counter>CLASS</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
</limits>
</rule>
<rule>
<element>BUNDLE</element>
<limits>
<!-- low Cyclomatic Complexity -->
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.69</minimum>
</limit>
</limits>
</rule>
<!-- branches rule not specified -->
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<!-- *NOTE*: The default phase of revision is initialize, but in case you want to
change it, you can do so by adding the phase here -->
</execution>
<execution>
<id>validate-the-git-infos</id>
<!-- *NOTE*: The default phase of validateRevision is verify, but in case you want to change it, you can do so by adding the phase here -->
<phase>package</phase>
<goals>
<goal>validateRevision</goal>
</goals>
</execution>
</executions>
<configuration>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<verbose>false</verbose>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<format>properties</format>
<skipPoms>true</skipPoms>
<injectAllReactorProjects>true</injectAllReactorProjects>
<failOnNoGitDirectory>true</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>
<skip>false</skip>
<runOnlyOnce>false</runOnlyOnce>
<includeOnlyProperties>
<includeOnlyProperty>^git.branch$</includeOnlyProperty>
<includeOnlyProperty>^git.build.host$</includeOnlyProperty>
<includeOnlyProperty>^git.build.time$</includeOnlyProperty>
<includeOnlyProperty>^git.build.user.email$</includeOnlyProperty>
<includeOnlyProperty>^git.build.user.name$</includeOnlyProperty>
<includeOnlyProperty>^git.build.version$</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.commit.count$</includeOnlyProperty>
<includeOnlyProperty>^git.closest.tag.name$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.describe$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.time$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.user.email$</includeOnlyProperty>
<includeOnlyProperty>^git.dirty$</includeOnlyProperty>
<includeOnlyProperty>^git.remote.origin.url$</includeOnlyProperty>
<includeOnlyProperty>^git.tags$</includeOnlyProperty>
</includeOnlyProperties>
<useNativeGit>false</useNativeGit>
<gitDescribe>
<skip>false</skip>
<always>false</always>
<abbrev>7</abbrev>
<dirty>-dirty</dirty>
<match>*</match>
<tags>false</tags>
<forceLongFormat>false</forceLongFormat>
</gitDescribe>
<evaluateOnCommit>HEAD</evaluateOnCommit>
</configuration>
</plugin>
<plugin>
<groupId>io.snyk</groupId>
<artifactId>snyk-maven-plugin</artifactId>
<version>1.2.6</version>
<configuration>
<failOnAuthError>true</failOnAuthError>
<!--suppress UnresolvedMavenProperty -->
<apiToken>${SNYK_TOKEN}</apiToken>
<failOnSeverity>false</failOnSeverity>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
</plugin>
<!-- The maven compiler is configured to enforce stricter rules than in the base-pom -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<parameters>true</parameters>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<parameters>true</parameters>
</configuration>
</execution>
</executions>
<configuration>
<parameters>true</parameters>
</configuration>
</plugin>
<!-- Dependency analysis to help minimize the dependency graph and shrink artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<!-- This option will help keep the build logs clean -->
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
<!--plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>remove-project-artifact</id>
<phase>pre-clean</phase>
<goals>
<goal>remove-project-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<configLocation>google_checks.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>javadoc</report>
<report>test-javadoc</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<failOnError>true</failOnError>
<quiet>true</quiet>
<charset>${project.reporting.outputEncoding}</charset>
<additionalJOption>-html5</additionalJOption>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.21.0</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<reportSets>
<reportSet>
<id>jacoco-merged</id>
<reports>
<report>report</report>
</reports>
<configuration>
<dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
<outputDirectory>jacoco-merged</outputDirectory>
</configuration>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.kuali.maven.plugins</groupId>
<artifactId>graph-maven-plugin</artifactId>
<version>1.2.3</version>
</plugin>
<!-- needs to be in place to demo security related stuff -->
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>1.4.3</version>
<reportSets>
<reportSet>
<reports>
<!-- aggregate reports to simplify analysis -->
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<failOnError>false</failOnError>
<!-- XML for sonar report integration to work -->
<format>ALL</format>
</configuration>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>snyk-dependency-tests</id>
<activation>
<property>
<name>snykTests</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.snyk</groupId>
<artifactId>snyk-maven-plugin</artifactId>
<executions>
<execution>
<id>snyk-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
<execution>
<id>snyk-monitor</id>
<phase>install</phase>
<goals>
<goal>monitor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
package com.joaolino.demo.spring.microservice.profile;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import java.util.ArrayList;
import java.util.List;
@ComponentScan(basePackages = "com.joaolino.demo.spring")
@SpringBootApplication(
exclude = {
MongoReactiveAutoConfiguration.class,
MongoDataAutoConfiguration.class,
MongoAutoConfiguration.class,
RabbitAutoConfiguration.class
})
@EnableDiscoveryClient
public class DemoSpringMicroserviceProfileApplication {
public static void main(final String[] args) {
SpringApplication.run(DemoSpringMicroserviceProfileApplication.class, args);
}
@Bean
public static OpenAPI customOpenAPI(@Value("${springdoc.external.server.uri}") final String uri) {
final List<Server> servers = new ArrayList<>();
servers.add(new Server().url(uri));
return new OpenAPI()
.info(
new Info()
.title("MVP Keystore")
.description(
"This is a Profile microservice. You can find out more about\n"
+ " the Profile microservice at [https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile/-/wikis/home](https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile/-/wikis/home).")
.termsOfService(
"https://www.joaolino.com/gitlab/demo/demo-spring-microservice-profile/-/wikis/home")
.contact(new Contact().email("joao.oliveira.lino@gmail.com"))
.license(new License().name("joaolino.com").url("https://joaolino.com/"))
.version("1.0.0"))
.externalDocs(
new ExternalDocumentation()
.description("Find out more about João Lino.")
.url("https://joaolino.com/"))
.servers(servers);
}
}
package com.joaolino.demo.spring.microservice.profile;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
@Component
public class DemoSpringMicroserviceProfileInitializer implements ApplicationRunner {
@Override
public void run(final ApplicationArguments args) {}
}
package com.joaolino.demo.spring.microservice.profile.data.model;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.*;
import java.util.Date;
/** This class stores audit information within entities */
@Data
@SuperBuilder
@NoArgsConstructor
public class AbstractAudit {
/** Version of the entry stored in the database */
@Version private Long version;
/** Date of creation of database entry */
@CreatedDate private Date createdAt;
/** Last date of modification in database */
@LastModifiedDate private Date modifiedAt;
/** Id of the user who created the entry */
@CreatedBy private String createdBy;
/** Id of the last user to modify the entry */
@LastModifiedBy private String lastModifiedBy;
/** FlowId which generated this entry */
private String flowId;
/** Session which generated this entry */
private String sessionId;
}
package com.joaolino.demo.spring.microservice.profile.data.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.Id;
import java.util.UUID;
/** This class stores identification information within entities */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class AbstractIdentification extends AbstractAudit {
/* A unique identifier of this model entity. */
@Id private final UUID id = null;
}
package com.joaolino.demo.spring.microservice.profile.data.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.mongodb.core.mapping.Document;
/** Represents a Profile. Contains all relevant information to define the profile of a person. */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Document
public class Profile extends AbstractIdentification {
/** The full name of the person. */
private final String fullName = null;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment