blob: 332d4c885d2ff139fdcf12633de94a2c16f31093 [file] [log] [blame]
Frank Schnickeab0946e2020-04-24 12:37:24 +02001<?xml version="1.0" encoding="UTF-8"?>
2<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">
Daniel Espenbe80b3c2020-02-10 08:43:47 +01003 <modelVersion>4.0.0</modelVersion>
4
5 <parent>
6 <groupId>org.eclipse.basyx</groupId>
7 <artifactId>basyx.components</artifactId>
8 <version>0.0.1-SNAPSHOT</version>
9 </parent>
10
11 <artifactId>basyx.components.docker</artifactId>
12 <name>BaSyx Docker Base</name>
13
14 <packaging>pom</packaging>
15
16 <!-- Includes all components in this project as separated modules -->
17 <modules>
18 <module>basyx.components.simple</module>
19 <module>basyx.components.sqlregistry</module>
Ashfaqul Haqueb9fadc62020-03-13 15:46:42 +010020 <module>basyx.components.xmlAAS</module>
zhangzaib9885342020-03-19 23:26:59 +010021 <module>basyx.components.AASX</module>
Frank Schnickeab0946e2020-04-24 12:37:24 +020022 <module>basyx.components.AASServer</module>
23 </modules>
Daniel Espenbe80b3c2020-02-10 08:43:47 +010024
25 <build>
26 <pluginManagement>
27 <plugins>
28 <!-- Read maven properties from file -->
29 <plugin>
30 <groupId>org.codehaus.mojo</groupId>
31 <artifactId>properties-maven-plugin</artifactId>
32 <version>1.0.0</version>
33 <executions>
34 <execution>
35 <phase>initialize</phase>
36 <goals>
37 <goal>read-project-properties</goal>
38 </goals>
39 <configuration>
40 <files>
41 <file>${project.basedir}/src/test/resources/.env</file>
42 </files>
43 </configuration>
44 </execution>
45 </executions>
46 </plugin>
47
48 <!-- Generate separate jar for tests and exclude logback.xml from generated jars -->
49 <!-- + create the executable jar -->
50 <plugin>
51 <groupId>org.apache.maven.plugins</groupId>
52 <artifactId>maven-jar-plugin</artifactId>
53 <version>3.1.1</version>
54 <configuration>
55 <archive>
56 <manifest>
57 <addClasspath>true</addClasspath>
58 <classpathPrefix>lib/</classpathPrefix>
59 <mainClass>${basyx.components.executable}</mainClass>
60 </manifest>
61 </archive>
62 <excludes>
63 <exclude>**/logback.xml</exclude>
64 </excludes>
65 <executions>
66 <execution>
67 <goals>
68 <goal>test-jar</goal>
69 </goals>
70 </execution>
71 </executions>
72 </configuration>
73 </plugin>
74
75 <!-- Copy the dependencies necessary to run the jar -->
76 <plugin>
77 <groupId>org.apache.maven.plugins</groupId>
78 <artifactId>maven-dependency-plugin</artifactId>
79 <executions>
80 <execution>
81 <id>copy-dependencies</id>
82 <phase>prepare-package</phase>
83 <goals>
84 <goal>copy-dependencies</goal>
85 </goals>
86 <configuration>
87 <includeScope>compile</includeScope>
88 <outputDirectory>${project.build.directory}/lib/</outputDirectory>
89 </configuration>
90 </execution>
91 </executions>
92 </plugin>
93
94 <!-- Build the docker image -->
95 <plugin>
96 <groupId>com.spotify</groupId>
97 <artifactId>dockerfile-maven-plugin</artifactId>
98 <version>1.4.10</version>
99 <executions>
100 <execution>
101 <id>default</id>
102 <goals>
103 <goal>build</goal>
104 </goals>
105 </execution>
106 </executions>
107 <configuration>
108 <repository>${BASYX_IMAGE_NAME}</repository>
109 <tag>${project.version}</tag>
110 <buildArgs>
111 <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
112 <PORT>${BASYX_CONTAINER_PORT}</PORT>
113 </buildArgs>
114 </configuration>
115 </plugin>
116
117 <!-- Create integration test environment -->
118 <plugin>
119 <groupId>com.dkanejs.maven.plugins</groupId>
120 <artifactId>docker-compose-maven-plugin</artifactId>
121 <version>2.5.1</version>
122 <configuration>
123 <composeFile>${project.basedir}/docker-compose.yml</composeFile>
124 <detachedMode>true</detachedMode>
125 <envFile>${project.basedir}/src/test/resources/.env</envFile>
126 <envVars>
127 <BASYX_IMAGE_TAG>${project.version}</BASYX_IMAGE_TAG>
128 <BASYX_IMAGE_NAME>${BASYX_IMAGE_NAME}</BASYX_IMAGE_NAME>
129 <BASYX_CONTAINER_NAME>${BASYX_CONTAINER_NAME}</BASYX_CONTAINER_NAME>
130 <BASYX_CONTAINER_PORT>${BASYX_CONTAINER_PORT}</BASYX_CONTAINER_PORT>
131 <BASYX_HOST_PORT>${BASYX_HOST_PORT}</BASYX_HOST_PORT>
132 </envVars>
133 </configuration>
134 <executions>
135 <execution>
136 <id>docker-compose-up</id>
137 <phase>pre-integration-test</phase>
138 <goals>
139 <goal>up</goal>
140 </goals>
141 </execution>
142 <execution>
143 <id>docker-compose-down</id>
144 <phase>post-integration-test</phase>
145 <goals>
146 <goal>down</goal>
147 </goals>
148 </execution>
149 </executions>
150 </plugin>
151
152
153 <!-- Run integration tests -->
154 <plugin>
155 <groupId>org.apache.maven.plugins</groupId>
156 <artifactId>maven-failsafe-plugin</artifactId>
157 <version>2.20.1</version>
158 <executions>
159 <execution>
160 <goals>
161 <goal>integration-test</goal>
162 <goal>verify</goal>
163 </goals>
164 </execution>
165 </executions>
166 </plugin>
167 </plugins>
168 </pluginManagement>
169 </build>
170
171 <!-- Defines common dependencies for all docker components -->
172 <dependencies>
173 <!-- Depends on the components library -->
174 <dependency>
175 <groupId>org.eclipse.basyx</groupId>
176 <artifactId>basyx.components.lib</artifactId>
177 <version>${project.version}</version>
178 </dependency>
179 </dependencies>
180</project>