Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Create a db from the create_db.sql script -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>sql-maven-plugin</artifactId>
- <version>1.5</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <driver>org.h2.Driver</driver>
- <url>jdbc:h2:file:${project.build.directory}/templatedb.sql</url>
- <fileset>
- <basedir>${project.basedir}/src/main/resources/sql</basedir>
- <includes>create_db_h2.sql</includes>
- </fileset>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>${h2.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- <!-- Delete database file if it already exists -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <delete file="${project.build.directory}/templatedb.sql"
- failOnError="false" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- Once the template db is created, generate queryDsl code from it -->
- <plugin>
- <groupId>com.querydsl</groupId>
- <artifactId>querydsl-maven-plugin</artifactId>
- <version>${querydsl.version}</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>export</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <jdbcDriver>org.h2.Driver</jdbcDriver>
- <jdbcUrl>jdbc:h2:file:${project.build.directory}/templatedb.sql</jdbcUrl>
- <packageName>net.jr.portal.db.model</packageName>
- <targetFolder>${project.build.directory}/generated-sources/querydsl</targetFolder>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>${h2.version}</version>
- </dependency>
- </dependencies>
- </plugin>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement