Merge pull request #16 from ddd-by-examples/tech/java10compatibility
compatibility with java 9 and java 10 alongside java 8
This commit is contained in:
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,13 +1,17 @@
|
||||
|
||||
## travis-ci
|
||||
!.travis.yml
|
||||
!.codecov.yml
|
||||
|
||||
## maven
|
||||
target/
|
||||
target-test/
|
||||
!.mvn
|
||||
|
||||
|
||||
## linux
|
||||
.*
|
||||
!.git*
|
||||
*~
|
||||
|
||||
|
||||
## windows
|
||||
@@ -20,7 +24,7 @@ Desktop.ini
|
||||
$RECYCLE.BIN/
|
||||
|
||||
|
||||
## osx
|
||||
## macOS
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
@@ -85,9 +89,9 @@ tramp
|
||||
*.un~
|
||||
Session.vim
|
||||
.netrwhist
|
||||
*~
|
||||
|
||||
build
|
||||
out/
|
||||
build/
|
||||
.gradle
|
||||
*.log
|
||||
out
|
||||
110
.mvn/wrapper/MavenWrapperDownloader.java
vendored
110
.mvn/wrapper/MavenWrapperDownloader.java
vendored
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL =
|
||||
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: : " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Binary file not shown.
1
.mvn/wrapper/maven-wrapper.properties
vendored
1
.mvn/wrapper/maven-wrapper.properties
vendored
@@ -1 +0,0 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
|
||||
@@ -1,7 +1,9 @@
|
||||
language: java
|
||||
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
- openjdk8
|
||||
- openjdk9
|
||||
- openjdk10
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
dependencies {
|
||||
compile("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-rest")
|
||||
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.5")
|
||||
compile("org.liquibase:liquibase-core:3.5.5")
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-rest")
|
||||
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6")
|
||||
compile("com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6")
|
||||
compile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6")
|
||||
compile("org.liquibase:liquibase-core:3.6.1")
|
||||
compile("javax.xml.bind:jaxb-api:2.3.0")
|
||||
runtime("org.postgresql:postgresql:42.2.2")
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
}
|
||||
@@ -1,206 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.8.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.liquibase</groupId>
|
||||
<artifactId>liquibase-core</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -1,11 +1,14 @@
|
||||
package io.dddbyexamples.tools;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
|
||||
|
||||
import javax.persistence.AttributeConverter;
|
||||
import java.io.IOException;
|
||||
@@ -20,6 +23,8 @@ public abstract class JsonConverter<T> implements AttributeConverter<T, String>
|
||||
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||
.enable(SerializationFeature.WRITE_DATES_WITH_ZONE_ID)
|
||||
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
|
||||
.registerModule(new ParameterNamesModule(JsonCreator.Mode.PROPERTIES))
|
||||
.registerModule(new Jdk8Module())
|
||||
.registerModule(new JavaTimeModule());
|
||||
|
||||
private final Class<T> type;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package io.dddbyexamples.tools;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@SpringBootTest
|
||||
@ActiveProfiles
|
||||
public @interface IntegrationTest {
|
||||
@AliasFor(annotation = ActiveProfiles.class, attribute = "profiles") String[] activeProfiles() default {"test"};
|
||||
}
|
||||
@@ -1,45 +1,38 @@
|
||||
apply plugin: 'groovy'
|
||||
|
||||
dependencies {
|
||||
compile(project(":demand-forecasting-adapters"))
|
||||
compile(project(":shortages-prediction-adapters"))
|
||||
compile(project(":product-management-adapters"))
|
||||
compile(project(":production-planning-adapters"))
|
||||
compile(project(":adapter-commons"))
|
||||
compile(project(":demand-forecasting-adapters"))
|
||||
compile(project(":shortages-prediction-adapters"))
|
||||
compile(project(":product-management-adapters"))
|
||||
compile(project(":production-planning-adapters"))
|
||||
compile(project(":adapter-commons"))
|
||||
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
compile("org.springframework.boot:spring-boot-starter-web")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-rest")
|
||||
compile("org.springframework.data:spring-data-rest-hal-browser")
|
||||
compile("org.springframework.boot:spring-boot-starter-cloud-connectors")
|
||||
compile("org.liquibase:liquibase-core:3.5.5")
|
||||
compile("net.bytebuddy:byte-buddy:1.7.9")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
compile("org.springframework.boot:spring-boot-starter-web")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-rest")
|
||||
compile("org.springframework.data:spring-data-rest-hal-browser")
|
||||
compile("org.springframework.boot:spring-boot-starter-cloud-connectors")
|
||||
|
||||
runtime("org.cloudfoundry:auto-reconfiguration:1.12.0.RELEASE")
|
||||
runtime("org.postgresql:postgresql:42.1.4")
|
||||
runtime("org.cloudfoundry:auto-reconfiguration:1.12.0.RELEASE")
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
testCompile("org.spockframework:spock-spring:1.1-groovy-2.4")
|
||||
testCompile("com.h2database:h2:1.4.194")
|
||||
// TODO: Because of this there's no up to date check from Gradle
|
||||
testCompile(project(":adapter-commons").sourceSets.test.output)
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
testCompile("org.spockframework:spock-spring:1.1-groovy-2.4")
|
||||
testCompile("com.h2database:h2:1.4.197")
|
||||
}
|
||||
|
||||
[bootJar, bootRun]*.enabled = true
|
||||
jar.enabled = false
|
||||
|
||||
task stubsJar(type: Jar) {
|
||||
classifier = "stubs"
|
||||
into("META-INF/${project.rootProject.ext.projectGroupId}/${project.rootProject.ext.projectArtifactId}/${project.rootProject.ext.projectVersion}/shortages-prediction-adapters/mappings") {
|
||||
include('**/*.*')
|
||||
from(project(":shortages-prediction-adapters").projectDir.absolutePath + "/target/generated-snippets/stubs")
|
||||
}
|
||||
into("META-INF/${project.rootProject.ext.projectGroupId}/${project.rootProject.ext.projectArtifactId}/${project.rootProject.ext.projectVersion}/shortages-prediction-adapters/contracts") {
|
||||
include('**/*.groovy')
|
||||
from(project(":shortages-prediction-adapters").projectDir.absolutePath + "/target/generated-snippets/contracts")
|
||||
}
|
||||
classifier = "stubs"
|
||||
into("META-INF/${project.rootProject.ext.projectGroupId}/${project.rootProject.ext.projectArtifactId}/${project.rootProject.ext.projectVersion}/shortages-prediction-adapters/mappings") {
|
||||
include('**/*.*')
|
||||
from(project(":shortages-prediction-adapters").projectDir.absolutePath + "/target/generated-snippets/stubs")
|
||||
}
|
||||
into("META-INF/${project.rootProject.ext.projectGroupId}/${project.rootProject.ext.projectArtifactId}/${project.rootProject.ext.projectVersion}/shortages-prediction-adapters/contracts") {
|
||||
include('**/*.groovy')
|
||||
from(project(":shortages-prediction-adapters").projectDir.absolutePath + "/target/generated-snippets/contracts")
|
||||
}
|
||||
}
|
||||
|
||||
// we need the tests to pass to build the stub jar
|
||||
@@ -47,16 +40,16 @@ stubsJar.dependsOn(test)
|
||||
stubsJar.dependsOn(project(":shortages-prediction-adapters").test)
|
||||
|
||||
artifacts {
|
||||
archives stubsJar
|
||||
archives stubsJar
|
||||
}
|
||||
|
||||
jar.dependsOn(stubsJar)
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId project.name
|
||||
artifact stubsJar
|
||||
}
|
||||
}
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId project.name
|
||||
artifact stubsJar
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,346 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>app-monolith</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>demand-forecasting-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shortages-prediction-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>product-management-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>production-planning-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-rest-hal-browser</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.1.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.cloudfoundry</groupId>
|
||||
<artifactId>auto-reconfiguration</artifactId>
|
||||
<version>1.12.0.RELEASE</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cloud-connectors</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.liquibase</groupId>
|
||||
<artifactId>liquibase-core</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.194</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>app</finalName>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>stub</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<inherited>false</inherited>
|
||||
<configuration>
|
||||
<attach>true</attach>
|
||||
<descriptors>
|
||||
${basedir}/src/assembly/stub.xml
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -1,5 +1,10 @@
|
||||
package io.dddbyexamples.factory.integration
|
||||
|
||||
import io.dddbyexamples.factory.AppConfiguration
|
||||
import io.dddbyexamples.factory.ProductTrait
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.DocumentEntity
|
||||
import io.dddbyexamples.factory.demand.forecasting.projection.CurrentDemandEntity
|
||||
import io.dddbyexamples.factory.product.management.ProductDescriptionEntity
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
||||
@@ -9,12 +14,7 @@ import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.hateoas.Resources
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.ResponseEntity
|
||||
import io.dddbyexamples.factory.AppConfiguration
|
||||
import io.dddbyexamples.factory.ProductTrait
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.DocumentEntity
|
||||
import io.dddbyexamples.factory.demand.forecasting.projection.CurrentDemandEntity
|
||||
import io.dddbyexamples.factory.product.management.ProductDescriptionEntity
|
||||
import io.dddbyexamples.tools.IntegrationTest
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import spock.lang.Specification
|
||||
|
||||
import java.time.Clock
|
||||
@@ -24,28 +24,29 @@ import static java.time.Instant.from
|
||||
import static java.time.ZoneId.systemDefault
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT
|
||||
|
||||
@IntegrationTest
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(webEnvironment = RANDOM_PORT, classes = [AppConfiguration, TestConfiguration])
|
||||
class CallOffDocumentIntegrationSpec extends Specification implements ProductTrait {
|
||||
|
||||
public static final String PRODUCT_REF_NO = "3009000"
|
||||
public static final LocalDate ANY_DATE = LocalDate.now()
|
||||
|
||||
@Autowired TestRestTemplate restTemplate
|
||||
@Autowired
|
||||
TestRestTemplate restTemplate
|
||||
|
||||
def 'receiving call off document should create new product demands for subsequent days'() {
|
||||
given:
|
||||
productDescriptionIsSuccessfullyCreated(PRODUCT_REF_NO)
|
||||
productDescriptionIsSuccessfullyCreated(PRODUCT_REF_NO)
|
||||
when:
|
||||
callOffDocumentIsSuccessfullyRequested(PRODUCT_REF_NO, ANY_DATE, 100, 200, 300)
|
||||
callOffDocumentIsSuccessfullyRequested(PRODUCT_REF_NO, ANY_DATE, 100, 200, 300)
|
||||
and:
|
||||
Collection<CurrentDemandEntity> demands =
|
||||
demandsForProductStartingFromDateAreRequested(PRODUCT_REF_NO, ANY_DATE.minusDays(1))
|
||||
Collection<CurrentDemandEntity> demands =
|
||||
demandsForProductStartingFromDateAreRequested(PRODUCT_REF_NO, ANY_DATE.minusDays(1))
|
||||
then:
|
||||
demands.size() == 3
|
||||
thereIsDemand(demands, ANY_DATE, 100)
|
||||
thereIsDemand(demands, ANY_DATE.plusDays(1), 200)
|
||||
thereIsDemand(demands, ANY_DATE.plusDays(2), 300)
|
||||
demands.size() == 3
|
||||
thereIsDemand(demands, ANY_DATE, 100)
|
||||
thereIsDemand(demands, ANY_DATE.plusDays(1), 200)
|
||||
thereIsDemand(demands, ANY_DATE.plusDays(2), 300)
|
||||
}
|
||||
|
||||
void productDescriptionIsSuccessfullyCreated(String refNo) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.context.annotation.Profile
|
||||
import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.hateoas.Resources
|
||||
import org.springframework.http.HttpMethod
|
||||
@@ -17,7 +18,7 @@ import io.dddbyexamples.factory.demand.forecasting.command.DemandAdjustmentEntit
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.DocumentEntity
|
||||
import io.dddbyexamples.factory.demand.forecasting.projection.CurrentDemandEntity
|
||||
import io.dddbyexamples.factory.product.management.ProductDescriptionEntity
|
||||
import io.dddbyexamples.tools.IntegrationTest
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import spock.lang.Specification
|
||||
|
||||
import java.time.Clock
|
||||
@@ -27,7 +28,7 @@ import static java.time.Instant.from
|
||||
import static java.time.ZoneId.systemDefault
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT
|
||||
|
||||
@IntegrationTest
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(webEnvironment = RANDOM_PORT, classes = [AppConfiguration, TestConfiguration])
|
||||
class DemandAdjustmentIntegrationSpec extends Specification implements ProductTrait {
|
||||
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
package io.dddbyexamples.factory.integration
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.hateoas.Resource
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.ResponseEntity
|
||||
import io.dddbyexamples.factory.AppConfiguration
|
||||
import io.dddbyexamples.factory.ProductTrait
|
||||
import io.dddbyexamples.factory.demand.forecasting.Adjustment
|
||||
@@ -19,7 +10,16 @@ import io.dddbyexamples.factory.product.management.ProductDescriptionEntity
|
||||
import io.dddbyexamples.factory.shortages.prediction.calculation.Stock
|
||||
import io.dddbyexamples.factory.shortages.prediction.monitoring.persistence.ShortagesEntity
|
||||
import io.dddbyexamples.factory.warehouse.WarehouseService
|
||||
import io.dddbyexamples.tools.IntegrationTest
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.hateoas.Resource
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import spock.lang.Specification
|
||||
|
||||
import java.time.Clock
|
||||
@@ -29,7 +29,7 @@ import static java.time.Instant.from
|
||||
import static java.time.ZoneId.systemDefault
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT
|
||||
|
||||
@IntegrationTest
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(webEnvironment = RANDOM_PORT, classes = [AppConfiguration, TestConfiguration])
|
||||
class ShortageIntegrationSpec extends Specification implements ProductTrait {
|
||||
|
||||
@@ -37,17 +37,18 @@ class ShortageIntegrationSpec extends Specification implements ProductTrait {
|
||||
public static final LocalDate ANY_DATE = LocalDate.now()
|
||||
public static final int PRODUCT_STOCK_LEVEL = 100
|
||||
|
||||
@Autowired TestRestTemplate restTemplate
|
||||
@Autowired
|
||||
TestRestTemplate restTemplate
|
||||
|
||||
def 'adjustment that exceeds current stock level should result in shortage'() {
|
||||
given:
|
||||
productDescriptionIsSuccessfullyCreated(PRODUCT_REF_NO)
|
||||
productDescriptionIsSuccessfullyCreated(PRODUCT_REF_NO)
|
||||
when:
|
||||
callOffDocumentIsSuccessfullyRequested(PRODUCT_REF_NO, ANY_DATE, PRODUCT_STOCK_LEVEL)
|
||||
callOffDocumentIsSuccessfullyRequested(PRODUCT_REF_NO, ANY_DATE, PRODUCT_STOCK_LEVEL)
|
||||
and:
|
||||
adjustmentIsSuccessfullyRequested(ANY_DATE.plusDays(1), 200)
|
||||
adjustmentIsSuccessfullyRequested(ANY_DATE.plusDays(1), 200)
|
||||
then:
|
||||
thereIsShortage(PRODUCT_REF_NO, ANY_DATE.plusDays(1), 200)
|
||||
thereIsShortage(PRODUCT_REF_NO, ANY_DATE.plusDays(1), 200)
|
||||
|
||||
}
|
||||
|
||||
|
||||
151
build.gradle
151
build.gradle
@@ -1,94 +1,105 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url "http://repo.spring.io/snapshot" }
|
||||
maven { url "http://repo.spring.io/milestone" }
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE"
|
||||
// TODO: Snapshots are used only for testing purposes
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:2.0.0.BUILD-SNAPSHOT"
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url "http://repo.spring.io/snapshot" }
|
||||
maven { url "http://repo.spring.io/milestone" }
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.2.RELEASE"
|
||||
// TODO: Snapshots are used only for testing purposes
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:2.0.0.BUILD-SNAPSHOT"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
group = 'pl.com.dddbyexamples'
|
||||
version = getProp('newVersion') ?: '1.0-SNAPSHOT'
|
||||
group = 'pl.com.dddbyexamples'
|
||||
version = getProp('newVersion') ?: '1.0-SNAPSHOT'
|
||||
|
||||
apply from: project.rootDir.absolutePath + '/gradle/pipeline.gradle'
|
||||
apply from: project.rootDir.absolutePath + '/gradle/pipeline.gradle'
|
||||
|
||||
bootJar.enabled = false
|
||||
jar.enabled = true
|
||||
bootRun.enabled = false
|
||||
bootJar.enabled = false
|
||||
jar.enabled = true
|
||||
bootRun.enabled = false
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${BOM_VERSION}"
|
||||
}
|
||||
}
|
||||
compileJava.options.compilerArgs << '-parameters'
|
||||
compileTestJava.options.compilerArgs << '-parameters'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
if (getProp("M2_LOCAL")) {
|
||||
maven {
|
||||
url getProp("M2_LOCAL")
|
||||
}
|
||||
}
|
||||
maven { url "http://repo.spring.io/snapshot" }
|
||||
maven { url "http://repo.spring.io/milestone" }
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
compileOnly('org.projectlombok:lombok:1.18.0')
|
||||
annotationProcessor('org.projectlombok:lombok:1.18.0')
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url getProp('REPO_WITH_BINARIES_FOR_UPLOAD') ?:
|
||||
getProp('REPO_WITH_BINARIES') ?: 'http://localhost:8081/artifactory/libs-release-local'
|
||||
credentials {
|
||||
username getProp('M2_SETTINGS_REPO_USERNAME') ?: 'admin'
|
||||
password getProp('M2_SETTINGS_REPO_PASSWORD') ?: 'password'
|
||||
}
|
||||
}
|
||||
}
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId project.name
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
testCompile("net.bytebuddy:byte-buddy:1.8.12")
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
testLogging {
|
||||
events "started", "passed", "skipped", "failed"
|
||||
}
|
||||
}
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${BOM_VERSION}"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
if (getProp("M2_LOCAL")) {
|
||||
maven {
|
||||
url getProp("M2_LOCAL")
|
||||
}
|
||||
}
|
||||
maven { url "http://repo.spring.io/snapshot" }
|
||||
maven { url "http://repo.spring.io/milestone" }
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url getProp('REPO_WITH_BINARIES_FOR_UPLOAD') ?:
|
||||
getProp('REPO_WITH_BINARIES') ?: 'http://localhost:8081/artifactory/libs-release-local'
|
||||
credentials {
|
||||
username getProp('M2_SETTINGS_REPO_USERNAME') ?: 'admin'
|
||||
password getProp('M2_SETTINGS_REPO_PASSWORD') ?: 'password'
|
||||
}
|
||||
}
|
||||
}
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId project.name
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
testLogging {
|
||||
events "started", "passed", "skipped", "failed"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
projectGroupId = project.group
|
||||
// In a multi-module env we can specify which project is the one that produces the fat-jar
|
||||
projectArtifactId = "app-monolith"
|
||||
projectVersion = project.version
|
||||
projectGroupId = project.group
|
||||
// In a multi-module env we can specify which project is the one that produces the fat-jar
|
||||
projectArtifactId = "app-monolith"
|
||||
projectVersion = project.version
|
||||
}
|
||||
|
||||
apply plugin: "java"
|
||||
[bootJar, bootRun]*.enabled = false
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '4.8'
|
||||
gradleVersion = '4.8'
|
||||
}
|
||||
|
||||
String getProp(String propName) {
|
||||
return hasProperty(propName) ?
|
||||
(getProperty(propName) ?: System.properties[propName]) : System.properties[propName] ?:
|
||||
System.getenv(propName)
|
||||
return hasProperty(propName) ?
|
||||
(getProperty(propName) ?: System.properties[propName]) : System.properties[propName] ?:
|
||||
System.getenv(propName)
|
||||
}
|
||||
@@ -4,13 +4,7 @@ dependencies {
|
||||
compile(project(":demand-forecasting-model"))
|
||||
compile(project(":adapter-commons"))
|
||||
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
|
||||
runtime("org.postgresql:postgresql:42.1.4")
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
testCompile("org.spockframework:spock-spring:1.1-groovy-2.4")
|
||||
testCompile("com.h2database:h2:1.4.194")
|
||||
testCompile(project(":adapter-commons").sourceSets.test.output)
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>demand-forecasting-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>demand-forecasting-model</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.1.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.7.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.dddbyexamples.factory.delivery.planning;
|
||||
|
||||
import io.dddbyexamples.factory.delivery.planning.definition.DeliveryPlannerDefinition;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import io.dddbyexamples.factory.delivery.planning.definition.DeliveryPlannerDefinitionDao;
|
||||
@@ -17,6 +18,7 @@ public class DeliveryAutoPlannerORMRepository {
|
||||
return new DeliveryAutoPlanner(refNo,
|
||||
dao.findById(refNo)
|
||||
.map(DeliveryPlannerDefinitionEntity::getDefinition)
|
||||
.filter(def -> !def.isDisabled())
|
||||
.map(x -> x.map(DeliveriesSuggestion::timesAndFractions))
|
||||
.orElse(Collections.emptyMap()));
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.stream.Collectors;
|
||||
public class DeliveryPlannerDefinition {
|
||||
@Singular
|
||||
private final Map<Demand.Schema, Map<LocalTime, Double>> definitions;
|
||||
private final boolean disabled;
|
||||
|
||||
public static Map<LocalTime, Double> of(LocalTime time, Double fraction) {
|
||||
return Collections.singletonMap(time, fraction);
|
||||
|
||||
@@ -5,12 +5,15 @@ import org.springframework.boot.test.context.SpringBootTest
|
||||
import io.dddbyexamples.factory.delivery.planning.definition.DeliveryPlannerDefinition
|
||||
import io.dddbyexamples.factory.delivery.planning.definition.DeliveryPlannerDefinitionDao
|
||||
import io.dddbyexamples.factory.delivery.planning.definition.DeliveryPlannerDefinitionEntity
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import org.springframework.test.context.TestPropertySource
|
||||
import spock.lang.Specification
|
||||
|
||||
import static java.time.LocalTime.of as time
|
||||
import static io.dddbyexamples.factory.delivery.planning.definition.DeliveryPlannerDefinition.of
|
||||
import static io.dddbyexamples.factory.demand.forecasting.Demand.Schema.*
|
||||
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest
|
||||
class DeliveryPlannerDefinitionSpec extends Specification {
|
||||
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
package io.dddbyexamples.factory.demand.forecasting
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.test.annotation.Commit
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.DemandDao
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.DemandEntity
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.ProductDemandDao
|
||||
import io.dddbyexamples.factory.demand.forecasting.persistence.ProductDemandEntity
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import spock.lang.Specification
|
||||
|
||||
import javax.persistence.EntityManager
|
||||
import javax.transaction.Transactional
|
||||
import java.time.Clock
|
||||
import java.time.Instant
|
||||
import java.time.LocalDate
|
||||
import java.time.ZoneId
|
||||
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
@Commit
|
||||
@ActiveProfiles("test")
|
||||
@DataJpaTest
|
||||
class ProductDemandORMRepositorySpec extends Specification {
|
||||
|
||||
def clock = Clock.fixed(Instant.now(), ZoneId.systemDefault())
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: "jacoco"
|
||||
|
||||
dependencies {
|
||||
compile(project(":shared-kernel-model"))
|
||||
compile(project(":adapter-commons"))
|
||||
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
}
|
||||
@@ -1,236 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>demand-forecasting-model</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shared-kernel-model</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<compilerArgument>-parameters</compilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -12,14 +12,6 @@ class DemandsFake extends Demands {
|
||||
fetch = { date -> nothingDemanded(date) }
|
||||
}
|
||||
|
||||
DailyDemand nothingDemanded(LocalDate date) {
|
||||
def demand = builder.reset()
|
||||
.date(date)
|
||||
.build()
|
||||
fetched.put(date, demand)
|
||||
demand
|
||||
}
|
||||
|
||||
DailyDemand demanded(LocalDate date, long level) {
|
||||
def demand = builder.date(date)
|
||||
.demandedLevels(level)
|
||||
@@ -48,4 +40,11 @@ class DemandsFake extends Demands {
|
||||
fetched.put(date, demand)
|
||||
demand
|
||||
}
|
||||
|
||||
private DailyDemand nothingDemanded(LocalDate date) {
|
||||
def demand = builder.reset()
|
||||
.date(date)
|
||||
.build()
|
||||
demand
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
config.stopBubbling=true
|
||||
lombok.addLombokGeneratedAnnotation=true
|
||||
#lombok.anyConstructor.addConstructorProperties=true
|
||||
|
||||
286
mvnw
vendored
286
mvnw
vendored
@@ -1,286 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven2 Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
# TODO classpath?
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
wget "$jarUrl" -O "$wrapperJarPath"
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
curl -o "$wrapperJarPath" "$jarUrl"
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
161
mvnw.cmd
vendored
161
mvnw.cmd
vendored
@@ -1,161 +0,0 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven2 Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
|
||||
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
echo Found %WRAPPER_JAR%
|
||||
) else (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
48
pom.xml
48
pom.xml
@@ -1,48 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>factory</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<modules>
|
||||
<module>app-monolith</module>
|
||||
<module>adapter-commons</module>
|
||||
<module>shared-kernel-model</module>
|
||||
<module>demand-forecasting-model</module>
|
||||
<module>demand-forecasting-adapters</module>
|
||||
<module>shortages-prediction-model</module>
|
||||
<module>shortages-prediction-adapters</module>
|
||||
<module>product-management-adapters</module>
|
||||
<module>production-planning-adapters</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<main.basedir>${project.basedir}</main.basedir>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
</project>
|
||||
@@ -3,14 +3,7 @@ apply plugin: 'groovy'
|
||||
dependencies {
|
||||
compile(project(":adapter-commons"))
|
||||
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
compile("net.bytebuddy:byte-buddy:1.7.9")
|
||||
|
||||
runtime("org.postgresql:postgresql:42.1.4")
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
testCompile("org.spockframework:spock-spring:1.1-groovy-2.4")
|
||||
testCompile("com.h2database:h2:1.4.194")
|
||||
testCompile(project(":adapter-commons").sourceSets.test.output)
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>product-management-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.1.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.dddbyexamples.factory.product.management
|
||||
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import spock.lang.Ignore
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
@@ -8,9 +9,8 @@ import spock.lang.Specification
|
||||
|
||||
import static java.util.Collections.singletonList
|
||||
|
||||
// TODO: Unignore
|
||||
@Ignore
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("test")
|
||||
class ProductDescriptionPersistenceSpec extends Specification {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -3,14 +3,7 @@ apply plugin: 'groovy'
|
||||
dependencies {
|
||||
compile(project(":adapter-commons"))
|
||||
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
compile("net.bytebuddy:byte-buddy:1.7.9")
|
||||
|
||||
runtime("org.postgresql:postgresql:42.1.4")
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
testCompile("org.spockframework:spock-spring:1.1-groovy-2.4")
|
||||
testCompile("com.h2database:h2:1.4.194")
|
||||
testCompile(project(":adapter-commons").sourceSets.test.output)
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>production-planning-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.1.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -1,7 +1,5 @@
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: "jacoco"
|
||||
|
||||
dependencies {
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shared-kernel-model</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<compilerArgument>-parameters</compilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -4,18 +4,12 @@ dependencies {
|
||||
compile(project(":shortages-prediction-model"))
|
||||
compile(project(":adapter-commons"))
|
||||
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
|
||||
runtime("org.postgresql:postgresql:42.1.4")
|
||||
|
||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
testCompile("org.spockframework:spock-spring:1.1-groovy-2.4")
|
||||
testCompile("org.springframework.cloud:spring-cloud-starter-contract-stub-runner")
|
||||
testCompile("org.springframework.cloud:spring-cloud-starter-contract-verifier")
|
||||
testCompile("org.springframework.restdocs:spring-restdocs-mockmvc")
|
||||
testCompile("com.h2database:h2:1.4.194")
|
||||
testCompile(project(":adapter-commons").sourceSets.test.output)
|
||||
}
|
||||
|
||||
if (gradle.startParameter.taskRequests.any { it.args.any { it.contains("apiCompatibility") } }) {
|
||||
|
||||
@@ -1,357 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shortages-prediction-adapters</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shortages-prediction-model</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>adapter-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.1.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.7.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.restdocs</groupId>
|
||||
<artifactId>spring-restdocs-mockmvc</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.197</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud.version>Finchley.BUILD-SNAPSHOT</spring-cloud.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-test-source</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${project.build.directory}/generated-test-sources/contracts</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<!-- THIS IS CRITICAL CAUSE BY DEFAULT GMAVEN IGNORES WHATEVER SETUP YOU HAVE -->
|
||||
<configuration>
|
||||
<testSources>
|
||||
<testSource>
|
||||
<directory>${project.build.directory}/generated-test-sources/contracts/</directory>
|
||||
<includes>
|
||||
<include>**/*.groovy</include>
|
||||
</includes>
|
||||
</testSource>
|
||||
<testSource>
|
||||
<directory>${project.basedir}/src/test/groovy/</directory>
|
||||
<includes>
|
||||
<include>**/*.groovy</include>
|
||||
</includes>
|
||||
</testSource>
|
||||
</testSources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
<failIfNoTests>true</failIfNoTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
|
||||
<version>${spring-cloud-contract.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<!-- Will be injected by the pipeline -->
|
||||
<contractsRepositoryUrl>${repo.with.binaries}</contractsRepositoryUrl>
|
||||
<contractsMode>REMOTE</contractsMode>
|
||||
<!--<contractsMode>LOCAL</contractsMode>-->
|
||||
<!--<deleteStubsAfterTest>false</deleteStubsAfterTest>-->
|
||||
<contractDependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>app-monolith</artifactId>
|
||||
<classifier>stubs</classifier>
|
||||
<version>${latest.production.version}</version>
|
||||
</contractDependency>
|
||||
<testFramework>SPOCK</testFramework>
|
||||
<testMode>EXPLICIT</testMode>
|
||||
<baseClassForTests>io.dddbyexamples.factory.shortages.prediction.monitoring.persistence.BaseClass</baseClassForTests>
|
||||
<basePackageForTests>io.dddbyexamples.contracttests</basePackageForTests>
|
||||
<contractsPath>META-INF/${project.groupId}/app-monolith/${latest.production.version}/shortages-prediction-adapters/contracts</contractsPath>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@@ -44,26 +44,24 @@ class ShortagePredictionProcessORMRepository implements ShortagePredictionProces
|
||||
.flatMap(dao::findById)
|
||||
.orElseGet(() -> dao.save(new ShortagesEntity(refNo.getRefNo())));
|
||||
entity.setShortage(event.getShortage());
|
||||
|
||||
events.emit(event);
|
||||
}
|
||||
|
||||
private void delete(ShortageSolved event) {
|
||||
TechnicalId.get(event.getRefNo())
|
||||
.ifPresent(dao::deleteById);
|
||||
|
||||
events.emit(event);
|
||||
}
|
||||
}
|
||||
|
||||
private class EventsHandler implements ShortageEvents {
|
||||
@Override
|
||||
public void emit(NewShortage event) {
|
||||
save(event);
|
||||
events.emit(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emit(ShortageSolved event) {
|
||||
delete(event);
|
||||
events.emit(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
package io.dddbyexamples.factory.shortages.prediction.monitoring
|
||||
|
||||
import spock.lang.Ignore
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.test.annotation.Commit
|
||||
import io.dddbyexamples.factory.product.management.RefNoId
|
||||
import io.dddbyexamples.factory.shortages.prediction.Shortage
|
||||
import io.dddbyexamples.factory.shortages.prediction.calculation.ShortageForecasts
|
||||
import io.dddbyexamples.factory.shortages.prediction.monitoring.persistence.ShortagesDao
|
||||
import io.dddbyexamples.factory.shortages.prediction.monitoring.persistence.ShortagesEntity
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import spock.lang.Specification
|
||||
|
||||
import javax.transaction.Transactional
|
||||
import java.time.LocalDateTime
|
||||
|
||||
import static io.dddbyexamples.factory.shortages.prediction.monitoring.NewShortage.After.DemandChanged
|
||||
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
@Commit
|
||||
//TODO: Unignore
|
||||
@Ignore
|
||||
@DataJpaTest
|
||||
@ActiveProfiles("test")
|
||||
class ShortagePredictionProcessORMRepositorySpec extends Specification {
|
||||
|
||||
def now = LocalDateTime.now()
|
||||
@@ -42,54 +36,54 @@ class ShortagePredictionProcessORMRepositorySpec extends Specification {
|
||||
|
||||
def "provides process instance when no shortage persisted"() {
|
||||
when:
|
||||
def process = fetchProcess()
|
||||
def process = fetchProcess()
|
||||
|
||||
then:
|
||||
shortagesCurrentlyKnownBy(process) == noShortages()
|
||||
shortagesCurrentlyKnownBy(process) == noShortages()
|
||||
}
|
||||
|
||||
def "provides process instance with last known shortage"() {
|
||||
given:
|
||||
persistedShortage(someShortages())
|
||||
persistedShortage(someShortages())
|
||||
|
||||
when:
|
||||
def process = fetchProcess()
|
||||
def process = fetchProcess()
|
||||
|
||||
then:
|
||||
shortagesCurrentlyKnownBy(process) == someShortages()
|
||||
shortagesCurrentlyKnownBy(process) == someShortages()
|
||||
}
|
||||
|
||||
def "persists first shortage"() {
|
||||
when:
|
||||
def process = fetchProcess()
|
||||
processEmitsNewShortage(process, someShortages())
|
||||
def process = fetchProcess()
|
||||
processEmitsNewShortage(process, someShortages())
|
||||
|
||||
then:
|
||||
shortagesCurrentlyPersisted() == someShortages()
|
||||
shortagesCurrentlyPersisted() == someShortages()
|
||||
}
|
||||
|
||||
def "updates previous shortage"() {
|
||||
given:
|
||||
persistedShortage(someOldShortages())
|
||||
persistedShortage(someOldShortages())
|
||||
|
||||
when:
|
||||
def process = fetchProcess()
|
||||
processEmitsNewShortage(process, someShortages())
|
||||
def process = fetchProcess()
|
||||
processEmitsNewShortage(process, someShortages())
|
||||
|
||||
then:
|
||||
shortagesCurrentlyPersisted() == someShortages()
|
||||
shortagesCurrentlyPersisted() == someShortages()
|
||||
}
|
||||
|
||||
def "deletes solved shortage"() {
|
||||
given:
|
||||
persistedShortage(someShortages())
|
||||
persistedShortage(someShortages())
|
||||
|
||||
when:
|
||||
def process = fetchProcess()
|
||||
processEmitsShortageSolved(process)
|
||||
def process = fetchProcess()
|
||||
processEmitsShortageSolved(process)
|
||||
|
||||
then:
|
||||
noShortagesPersisted()
|
||||
noShortagesPersisted()
|
||||
}
|
||||
|
||||
def persistedShortage(Shortage shortages) {
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
package io.dddbyexamples.factory.shortages.prediction.monitoring.persistence
|
||||
|
||||
import groovy.transform.CompileStatic
|
||||
import org.mockito.Mockito
|
||||
import spock.lang.Specification
|
||||
|
||||
import org.springframework.beans.BeansException
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
||||
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase
|
||||
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.cloud.contract.wiremock.restdocs.SpringCloudContractRestDocs
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation
|
||||
import org.springframework.test.context.ActiveProfiles
|
||||
import org.springframework.test.web.servlet.MockMvc
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers
|
||||
import spock.lang.Specification
|
||||
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.MOCK
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
|
||||
@@ -31,18 +23,21 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
// would love to get rid of this
|
||||
@AutoConfigureTestDatabase
|
||||
@AutoConfigureRestDocs
|
||||
class ShortagesDaoTest extends Specification {
|
||||
@ActiveProfiles("test")
|
||||
class ShortagesDaoSpec extends Specification {
|
||||
|
||||
@Autowired ShortagesDao shortagesDao
|
||||
@Autowired MockMvc mockMvc
|
||||
@Autowired
|
||||
ShortagesDao shortagesDao
|
||||
@Autowired
|
||||
MockMvc mockMvc
|
||||
|
||||
def "should find ref by no"() {
|
||||
given:
|
||||
Config.defaultStubbing(shortagesDao)
|
||||
expect:
|
||||
mockMvc.perform(get("/shortages?refNo=1"))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andDo(MockMvcRestDocumentation.document("find_ref_by_no",
|
||||
SpringCloudContractRestDocs.dslContract()))
|
||||
}
|
||||
def "should find ref by no"() {
|
||||
given:
|
||||
Config.defaultStubbing(shortagesDao)
|
||||
expect:
|
||||
mockMvc.perform(get("/shortages?refNo=1"))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andDo(MockMvcRestDocumentation.document("find_ref_by_no",
|
||||
SpringCloudContractRestDocs.dslContract()))
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: "jacoco"
|
||||
|
||||
dependencies {
|
||||
compile(project(":shared-kernel-model"))
|
||||
compile("org.projectlombok:lombok:1.16.18")
|
||||
|
||||
testCompile("org.spockframework:spock-core:1.1-groovy-2.4")
|
||||
}
|
||||
@@ -1,236 +0,0 @@
|
||||
<?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>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shortages-prediction-model</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- [PIPELINE] -->
|
||||
<distribution.management.release.id>artifactory-local</distribution.management.release.id>
|
||||
<distribution.management.release.url>http://localhost:8081/artifactory/libs-release-local</distribution.management.release.url>
|
||||
<distribution.management.snapshot.url>http://localhost:8081/artifactory/libs-snapshot-local</distribution.management.snapshot.url>
|
||||
<repo.with.binaries>http://localhost:8081/artifactory/libs-release-local</repo.with.binaries>
|
||||
<maven-surefire.version>2.21.0</maven-surefire.version>
|
||||
</properties>
|
||||
|
||||
<!-- [PIPELINE] -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Release Repository</name>
|
||||
<url>${distribution.management.release.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${distribution.management.release.id}</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>${distribution.management.snapshot.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pl.com.dddbyexamples</groupId>
|
||||
<artifactId>shared-kernel-model</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>1.1-groovy-2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<compilerArgument>-parameters</compilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compileTests</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<useFile>false</useFile>
|
||||
<includes>
|
||||
<include>**/*Spec.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*Test*.*</include>>
|
||||
<include>**/*Spec*.*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/smoke/**</exclude>
|
||||
<exclude>**/e2e/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>apicompatibility</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>contracttests/**/*Test*.*</include>
|
||||
<include>contracttests/**/*Spec*.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>smoke</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>smoke/**/*Tests.java</include>
|
||||
<include>smoke/**/*Test.java</include>
|
||||
<include>smoke/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- [PIPELINE] -->
|
||||
<profile>
|
||||
<id>e2e</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire.version}</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>e2e/**/*Tests.java</include>
|
||||
<include>e2e/**/*Test.java</include>
|
||||
<include>e2e/**/*Spec.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/libs-snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user