Sun ONE logo     Previous      Contents      Index      Next     
Sun ONE Connector Builder 2.0 Developer's Guide



Building/Packaging the Generated Resource Adapter

This module describes the following topics:

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.

   ANT Build XML File Targets

Target

Description

build

 

Builds the generated resource adapter sources and user test cases, if they exist, and puts the compiled sources under the build directory of the generated adapter

 

buildall

 

Deletes existing compiled sources and then repeats the build operation

 

package

 

Packages the Generated Adapter, without SOAP and test cases, into a .rar file

 

packagewithtests

 

Packages the Generated Adapter and test cases, but not SOAP

 

packagewithsoap

 

Packages the Generated Adapter and SOAP, but without test cases, into a .rar file

 

packagewithtestsandsoap

 

Packages the Generated Adapter, SOAP, and test cases

 

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:

  1. 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.


  2. Note

    Before regeneration, the Sun ONE Connector Builder checks every generated component individually. If you selectively delete certain files, only those files will be generated in subsequent generations. The remaining files will be left undisturbed provided you have not altered the adapter definition in a way that requires the files to be regenerated



  1. Move the client libraries, .so files or .dll files, to the lib directory of the generated resource adapter directory structure.
  2. 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

  1. From the File browser within the IDE, browse to the generated resource adapter icon.
  2. Right click on the icon to see the contextual menu.

   Explorer Contextual Message for Packaging


Figure shows Explorer Contextual Message for Packaging

  1. Click on the menu option for the type of build you want to perform.
  2. 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

  1. Open a command prompt.
  2. Make sure the ANT runtime is in the path.
  3. Run the ANT command as ant -buildfile filename [target name]. For example:
  4. ant -buildfile c:\MyAdapter\src\build.xml package

To Build/Package For Solaris

  1. Open a terminal.
  2. Make sure ANT runtime is in the path.
  3. Run the ANT command as ./ant -buildfile filename [target name]. For example
  4. ./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

  1. Make sure the IDE output window or the command line output contains no errors when you execute the build XML.
  2. Check whether <adapterlogicalname>.rar file was generated under the ship directory of the generated resource adapter directory structure.
  3. 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:
  4. <adapterlogicalname>-soapdd.jar

    <adapterlogicalname>-soapclient.jar


Previous      Contents      Index      Next     
Copyright 2002 Sun Microsystems, Inc. All rights reserved.