|
11 | 11 |
|
12 | 12 | <artifactId>quarkus-hibernate-panache-deployment</artifactId> |
13 | 13 | <name>Quarkus - Hibernate with Panache - Deployment</name> |
| 14 | + |
| 15 | + <properties> |
| 16 | + <postgres.reactive.url>vertx-reactive:postgresql://localhost:5431/hibernate_orm_test</postgres.reactive.url> |
| 17 | + <postgres.blocking.url>jdbc:postgresql://localhost:5431/hibernate_orm_test</postgres.blocking.url> |
| 18 | + </properties> |
| 19 | + |
14 | 20 | <dependencies> |
15 | 21 | <dependency> |
16 | 22 | <groupId>io.quarkus</groupId> |
|
47 | 53 | </dependency> |
48 | 54 |
|
49 | 55 | <!-- test dependencies --> |
| 56 | + <dependency> |
| 57 | + <groupId>io.quarkus</groupId> |
| 58 | + <artifactId>quarkus-test-vertx</artifactId> |
| 59 | + <scope>test</scope> |
| 60 | + </dependency> |
50 | 61 | <dependency> |
51 | 62 | <groupId>io.quarkus</groupId> |
52 | 63 | <artifactId>quarkus-junit5-internal</artifactId> |
53 | 64 | <scope>test</scope> |
54 | 65 | </dependency> |
55 | 66 | <dependency> |
56 | 67 | <groupId>io.quarkus</groupId> |
57 | | - <artifactId>quarkus-jdbc-h2-deployment</artifactId> |
| 68 | + <artifactId>quarkus-jdbc-postgresql-deployment</artifactId> |
| 69 | + <scope>test</scope> |
| 70 | + </dependency> |
| 71 | + <dependency> |
| 72 | + <groupId>io.quarkus</groupId> |
| 73 | + <artifactId>quarkus-reactive-pg-client-deployment</artifactId> |
58 | 74 | <scope>test</scope> |
59 | 75 | </dependency> |
60 | 76 | <dependency> |
|
65 | 81 | </dependencies> |
66 | 82 |
|
67 | 83 | <build> |
| 84 | + <testResources> |
| 85 | + <testResource> |
| 86 | + <directory>src/test/resources</directory> |
| 87 | + <filtering>true</filtering> |
| 88 | + </testResource> |
| 89 | + </testResources> |
68 | 90 | <plugins> |
69 | 91 | <plugin> |
70 | 92 | <artifactId>maven-compiler-plugin</artifactId> |
|
94 | 116 | </execution> |
95 | 117 | </executions> |
96 | 118 | </plugin> |
| 119 | + <plugin> |
| 120 | + <artifactId>maven-surefire-plugin</artifactId> |
| 121 | + <configuration> |
| 122 | + <skip>true</skip> |
| 123 | + </configuration> |
| 124 | + </plugin> |
97 | 125 | </plugins> |
98 | 126 | </build> |
99 | 127 |
|
| 128 | + <profiles> |
| 129 | + <profile> |
| 130 | + <id>test-postgresql</id> |
| 131 | + <activation> |
| 132 | + <property> |
| 133 | + <name>test-containers</name> |
| 134 | + </property> |
| 135 | + </activation> |
| 136 | + <build> |
| 137 | + <plugins> |
| 138 | + <plugin> |
| 139 | + <artifactId>maven-surefire-plugin</artifactId> |
| 140 | + <configuration> |
| 141 | + <skip>false</skip> |
| 142 | + </configuration> |
| 143 | + </plugin> |
| 144 | + </plugins> |
| 145 | + </build> |
| 146 | + </profile> |
| 147 | + |
| 148 | + <profile> |
| 149 | + <id>docker-postgresql</id> |
| 150 | + <activation> |
| 151 | + <property> |
| 152 | + <name>start-containers</name> |
| 153 | + </property> |
| 154 | + </activation> |
| 155 | + <build> |
| 156 | + <plugins> |
| 157 | + <plugin> |
| 158 | + <groupId>io.fabric8</groupId> |
| 159 | + <artifactId>docker-maven-plugin</artifactId> |
| 160 | + <configuration> |
| 161 | + <images> |
| 162 | + <image> |
| 163 | + <name>${postgres.image}</name> |
| 164 | + <alias>postgresql</alias> |
| 165 | + <run> |
| 166 | + <env> |
| 167 | + <POSTGRES_USER>hibernate_orm_test</POSTGRES_USER> |
| 168 | + <POSTGRES_PASSWORD>hibernate_orm_test</POSTGRES_PASSWORD> |
| 169 | + <POSTGRES_DB>hibernate_orm_test</POSTGRES_DB> |
| 170 | + </env> |
| 171 | + <ports> |
| 172 | + <port>5431:5432</port> |
| 173 | + </ports> |
| 174 | + <wait> |
| 175 | + <!-- For some reason, Postgres will tell us it's ready *twice*, |
| 176 | + and that's the truth the second time only. |
| 177 | + See https://github.com/fabric8io/docker-maven-plugin/issues/628 |
| 178 | + See also how the condition is configured in testcontainers: |
| 179 | + https://github.com/testcontainers/testcontainers-java/blob/c64aab9fd5e3a452ee0faf793560327eb4da9841/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java#L52-L55 --> |
| 180 | + <time>20000</time> |
| 181 | + <log>(?s)ready to accept connections.*ready to accept connections</log> |
| 182 | + </wait> |
| 183 | + </run> |
| 184 | + </image> |
| 185 | + </images> |
| 186 | + <!--Stops all postgres images currently running, not just those we just started. |
| 187 | + Useful to stop processes still running from a previously failed integration test run --> |
| 188 | + <allContainers>true</allContainers> |
| 189 | + </configuration> |
| 190 | + <executions> |
| 191 | + <execution> |
| 192 | + <id>docker-start</id> |
| 193 | + <phase>process-test-classes</phase> |
| 194 | + <goals> |
| 195 | + <goal>stop</goal> |
| 196 | + <goal>start</goal> |
| 197 | + </goals> |
| 198 | + </execution> |
| 199 | + <execution> |
| 200 | + <id>docker-stop</id> |
| 201 | + <phase>post-integration-test</phase> |
| 202 | + <goals> |
| 203 | + <goal>stop</goal> |
| 204 | + </goals> |
| 205 | + </execution> |
| 206 | + </executions> |
| 207 | + </plugin> |
| 208 | + <plugin> |
| 209 | + <groupId>org.codehaus.mojo</groupId> |
| 210 | + <artifactId>exec-maven-plugin</artifactId> |
| 211 | + <executions> |
| 212 | + <execution> |
| 213 | + <id>docker-prune</id> |
| 214 | + <phase>generate-resources</phase> |
| 215 | + <goals> |
| 216 | + <goal>exec</goal> |
| 217 | + </goals> |
| 218 | + <configuration> |
| 219 | + <executable>${docker-prune.location}</executable> |
| 220 | + </configuration> |
| 221 | + </execution> |
| 222 | + </executions> |
| 223 | + </plugin> |
| 224 | + </plugins> |
| 225 | + </build> |
| 226 | + </profile> |
| 227 | + </profiles> |
| 228 | + |
100 | 229 | </project> |
0 commit comments