Wednesday, June 17, 2009

Running RMIC via ant

Netbeans, does not support RMI-based project quite well especially on generating stub files using RMIC. However, we can always tweak the build-impl.xml script to run RMIC. To generate stub files, RMIC must be executed after class compilation finished. Thus, the most appropriate place to run it is in -post-compile target. Here is a snippet on how to invoke RMIC in -post-compile target. I found this trick somewhere, but I forget where I found it.

<target name="-post-compile">
        <rmic base="${build.classes.dir}" includes="com/jbs/RMIServiceImpl.class"/>
</target>



Hope this could help someone who got problem with RMI project in Netbeans.

No comments: