JOOQ 및 Maven을 처음 사용합니다. JOOQ의 문서에 따르면 스키마를 제공하여 Pojo를 생성하려고합니다. 커맨드 라인 방식으로 시도했지만 완벽하게 작동했습니다. Eclipse java 프로젝트에서 동일한 구성을 추가했다. 아래는 내 pom.mxlJOOQ : Eclipse에서 maven을 사용하여 소스를 생성하면 파일이 생성되지 않습니다.
<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>
리소스를 생성 해 보았습니다. 그것은 BUILD SUCCESS라고 말하지만, 생성 된 Pojos를 어디에서나 볼 수는 없습니다. 제가 누락 된 부분을 알려주세요.
jOOQ 코드 생성기 플러그인을 ''이 아닌''안에 넣어야하는 이유가 있습니까? –
이 태그를 제거하면'플러그인 실행이주기 설정에 포함되지 않습니다 : org.jooq : jooq-codegen-maven : 3.8.4 : generate (실행 : default, phase : generate-sources) ' –
Aha, 내가 참조. 이 잘 알려진 이클립스의 m2e 버그가 있습니다. [사람들은''태그를 사용하여 "수정"을 제안합니다.] (http://stackoverflow.com/q/6352208/521799). 메이븐 빌드. –