- Validate, Build, Export, and Package Dataspace Projects from the Command Line This page last changed on Dec 01, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Validate, Build, Export, and Package Dataspace Projects from the Command Line This section describes how to validate, build, export and package Oracle Data Service Integrator dataspace projects from the command line. # Topics Data Service File Validation During Deployment Dataspace Packaging from the Command-line Syntax Summary Command-Line Ant Build Targets Command-line Examples using Ant and Java ## Data Service File Validation During Deployment In the Eclipse IDE a dataspace project's data service (.ds) files are validated automatically according to the following deployment model: The publish to server action validates the dataspace projects. All the project's artifacts are collected. The collected artifacts are deployed to the server. The Oracle Data Service Integrator Export mechanism allows for a dataspace project's artifacts to be packaged in a JAR the contents of which are identical to what would be generated from the IDE for deployment to an Oracle WebLogic server. ## Dataspace Packaging from the Command-line There is also an occasional need for operations such as validate, build, export, and package to be available in a scripting environment. This section describes an Ant script file, cmdline_build.xml, provided in the "bin" directory under the Oracle Data Service Integrator installation that can be invoked by a user to: Validate a dataspace project Generate a deployment JAR file of a dataspace project
  | For those not wishing or able to use Ant, Java equivalent command-line options are also described.
## Syntax Summary
Command | Syntax
--- | ---
help | help [ {cmd} | all ]
validate-project | validate-project {project}
validate-dataspace | validate-dataspace {dataspace-path}
export-mediator-client | export-mediator-client {project} {jardir} [jarname[.jar]]
export-ws-client | export-ws-client {project} {jardir} [jarname[.jar]] [ws_locator,...]
export-artifacts | export-artifacts {project} {jardir} [jarname[.jar]]
## Command-Line Ant Build Targets This section describes available Oracle Data Service Integrator ant build targets. ### Build XML File The build XML file: cmdline_build.xml will be provided in the directory: <odsi_home>/bin To see a list of build targets with short descriptions in the Ant build XML file, invoke the command below at the prompt window: ant -f <bea_home>/odsi_10.3/bin/cmdline_build.xml -projecthelp
| Notes It is assumed that Ant is available on your computer and is on your path. Some targets require: ECLIPSE_HOME environment variable points to the Eclipse installation directory. javac be available on the PATH variable. Commands other than "help" involving an Eclipse project requires specification of the Eclipse workspace directory that contains the project. For Java commands the directory is specified via the "-data" option. For Ant command, it is specified as the "-Dworkspace" property.
### "help" The "help" target is the default build target. It shows a list of available Oracle Data Service Integrator commands and the syntax needed to invoke the command in Java.
Command | Syntax
help | help [ {cmd} | "all"]
#### Build Invocation Syntax via Java Note that the syntax shows the portion starting with "odsi_command" below. However, the full syntax to be entered for Java at the prompt window is: java -cp <eclipse_home_dir>/startup.jar org.eclipse.core.launcher.Main -data <workspace_dir> -application com.bea.dsp.ide.app.runCmdline <odsi_command> <cmd_param> ... #### Build Invocation Syntax via Ant If invoked via Ant, Oracle Data Service Integrator command parameters should be specified as Ant properties. For example, to get help about the "export-artifacts" command, enter: ant -f <odsi_install_dir>/bin/cmdline_build.xml help -Dcmd=export-artifacts To get help on all Oracle Data Service Integrator commands, specify the following property:
    -Dcmd=all
