SQLJ Apache Ant/Maven Problem
283366May 12 2004 — edited May 18 2004I'm trying to write a Maven Goal to translate .sqlj files into Java and then use the Java compiler to complete the job.
I have produced piece of Ant script to achieve this taks, but have run into a problem with the SQLJ translation pass.
SQLJ is attempting to resolve the imports. In the project that I'm converting there is a set of SQLJ and Java source files, where the SQLJ files import the Java files.
SQLJ only seems to resolve the imports from its classpath, thus can only resolve them from compiled classes.
So, I'm stuck with a chicken and egg situation. JDeveloper does manage to get the ordering of the build correct, so I assume I'm missing something very obvious.
I do not want to restructure the code as I'm only using Maven as a continuous integration tool.
If anyone out there has done something similar, please let me know.
I will post this on the JDeveloper site also.
Thanks
Pat
An example of the Maven goal is as follows :-
<!-- ================================================================== -->
<!-- Oracle SQLJ Compiler -->
<!-- ================================================================== -->
<goal name="sqlj">
<ant:fileset id="sqlj.sources" dir="${pom.build.sourceDirectory}">
<ant:include name="**/*.sqlj"/>
</ant:fileset>
<pathconvert pathsep=" " property="sqlj.sources.files" refid="sqlj.sources"/>
<ant:java classname="sqlj.tools.Sqlj" failonerror="true" fork="yes">
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
<ant:pathelement location="${basedir}/src"/>
</ant:classpath>
<ant:arg line="-status=true"/>
<ant:arg line="-compile=false"/>
<ant:arg line="-explain=true"/>
<ant:arg line="${sqlj.sources.files}"/>
</ant:java>
</goal>