You can use Apache Ant to compile and build your Java manipulator or content adapter. Alternatively, you can compile and build the project in separate steps, using Java commands.
For
example, to compile the
MBoxAdapter.java
provided with the reference
implementation:
Note
The instructions for creating JAR files for Java manipulators are the same.
Compile the
MBoxAdapter
with javac and theadapter.jar
provided with the CADK in the class path (using a version of javac corresponding to the Java virtual machine version). For example:javac -classpath $ENDECA_ROOT/cadk/lib/adapter.jar MBoxAdapter.java
Create a JAR file from the class files generated by javac, as follows:
jar cf reference-adapter.jar MBoxAdapter.class
If you are compiling a content adapter, enter the path of the JAR file in the path specified in the Java properties class path text box on the Record Adapter editor General tab, on every machine on which Forge will run.
If the JAR file is not found, Forge terminates and logs an error that the content adapter class could not be located similar to the following:
ERR: [Edf]: (AdapterRunner): Adapter class not found: MBoxAdapter WRN: [Adapter Input]: RecordAdapter 'Adapter Input': file 'INPUT' is empty or does not exist. ERR: [Edf]: Forge failed with 1 error and 1 warning.
Forge inserts any logs from the custom adapter’s logger into the Forge log files, specifying that the messages came from the content adapter.
If you are compiling a Java manipulator, enter the path of the JAR file in the path specified in the Class path field on the Java Manipulator editor General tab, on every machine on which Forge will run.