|
1 | | -<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| 1 | +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor |
2 | 2 | license agreements. See the NOTICE file distributed with this work for additional |
3 | 3 | information regarding copyright ownership. The ASF licenses this file to |
4 | 4 | you under the Apache License, Version 2.0 (the "License"); you may not use |
|
9 | 9 | OF ANY KIND, either express or implied. See the License for the specific |
10 | 10 | language governing permissions and limitations under the License. --> |
11 | 11 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 12 | + |
12 | 13 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
13 | 14 | <modelVersion>4.0.0</modelVersion> |
14 | 15 | <artifactId>cloud-developer</artifactId> |
|
101 | 102 | </dependency> |
102 | 103 | </dependencies> |
103 | 104 | <configuration> |
| 105 | + |
104 | 106 | <driver>org.gjt.mm.mysql.Driver</driver> |
105 | 107 | <url>jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud</url> |
106 | 108 | <username>${db.cloud.username}</username> |
|
109 | 111 | <skip>${maven.test.skip}</skip> |
110 | 112 | <forceMojoExecution>true</forceMojoExecution> |
111 | 113 | </configuration> |
112 | | - |
113 | 114 | <executions> |
114 | 115 | <execution> |
115 | 116 | <id>drop-database</id> |
|
310 | 311 | </goals> |
311 | 312 | <configuration> |
312 | 313 | <autocommit>true</autocommit> |
313 | | - <srcFiles> |
314 | | - <srcFile>${basedir}/developer-prefill.sql</srcFile> |
315 | | - </srcFiles> |
| 314 | + <srcFiles> |
| 315 | + <srcFile>${basedir}/developer-prefill.sql</srcFile> |
| 316 | + </srcFiles> |
316 | 317 | </configuration> |
317 | 318 | </execution> |
318 | 319 | </executions> |
319 | 320 | </plugin> |
320 | 321 | </plugins> |
321 | 322 | </build> |
322 | 323 | </profile> |
| 324 | + |
| 325 | + <!-- Simulator profile --> |
| 326 | + <profile> |
| 327 | + <id>simulator</id> |
| 328 | + <activation> |
| 329 | + <property><name>deploydb-simulator</name></property> |
| 330 | + </activation> |
| 331 | + <build> |
| 332 | + <plugins> |
| 333 | + <plugin> |
| 334 | + <groupId>org.codehaus.mojo</groupId> |
| 335 | + <artifactId>properties-maven-plugin</artifactId> |
| 336 | + <version>1.0-alpha-2</version> |
| 337 | + <executions> |
| 338 | + <execution> |
| 339 | + <phase>initialize</phase> |
| 340 | + <goals> |
| 341 | + <goal>read-project-properties</goal> |
| 342 | + </goals> |
| 343 | + <configuration> |
| 344 | + <files> |
| 345 | + <file>${project.parent.basedir}/utils/conf/db.properties</file> |
| 346 | + <file>${project.parent.basedir}/utils/conf/db.properties.override</file> |
| 347 | + </files> |
| 348 | + <quiet>true</quiet> |
| 349 | + </configuration> |
| 350 | + </execution> |
| 351 | + </executions> |
| 352 | + </plugin> |
| 353 | + <plugin> |
| 354 | + <groupId>org.codehaus.mojo</groupId> |
| 355 | + <artifactId>sql-maven-plugin</artifactId> |
| 356 | + <version>1.5</version> |
| 357 | + <dependencies> |
| 358 | + <dependency> |
| 359 | + <groupId>mysql</groupId> |
| 360 | + <artifactId>mysql-connector-java</artifactId> |
| 361 | + <version>${cs.mysql.version}</version> |
| 362 | + </dependency> |
| 363 | + </dependencies> |
| 364 | + <configuration> |
| 365 | + <driver>org.gjt.mm.mysql.Driver</driver> |
| 366 | + <url>jdbc:mysql://${db.simulator.host}:3306/simulator</url> |
| 367 | + <username>${db.simulator.username}</username> |
| 368 | + <password>${db.simulator.password}</password> |
| 369 | + <skip>${maven.test.skip}</skip> |
| 370 | + <forceMojoExecution>true</forceMojoExecution> |
| 371 | + </configuration> |
| 372 | + <executions> |
| 373 | + <execution> |
| 374 | + <id>drop-database</id> |
| 375 | + <phase>process-test-resources</phase> |
| 376 | + <goals> |
| 377 | + <goal>execute</goal> |
| 378 | + </goals> |
| 379 | + <configuration> |
| 380 | + <username>root</username> |
| 381 | + <password>${db.root.password}</password> |
| 382 | + <url>jdbc:mysql://${db.simulator.host}:3306</url> |
| 383 | + <sqlCommand>drop database if exists `simulator`</sqlCommand> |
| 384 | + </configuration> |
| 385 | + </execution> |
| 386 | + <execution> |
| 387 | + <id>create-database</id> |
| 388 | + <phase>process-test-resources</phase> |
| 389 | + <goals> |
| 390 | + <goal>execute</goal> |
| 391 | + </goals> |
| 392 | + <configuration> |
| 393 | + <username>root</username> |
| 394 | + <password>${db.root.password}</password> |
| 395 | + <url>jdbc:mysql://${db.simulator.host}:3306</url> |
| 396 | + <sqlCommand>create database `simulator`</sqlCommand> |
| 397 | + </configuration> |
| 398 | + </execution> |
| 399 | + <execution> |
| 400 | + <id>grant-user-cloud</id> |
| 401 | + <phase>process-test-resources</phase> |
| 402 | + <goals> |
| 403 | + <goal>execute</goal> |
| 404 | + </goals> |
| 405 | + <configuration> |
| 406 | + <username>root</username> |
| 407 | + <password>${db.root.password}</password> |
| 408 | + <url>jdbc:mysql://${db.simulator.host}:3306</url> |
| 409 | + <sqlCommand>GRANT ALL ON simulator.* to |
| 410 | + ${db.simulator.username}@`localhost` identified by |
| 411 | + '${db.simulator.password}';</sqlCommand> |
| 412 | + </configuration> |
| 413 | + </execution> |
| 414 | + <execution> |
| 415 | + <id>grant-user-cloud-all</id> |
| 416 | + <phase>process-test-resources</phase> |
| 417 | + <goals> |
| 418 | + <goal>execute</goal> |
| 419 | + </goals> |
| 420 | + <configuration> |
| 421 | + <username>root</username> |
| 422 | + <password>${db.root.password}</password> |
| 423 | + <url>jdbc:mysql://${db.simulator.host}:3306</url> |
| 424 | + <sqlCommand>GRANT ALL ON simulator.* to |
| 425 | + ${db.simulator.username}@`%` identified by |
| 426 | + '${db.simulator.password}';</sqlCommand> |
| 427 | + </configuration> |
| 428 | + </execution> |
| 429 | + <execution> |
| 430 | + <id>create-schema</id> |
| 431 | + <phase>process-test-resources</phase> |
| 432 | + <goals> |
| 433 | + <goal>execute</goal> |
| 434 | + </goals> |
| 435 | + <configuration> |
| 436 | + <srcFiles> |
| 437 | + <srcFile>${basedir}/target/db/create-schema-simulator.sql</srcFile> |
| 438 | + <srcFile>${basedir}/target/db/templates.simulator.sql</srcFile> |
| 439 | + </srcFiles> |
| 440 | + </configuration> |
| 441 | + </execution> |
| 442 | + </executions> |
| 443 | + </plugin> |
| 444 | + </plugins> |
| 445 | + </build> |
| 446 | + </profile> |
323 | 447 | </profiles> |
324 | 448 | </project> |
0 commit comments