简体   繁体   English

如何使用idlj-maven-plugin生成Java文件

[英]how to use idlj-maven-plugin to generate java files

I have one project called common. 我有一个项目叫common。 I tried to generate java source code from IDL files using idlj-maven-plugin, but failed again and again. 我尝试使用idlj-maven-plugin从IDL文件生成Java源代码,但一次又一次失败。 I have multiple files under Idl/ folder which is at the same path as pom.xml. 我在Idl /文件夹下有多个文件,该文件与pom.xml处于同一路径。 I have another project called channel containing IDL files, but those files in project channel use the idl files defined in common using include. 我还有一个名为channel的项目,其中包含IDL文件,但是项目通道中的那些文件使用的IDL文件通常是使用include定义的。 how can I generate java source code using idlj-maven-plugin? 如何使用idlj-maven-plugin生成Java源代码? Do I need to use idlj or jacorb as compiler? 我需要使用idlj或jacorb作为编译器吗? What do I miss? 我想念什么? Thanks! 谢谢!

For project common, my configuration is as below: 对于普通项目,我的配置如下:

<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 uses idlj-maven-plugin to generate its stubs. JacORB使用idlj-maven-plugin生成其存根。 The plugin configuration can be found https://github.com/JacORB/JacORB/blob/master/pom.xml#L415 and an example of its usage within the hello demo is https://github.com/JacORB/JacORB/blob/master/demo/hello/pom.xml#L29 可以在https://github.com/JacORB/JacORB/blob/master/pom.xml#L415中找到该插件配置,并且在hello演示中其用法的示例是https://github.com/JacORB/JacORB/ BLOB /主/演示/你好/ pom.xml的#L29

Note that the idl file is stored within (for the hello demo) src/main/idl/server.idl 请注意,idl文件存储在src / main / idl / server.idl中(用于hello演示)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM