如何从Java 9模块导出使用cxg codegen插件生成的所有类?
我有一个没有任何明确来源的模块。此模块包含以下cxf codegen插件配置:如何从Java 9模块导出使用cxg codegen插件生成的所有类?,java,java-9,java-10,java-module,java-platform-module-system,Java,Java 9,Java 10,Java Module,Java Platform Module System,我有一个没有任何明确来源的模块。此模块包含以下cxf codegen插件配置: <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>
${project.build.directory}/schema/wsdl/service.wsdl
</wsdl>
<bindingFiles>
<bindingFile>
${basedir}/src/main/resources/bindings.xml
</bindingFile>
</bindingFiles>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
org.apache.cxf
cxf-codegen插件
${cxf.version}
生成源
生成源
${project.build.directory}/schema/wsdl/service.wsdl
${basedir}/src/main/resources/bindings.xml
wsdl2java
因此,它是对生成的类的依赖。我需要将所有类导出到其他Java模块。比方说,我需要导出com.company.team.app
包。我尝试将它添加到模块info.java
中,但它没有编译,因为它说(实际上是有效的):
module info.java:[6,20]包为空或不存在:
com.company.team.app
那么我如何导出这些类呢?多谢各位 编译阶段
生成源代码
,因此除非您在编译阶段之前看到错误消息(这很奇怪!),否则源代码已经生成
在你的情况下,我会这么做:
- 确保源文件是实际生成的。~>在
之后,您在文件系统中看到它们了吗mvn clean compile
- 确保文件夹包含在要编译的源代码中。~>运行
并查找以“Source root”开头的消息块-需要在此处提及该文件夹。(如果不是,)mvn compile-X
- 确保包名称正确,即生成的包名称和导出的包名称必须相同