我正在尝试使用maven为我的postgres数据库自动生成pojo.虽然我把maven从等式中解脱出来但我有问题.
我的数据分为多个模式,我需要在我的代码库中使用所有这些模式.我想知道如何在maven中为每个人设置一个任务.这就是我到目前为止所拥有的.
显然,这似乎只适用于单个架构.我希望能够为多个POJO生成POJO.我尝试了多个xml元素,或逗号分隔,但它只是错误.
mvn -PDBGen generate-sources #is the command i use
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foobar.sandbox</groupId>
<artifactId>playBox</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<jooq-version>3.4.4</jooq-version>
<psql-version>9.1-901-1.jdbc4</psql-version>
</properties>
<profiles>
<profile>
<id>DBGen</id>
<build>
<plugins>
<!-- Maven Auto Generation -->
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>${jooq-version}</version>
<!-- The plugin should hook into the generate goal -->
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<!-- Manage the plugin's dependency. In this example, we'll use a PostgreSQL database -->
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${psql-version}</version>
</dependency>
</dependencies> …Run Code Online (Sandbox Code Playgroud)