or omit the optional -Dcmd property completely: ant -f <odsi_install_dir>/bin/cmdline_build.xml help ### "validate-project" The "validate-project" target validates the data service (.ds) files in the specified dataspace project. Data service error messages that would appear in the Eclipse IDE's Problems view are sent to stdout when this target is invoked. A "fail" status is returned by this target if any error exists in a .ds data service file in the project. ant -f <odsi_install_dir>/bin/cmdline_build.xml -Dworkspace=/bea/projects/myworkspace -Dproject=MyODSIProject validate-project
Command | Syntax
validate-project | validate-project {project}
### "validate-dataspace" The "validate-dataspace" target validates the dataspace project at the specified path. ant -f <odsi_install_dir>/bin/cmdline_build.xml -Ddataspace-path=dataspace-path validate-dataspace
Command | Syntax
validate-dataspace | validate-dataspace {dataspace-path}
### "export-mediator-client" The export-mediator-client target is for generating an Oracle Data Service Integrator mediator client JAR file of a dataspace project. ant -f <odsi_install_dir>/bin/cmdline_build.xml -Dworkspace=/bea/projects/myworkspace -Dproject=MyODSIProject -Djardir=/temp -Djarname=myoutput.jar export-mediator-client The default value of the output JAR file name is: <project>-dsp-client.jar
Command | Syntax
export-mediator-client | export-mediator-client {project} {jardir} [jarname.[jar]]
### "export-ws-client" The export-ws-client target generates a web services mediator client JAR file from the specified comma-separated list of wsmap file locators in a dataspace project. ant -f <odsi_install_dir>/bin/cmdline_build.xml -Dworkspace=/bea/projects/myworkspace -Dproject=MyODSIProject -Djardir=/temp -Djarname=myoutput.jar -Dws_locators=ld:customer.ws,ld:order.ws export-ws-client The default value of the output JAR filename is:
    <project>-ws-client.jar
The default value of the ws_locators is all wsmap file locators in the project. An example of a wsmap file locator is:
    ld:logical/wsmaps/CUSTOMER.ws
Command | Syntax
export-ws-client | export-ws-client {project} {jardir} [jarname[.jar]] [ws_locator,...]
### "export-artifacts" The "export-artifacts" target creates a JAR file containing the definitions and artifacts of the dataspace project. ant -f <odsi_install_dir>/bin/cmdline_build.xml -Dworkspace=/bea/projects/myworkspace -Dproject=MyODSIProject -Djardir=/temp -Djarname=myoutput.jar export-artifacts The content would be identical to the artifact JAR file created in the IDE. By default , the name of the artifact JAR file is: <project>-artifacts.jar
Command | Syntax
export-artifacts | export-artifacts {project} {jardir} [jarname[.jar]]
| Notes ##### Referenced Java Projects Since a dataspace project may reference other Java projects in the same Eclipse workspace, you should make certain that: Referenced projects in your build script are also built. The resulting JAR files and dependent JAR files are copied to the dataspace project's DSP-INF/lib directory. This needs to be done prior to exporting a deployable JAR file using the export-artifacts command in order for all referenced/required JAR files to be included in the artifact JAR file. ##### Invoking Build Commands Without Ant The Ant targets described in the previous sections are actually implemented in Java. So the actual implementation can be invoked at the prompt window using Java directly -- or any script process -- instead of Ant.
## Command-line Examples using Ant and Java This section contains several examples of invoking the Oracle Data Service Integrator command using Ant and Java. ##### Getting the help text of all the commands using Ant and Java at the prompt window Ant: ant -f <bea_home>\odsi_10.3\bin\cmdline_build.xml help -Dcmd=all Java: java -cp <eclipse_home>/eclipse/startup.jar org.eclipse.core.launcher.Main -application com.bea.dsp.ide.app.runCmdline help all ##### Getting the help text of a specific command using Ant and Java at the prompt window Ant: ant -f <bea_home>\odsi_10.3\bin\cmdline_build.xml help -Dcmd=export-artifacts Java: java -cp <eclipse_home>/startup.jar org.eclipse.core.launcher.Main -application com.bea.dsp.ide.app.runCmdline help export-artifacts ##### Exporting the artifacts of a dataspace project This example exports the project:
    DspProj
in workspace:
    /MyWorkspace
to:
    /temp
directory using the default JAR file name:
    <project>-artifacts.jar
Ant: ant -f <bea_home>\odsi_10.3\bin\cmdline_build.xml -Dworkspace=/MyWorkspace -Dproject=DspProj -Djardir=/temp export-artifacts Java: java -cp <eclipse_home>/startup.jar org.eclipse.core.launcher.Main -data /MyWorkspace -application com.bea.dsp.ide.app.runCmdline export-artifacts DspProj /temp

Document generated by Confluence on Jan 13, 2009 15:57