blob: fb2f8846dcd085ebfac77cff1be8f3ca214129bf [file] [log] [blame]
<?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>
<parent>
<groupId>org.eclipse.basyx</groupId>
<artifactId>basyx.components</artifactId>
<version>1.0.1RC01</version>
</parent>
<artifactId>basyx.components.docker</artifactId>
<name>BaSyx Docker Base</name>
<packaging>pom</packaging>
<!-- Includes all components in this project as separated modules -->
<modules>
<module>basyx.components.registry</module>
<module>basyx.components.AASServer</module>
</modules>
<build>
<pluginManagement>
<plugins>
<!-- Read maven properties from file -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.basedir}/src/test/resources/.env</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<!-- Generate separate jar for tests and exclude logback.xml from generated jars -->
<!-- + create the executable jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>${basyx.components.executable}</mainClass>
</manifest>
</archive>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</configuration>
</plugin>
<!-- Copy the dependencies necessary to run the jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>compile</includeScope>
<outputDirectory>${project.build.directory}/lib/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Build the docker image -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>${BASYX_IMAGE_NAME}</repository>
<tag>${BASYX_IMAGE_TAG}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
<PORT>${BASYX_CONTAINER_PORT}</PORT>
<!-- The system property/env keys for basyx configuration files -->
<CONTEXT_CONFIG_KEY>BASYX_CONTEXT</CONTEXT_CONFIG_KEY>
<REGISTRY_CONFIG_KEY>BASYX_REGISTRY</REGISTRY_CONFIG_KEY>
<AAS_CONFIG_KEY>BASYX_AAS</AAS_CONFIG_KEY>
<MONGODB_CONFIG_KEY>BASYX_MONGODB</MONGODB_CONFIG_KEY>
<DOCKER_CONFIG_KEY>BASYX_DOCKER</DOCKER_CONFIG_KEY>
<SQL_CONFIG_KEY>BASYX_SQL</SQL_CONFIG_KEY>
</buildArgs>
</configuration>
</plugin>
<!-- Create integration test environment -->
<plugin>
<groupId>com.dkanejs.maven.plugins</groupId>
<artifactId>docker-compose-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<composeFile>${project.basedir}/docker-compose.yml</composeFile>
<detachedMode>true</detachedMode>
<envFile>${project.basedir}/src/test/resources/.env</envFile>
<envVars>
<BASYX_IMAGE_TAG>${project.version}</BASYX_IMAGE_TAG>
<BASYX_IMAGE_NAME>${BASYX_IMAGE_NAME}</BASYX_IMAGE_NAME>
<BASYX_CONTAINER_NAME>${BASYX_CONTAINER_NAME}</BASYX_CONTAINER_NAME>
<BASYX_CONTAINER_PORT>${BASYX_CONTAINER_PORT}</BASYX_CONTAINER_PORT>
<BASYX_HOST_PORT>${BASYX_HOST_PORT}</BASYX_HOST_PORT>
</envVars>
</configuration>
<executions>
<execution>
<id>docker-compose-up</id>
<phase>pre-integration-test</phase>
<goals>
<goal>up</goal>
</goals>
</execution>
<execution>
<id>docker-compose-down</id>
<phase>post-integration-test</phase>
<goals>
<goal>down</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Run integration tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.20.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- Defines common dependencies for all docker components -->
<dependencies>
<!-- Depends on the components library -->
<dependency>
<groupId>org.eclipse.basyx</groupId>
<artifactId>basyx.components.lib</artifactId>
<version>1.0.1RC01</version>
</dependency>
</dependencies>
</project>