| <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>0.0.1-SNAPSHOT</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.simple</module> |
| <module>basyx.components.sqlregistry</module> |
| <module>basyx.components.xmlAAS</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>${project.version}</tag> |
| <buildArgs> |
| <JAR_FILE>${project.build.finalName}.jar</JAR_FILE> |
| <PORT>${BASYX_CONTAINER_PORT}</PORT> |
| </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>${project.version}</version> |
| </dependency> |
| </dependencies> |
| </project> |