Я хочу создать приложение с ИТ-тестами для Oracle БД. До сих пор я застрял на построении docker (он строит, но никогда не достигает этой цели)
POM-файл
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>pl.test</groupId>
<artifactId>oracle-connection</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>oracle-connection</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<docker.maven.plugin.version>0.27.2</docker.maven.plugin.version>
<failsafe.plugin.version>2.22.1</failsafe.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.31.0</version>
<executions>
<execution>
<id>prepare-it-database</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<images>
<image>
<name>dbunit/dbunit-it-oracle11g:1.0.1</name>
<alias>it-database</alias>
<run>
<ports>
<port>1521:1521</port>
</ports>
<env>
<ORACLE_PASSWORD>dbunit</ORACLE_PASSWORD>
<ORACLE_DB>dbunit</ORACLE_DB>
</env>
<wait>
<log>(?s)User altered.</log>
<time>70000</time>
</wait>
</run>
</image>
</images>
</configuration>
</execution>
<execution>
<id>remove-it-database</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Я делаю
mvn verify
и все выглядит, пока не зависнет после построения docker (начальная цель никогда не заканчивается)
<code><pre>
mvn clean verify -e docker:logs -Ddocker.follow -Ddocker.logDate=DEFAULT
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< pl.pgurdek:oracle-connection >--------------------
[INFO] Building oracle-connection 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ oracle-connection ---
[INFO] Deleting C:\dev\oracle-connection\target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ oracle-connection ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ oracle-connection ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to C:\dev\oracle-connection\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ oracle-connection ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ oracle-connection ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\dev\oracle-connection\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ oracle-connection ---
[INFO]
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ oracle-connection ---
[INFO] Building jar: C:\dev\oracle-connection\target\oracle-connection-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.2.2.RELEASE:repackage (repackage) @ oracle-connection ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- docker-maven-plugin:0.31.0:start (prepare-it-database) @ oracle-connection ---
[INFO] DOCKER> [dbunit/dbunit-it-oracle11g:1.0.1] "it-database": Start container c405bf727b56
14:44:40.458 it-database> Starting Oracle Net Listener.
14:44:42.680 it-database> Starting Oracle Database 11g Express Edition instance.
14:44:55.335 it-database>
14:44:56.041 it-database>
14:44:56.041 it-database> System altered.
14:44:56.041 it-database>
14:44:56.095 it-database>
14:44:56.095 it-database> System altered.
14:44:56.095 it-database>
14:44:56.121 it-database> Shutting down Oracle Database 11g Express Edition instance.
14:45:25.765 it-database> Stopping Oracle Net Listener.
14:45:27.688 it-database>
14:45:27.700 it-database> Starting Oracle Net Listener.
14:45:27.732 it-database> Starting Oracle Database 11g Express Edition instance.
14:45:35.643 it-database>
14:45:35.649 it-database> /usr/sbin/startup.sh: running /docker-entrypoint-initdb.d/init.sql
14:45:35.663 it-database>
14:45:35.663 it-database> SQL*Plus: Release 11.2.0.2.0 Production on Thu Jan 16 13:45:35 2020
14:45:35.663 it-database>
14:45:35.663 it-database> Copyright (c) 1982, 2011, Oracle. All rights reserved.
14:45:35.663 it-database>
14:45:35.697 it-database>
14:45:35.697 it-database> Connected to:
14:45:35.697 it-database> Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
14:45:35.697 it-database>
14:45:35.747 it-database>
14:45:35.747 it-database> User created.
14:45:35.747 it-database>
14:45:35.759 it-database>
14:45:35.759 it-database> Grant succeeded.
14:45:35.759 it-database>
14:45:35.764 it-database>
14:45:35.764 it-database> Grant succeeded.
14:45:35.764 it-database>
14:45:35.769 it-database>
14:45:35.769 it-database> Grant succeeded.
14:45:35.769 it-database>
14:45:35.783 it-database>
[INFO] DOCKER> Pattern '(?s)User altered.' matched for container c405bf727b56
14:45:35.783 it-database> User altered.
14:45:35.783 it-database>
14:45:35.786 it-database> SQL> Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
14:45:35.788 it-database>
14:45:35.788 it-database>
[INFO] DOCKER> [dbunit/dbunit-it-oracle11g:1.0.1] "it-database": Waited on log out '(?s)User altered.' 55487 ms
Я взял пример по ссылке ниже. Который не работает ни.
https://github.com/fernandomoraes/medium-posts/tree/master/fail-safe-docker