![]() |
Sun ONE Connector Builder 2.0 Developer's Guide |
Building/Packaging the Generated Resource AdapterThis module describes the following topics:
- Overview
- The Generated ANT Build XML File
- Preparing to Build/Package the Generated Resource Adapter
- How to Build/Package the Generated Resource Adapter from within the IDE
- How to Build/Package the Generated Resource Adapter from Outside the IDE
- Verifying ANT Execution Output
Overview
Once you have defined and generated a resource adapter, the adapter must be built and packaged before it can be deployed and used. To compile the generated Java files and package the resource adapter into a resource archive (.rar) file, Sun ONE Connector Builder uses ANT. ANT is a Java-based, open-source build tool similar in purpose to the make utility that:
- reads an XML file that contains instructions on how to build one or more targets, or deliverable files, that make up a software system.
- executes the steps necessary to build a specified target or the entire system.
An ANT XML file is generated as part of resource adapter generation. ANT uses this generated XML file to:
- Build (compile) the generated resource adapter source classes.
- Package the generated resource adapter.
- Build and package the SOAP layer.
- Build and package user test cases.
- Generate API documentation for the generated adapter classes.
The Generated ANT Build XML File
The Sun ONE Connector Builder generates the ANT build XML file. The following table lists the major targets. The left column lists the target and the right column provides a description of the target.
Information needed for building and packaging of the generated resource adapter are defined as different properties into the ANT Build XML. You always can customize the build XML by changing the values of these properties.
Preparing to Build/Package the Generated Resource Adapter
The tasks that need to be performed before building and packaging the generated resource adapter are:
- Move the EIS API jar file to the lib directory of the generated resource adapter directory structure. Use the Import Files action in the resource adapter's contextual menu to do this.
- Move the client libraries, .so files or .dll files, to the lib directory of the generated resource adapter directory structure.
- Move any docs, to be packaged, to the docs directory of the generated resource adapter directory structure.
How to Build/Package the Generated Resource Adapter from within the IDE
- From the File browser within the IDE, browse to the generated resource adapter icon.
- Right click on the icon to see the contextual menu.
   Explorer Contextual Message for Packaging
![]()
- Click on the menu option for the type of build you want to perform.
- Output of the execution of the Build XML is displayed in the IDE output window.
How to Build/Package the Generated Resource Adapter from Outside the IDE
The following tasks must be performed to build/package the resource adapter outside of the IDE.
To Build/Package For Windows NT/2000
- Open a command prompt.
- Make sure the ANT runtime is in the path.
- Run the ANT command as ant -buildfile filename [target name]. For example:
ant -buildfile c:\MyAdapter\src\build.xml package
To Build/Package For Solaris
- Open a terminal.
- Make sure ANT runtime is in the path.
- Run the ANT command as ./ant -buildfile filename [target name]. For example
./ant -buildfile /usr/MyAdapter/src/build.xml package
Verifying ANT Execution Output
This section describes how to verify the ANT execution output.
To Verify ANT Execution Output
- Make sure the IDE output window or the command line output contains no errors when you execute the build XML.
- Check whether <adapterlogicalname>.rar file was generated under the ship directory of the generated resource adapter directory structure.
- If SOAP Services were created for this adapter, and one of the package with SOAP options selected, verify that the following jar files were generated under the ship directory:
<adapterlogicalname>-soapdd.jar
<adapterlogicalname>-soapclient.jar