目前,我的jooq-codegen-maven插件在每次编译时都会运行,这会降低构建速度。我只想在更改DB模式后手动运行它。如何更改插件配置才能实现这一点?
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>${jooq.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbc>
<url>${jooq.db.url}</url>
<user>${jooq.db.username}</user>
<password>${jooq.db.username}</password>
</jdbc>
<generator>
<database>
<includes>.*</includes>
<inputSchema>${jooq.db.schema}</inputSchema>
</database>
<target>
<packageName>my.package.name.generated.jooq</packageName>
<directory>${project.build.directory}/generated-sources/jooq</directory>
</target>
</generator>
</configuration>
</plugin>发布于 2020-05-23 16:56:52
只需删除执行:
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>因为此配置在Maven的generate-sources阶段运行jooq codegen插件。
发布于 2020-05-25 15:07:35
您可以使用配置文件:
<profiles>
<profile>
<id>generate-jooq-code</id>
<plugins>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
...
</plugin>
</plugins>
</profile>
</profiles>然后:
mvn generate-sources -P generate-jooq-codehttps://stackoverflow.com/questions/61969594
复制相似问题