I figured it out. I moved the jacorb-idl-compiler dependency to the plugin definition. This the trick.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my-project</groupId> <artifactId>idl</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>idl</name> <url>http://maven.apache.org</url> <dependencies> - <dependency> - <groupId>org.jacorb</groupId> - <artifactId>jacorb-idl-compiler</artifactId> - <version>2.2.3</version> - </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>idlj-maven-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.jacorb</groupId> + <artifactId>jacorb-idl-compiler</artifactId> + <version>2.2.3</version> + </dependency> + </dependencies> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <compiler>jacorb</compiler> <sources> <source> <includes> <include>*.idl</include> </includes> </source> </sources> </configuration> </plugin> </plugins> </build> </project> Duke Banerjee <[EMAIL PROTECTED]> wrote: Hi, I'm trying to migrate a project from ant to maven. This project has a number of IDL files which we compile using the JacORB IDL compiler. I found a Maven plugin, idlj-maven-plugin, which takes jacorb as a compiler. I put together the following directory structure: idl |-- pom.xml `-- src `-- main `-- idl `-- [a number of idl files] The pom.xml looks like this: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my-project</groupId> <artifactId>idl</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>idl</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.jacorb</groupId> <artifactId>jacorb-idl-compiler</artifactId> <version>2.2.3</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>idlj-maven-plugin</artifactId> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <compiler>jacorb</compiler> <sources> <source> <includes> <include>*.idl</include> </includes> </source> </sources> </configuration> </plugin> </plugins> </build> </project> When I issue the following command: mvn -e package Maven produces the following output: + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building idl [INFO] task-segment: [package] [INFO] ---------------------------------------------------------------------------- [INFO] [idlj:generate {execution: default}] [INFO] Processing: /home/tinker/maven_test/idl/src/main/idl/ForwardModel.idl [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] JacORB IDL compiler not found Embedded error: org.jacorb.idl.parser [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: JacORB IDL compiler not found at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: JacORB IDL compiler not found at org.codehaus.mojo.idlj.JacorbTranslator.invokeCompiler(JacorbTranslator.java:177) at org.codehaus.mojo.idlj.AbstractIDLJMojo.processSource(AbstractIDLJMojo.java:121) at org.codehaus.mojo.idlj.AbstractIDLJMojo.execute(AbstractIDLJMojo.java:110) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) ... 16 more Caused by: java.lang.ClassNotFoundException: org.jacorb.idl.parser at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195) at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255) at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274) at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.codehaus.mojo.idlj.JacorbTranslator.invokeCompiler(JacorbTranslator.java:175) ... 20 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO] Finished at: Wed Apr 25 11:21:57 MDT 2007 [INFO] Final Memory: 3M/7M [INFO] ------------------------------------------------------------------------ Am I missing something here? Let me know if any more information would be useful. Thanks! Duke
