Java JOOQ:generatesourceswithmaven在Eclipse中没有生成任何文件
我对约克和马文是新手。我想通过给出模式来生成Pojo,正如JOOQ的文档所说。我试着用命令行的方式,它工作得很好。我在EclipseJava项目中添加了相同的配置。下面是我的pom.mxlJava JOOQ:generatesourceswithmaven在Eclipse中没有生成任何文件,java,eclipse,maven,jooq,Java,Eclipse,Maven,Jooq,我对约克和马文是新手。我想通过给出模式来生成Pojo,正如JOOQ的文档所说。我试着用命令行的方式,它工作得很好。我在EclipseJava项目中添加了相同的配置。下面是我的pom.mxl <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
<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>PojoGenerator</groupId>
<artifactId>PojoGenerator</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>rutherford.pojo</name>
<build>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<!-- <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin> -->
<!-- Specify the maven code generator plugin -->
<!-- Use org.jooq for the Open Source edition org.jooq.pro for commercial
editions, org.jooq.pro-java-6 for commercial editions with Java 6 support,
org.jooq.trial for the free trial edition -->
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.8.4</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>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1201-jdbc41</version>
</dependency>
</dependencies>
<!-- Specify the plugin configuration. The configuration format is the
same as for the standalone code generator -->
<configuration>
<!-- JDBC connection parameters -->
<jdbc>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/test</url>
<user>postgres</user>
<password>test</password>
</jdbc>
<!-- Generator parameters -->
<generator>
<database>
<name>org.jooq.util.postgres.PostgresDatabase</name>
<includes>.*</includes>
<excludes></excludes>
<inputSchema>public</inputSchema>
</database>
<target>
<packageName>com.generated.pojo</packageName>
<directory>${project.build.directory}/src</directory>
</target>
</generator>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
4.0.0
波发生器
波发生器
0.0.1-快照
卢瑟福·波乔
src
org.jooq
jooq codegen maven
3.8.4
生成
org.postgresql
postgresql
9.4-1201-jdbc41
org.postgresql.Driver
jdbc:postgresql://localhost:5432/test
博士后
测试
org.jooq.util.postgres.PostgresDatabase
.*
公众的
com.generated.pojo
${project.build.directory}/src
我试着生成资源。上面说BUILD SUCCESS,但我在任何地方都看不到生成的POJO。请告诉我我缺少了什么。您仍然需要将插件添加到构建中,因为
只会帮助您声明通用配置以供重用
<build>
<pluginManagement>...</pluginManagement>
<plugins>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<execution>...</execution>
</plugin>
</plugins>
</build>
...
org.jooq
在这种情况下,它可能更简单。有什么原因让你把jOOQ代码生成器插件放在
中,而不是直接放在
中吗?如果我删除这个标签,我会得到这个错误插件执行不在生命周期配置中:org.jOOQ:jOOQ codegen maven:3.8.4:generate(执行:默认,阶段:生成源代码)
Aha,我明白了。有一个众所周知的EclipseM2e错误,但是这改变了Maven构建的语义。