首页 > 解决方案 > 包含项目的生成源阶段已损坏

问题描述

我有一个项目在其 pom.xml 中定义了一个模块:

<modules>
    <module>mytestmodule</module>
</modules>

该模块spring-boot-starter-parent用作其父级。此外,该模块在其 pom.xml 中使用插件jooq.codegen-maven从数据库生成源文件:

<plugin>
    <groupId>org.jooq</groupId>
    <artifactId>jooq-codegen-maven</artifactId>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <jdbc>
                    <driver>xxx</driver>
                    <url>xxx</url>
                    <user>xxx</user>
                    <password>xxx</password>
                </jdbc>
                <generator>
                    <target>
                        <packageName>org.jooq.schema</packageName>
                        <directory>src/main/java</directory>
                    </target>
                </generator>
            </configuration>
        </execution>
    </executions>
</plugin>

当我generate-sources从模块目录运行阶段时,它会在模式目录中正确生成源文件。但是,当我从包含项目(父目录)运行命令时,它不仅不会生成源文件,而且还会删除它们。如何解决这个问题?

标签: springmavenjooqjooq-codegen-maven

解决方案


推荐阅读