Search code examples
javamavencorbaidl

maven: run idlj command before compiling code


I am working on a CORBA project using maven build. Before maven starts compilation, the idl needs to be processed to generate some java source files. I have tried the idlj-maven-plugin but it doesn't allow me to override "-fallTIE" argument. So what other ways run idlj compiler command from maven before maven starts the compilation phase?


Solution

  • I managed to find some hints on the internet on the way to do this using the exec-maven-plugin. Here is the plugin configuration you have to add in the project's pom.xml

           <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>process-idl</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>idlj</executable>
                            <commandlineArgs>-fall -td ${project.build.directory}/generated-sources/idl src/main/idl/HelloWorld.idl</commandlineArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>