jooq-codegen-maven plugin for different db at the same time

只谈情不闲聊 提交于 2019-12-06 06:04:27

问题


I use jOOQ and MySQL DB in my application. For integration tests I use H2 database and there is a problem. Is there some way to run jooq-codegen-maven plugin twice? I found some maven example for this case. However, in two different cases, I must use two different dependencies. Can I somehow to include dependency in execution?


回答1:


You can have multiple <execution> elements in any Maven plugin configuration, e.g.

<plugin>
  <groupId>org.jooq</groupId>
  <artifactId>jooq-codegen-maven</artifactId>
  <version>3.9.1</version>

  <executions>
    <execution>
      <id>first-generation</id>
      <phase>generate-sources</phase>
      <goals><goal>generate</goal></goals>
      <configuration>
        <!-- jOOQ configuration here -->
      </configuration>
    </execution>

    <execution>
      <id>second-generation</id>
      <phase>generate-sources</phase>
      <goals><goal>generate</goal></goals>
      <configuration>
        <!-- jOOQ configuration here -->
      </configuration>
    </execution>
  </executions>
</plugin>


来源:https://stackoverflow.com/questions/26103628/jooq-codegen-maven-plugin-for-different-db-at-the-same-time

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!