如何使用idlj-maven插件生成java文件



我有一个名为common的项目。我尝试使用idlj-maven插件从IDL文件生成java源代码,但一次又一次失败。我在Idl/文件夹下有多个文件,该文件夹与pom.xml位于同一路径。我有另一个名为channel的项目,其中包含IDL文件,但项目channel中的这些文件使用了使用include共同定义的IDL文件。如何使用idlj-maven插件生成java源代码?我需要使用idlj或jacorb作为编译器吗?我想念什么?谢谢

对于普通项目,我的配置如下:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>idlj-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                  <execution>
                    <goals>
                      <goal>generate</goal>
                    </goals>
                  </execution>
                </executions>
                <configuration>
                    <compiler>jacorb</compiler>
                    <sourceDirectory>Idl</sourceDirectory>
                </configuration>
            </plugin>

JacORB使用idlj-maven插件生成其存根。可以找到插件配置https://github.com/JacORB/JacORB/blob/master/pom.xml#L415hello演示中的一个使用示例是https://github.com/JacORB/JacORB/blob/master/demo/hello/pom.xml#L29

请注意,idl文件存储在src/main/idl/server.idl 中(用于hello演示)

最新更新