运行graphql-java-codegen Maven插件时失败缺少outputDir

问题描述

我一直在尝试使用graphql-java-codegen生成Java模型,但是即使outputDir的配置正确,我也遇到了与缺少目标的outputDir相关的错误。不知道我是否缺少任何步骤。任何帮助都会很棒。

这是插件配置:

            <plugin>
                <groupId>io.github.kobylynskyi</groupId>
                <artifactId>graphql-codegen-maven-plugin</artifactId>
                <version>2.4.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <!-- all config options:
                            https://github.com/kobylynskyi/graphql-java-codegen/blob/master/docs/codegen-options.md
                            -->
                            <graphqlSchemas>
                                <includePattern>${project.basedir}/src/main/resources/schema.graphql</includePattern>
                            </graphqlSchemas>
                            <outputDir>${project.build.directory}/generated-sources/graphql</outputDir>
                            <apiPackageName>com.graphql.demo.api</apiPackageName>
                            <modelPackageName>com.graphql.demo.model</modelPackageName>
                            <customTypesMapping>
                                <DateTime>java.util.Date</DateTime>
                            </customTypesMapping>
                            <modelNameSuffix>TO</modelNameSuffix>
                            <parentInterfaces>
                                <queryResolver>graphql.kickstart.tools.GraphQLQueryResolver</queryResolver>
                                <mutationResolver>graphql.kickstart.tools.GraphQLMutationResolver</mutationResolver>
                                <subscriptionResolver>graphql.kickstart.tools.GraphQLSubscriptionResolver</subscriptionResolver>
                                <resolver><![CDATA[graphql.kickstart.tools.GraphQLResolver<{{TYPE}}>]]></resolver>
                            </parentInterfaces>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

我用来运行插件的生成目标的命令是 mvn graphql-codegen:generate

但是我遇到以下错误:

Failed to execute goal io.github.kobylynskyi:graphql-codegen-maven-plugin:2.4.0:generate (default-cli) on project graphql-demo: The parameters 'outputDir' for goal io.github.kobylynskyi:graphql-codegen-maven-plugin:2.4.0:generate are missing or invalid -> [Help 1]

不确定为什么无法在插件配置中读取指定的 outputDir

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...