Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <!-- Create a db from the create_db.sql script -->
  2. <plugin>
  3. <groupId>org.codehaus.mojo</groupId>
  4. <artifactId>sql-maven-plugin</artifactId>
  5. <version>1.5</version>
  6. <executions>
  7. <execution>
  8. <phase>generate-sources</phase>
  9. <goals>
  10. <goal>execute</goal>
  11. </goals>
  12. <configuration>
  13. <driver>org.h2.Driver</driver>
  14. <url>jdbc:h2:file:${project.build.directory}/templatedb.sql</url>
  15. <fileset>
  16. <basedir>${project.basedir}/src/main/resources/sql</basedir>
  17. <includes>create_db_h2.sql</includes>
  18. </fileset>
  19. </configuration>
  20. </execution>
  21. </executions>
  22. <dependencies>
  23. <dependency>
  24. <groupId>com.h2database</groupId>
  25. <artifactId>h2</artifactId>
  26. <version>${h2.version}</version>
  27. </dependency>
  28. </dependencies>
  29. </plugin>
  30.  
  31. <!-- Delete database file if it already exists -->
  32. <plugin>
  33. <groupId>org.apache.maven.plugins</groupId>
  34. <artifactId>maven-antrun-plugin</artifactId>
  35. <version>1.7</version>
  36. <executions>
  37. <execution>
  38. <phase>generate-sources</phase>
  39. <goals>
  40. <goal>run</goal>
  41. </goals>
  42. <configuration>
  43. <tasks>
  44. <delete file="${project.build.directory}/templatedb.sql"
  45. failOnError="false" />
  46. </tasks>
  47. </configuration>
  48. </execution>
  49. </executions>
  50. </plugin>
  51.  
  52. <!-- Once the template db is created, generate queryDsl code from it -->
  53. <plugin>
  54. <groupId>com.querydsl</groupId>
  55. <artifactId>querydsl-maven-plugin</artifactId>
  56. <version>${querydsl.version}</version>
  57. <executions>
  58. <execution>
  59. <phase>generate-sources</phase>
  60. <goals>
  61. <goal>export</goal>
  62. </goals>
  63. </execution>
  64. </executions>
  65. <configuration>
  66. <jdbcDriver>org.h2.Driver</jdbcDriver>
  67. <jdbcUrl>jdbc:h2:file:${project.build.directory}/templatedb.sql</jdbcUrl>
  68. <packageName>net.jr.portal.db.model</packageName>
  69. <targetFolder>${project.build.directory}/generated-sources/querydsl</targetFolder>
  70. </configuration>
  71. <dependencies>
  72. <dependency>
  73. <groupId>com.h2database</groupId>
  74. <artifactId>h2</artifactId>
  75. <version>${h2.version}</version>
  76. </dependency>
  77. </dependencies>
  78. </plugin>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement