Content starts here Validate, Build, Export, and Package Dataspace Projects from the Command Line
This page last changed on Feb 26, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

How To Validate, Build, Export, and Package Dataspace Projects from the Command Line

This section describes how to validate, build, export and package ALDSP dataspace projects from the command line. 


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:

  • When a user wants to deploy a dataspace project to a WebLogic server using the Deploy Project option, all the Java projects referenced by the dataspace project are built.
  • The output files are packaged in JAR files (one per referenced Java project) in the dataspace project's DSP-INF/lib directory during deployment.
  • The deploy action validates the dataspace project.
  • All the project's artifacts are collected.
  • The collected artifacts are deployed to the server.

The ALDSP 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 a 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 ALDSP 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} | dsp30:all ]
validate-project validate-project {project}
export-mediator-client export-mediator-client {project} {jardir} [jarname[dsp30:.jar]]
export-ws-client export-ws-client {project} {jardir} [jarname[dsp30:.jar]]  [dsp30:ws_locator,...]
export-artifacts export-artifacts {project} {jardir} [jarname[dsp30:.jar]]

Command-Line Ant Build Targets

This section describes available ALDSP ant build targets.

Build XML File 

The build XML file:


will be provided in the directory:


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>/aldsp_3.0/bin/cmdline_build.xml -projecthelp

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


The "help" target is the default build target.  It shows a list of available ALDSP commands and the syntax needed to invoke the command in Java.

Command Syntax
help help [ {cmd} | dsp30:"all"]

Build Invocation Syntax via Java

Note that the syntax shows the portion starting with "aldsp_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 <aldsp_command> <cmd_param> ...

Build Invocation Syntax via Ant

If invoked via Ant, ALDSP command parameters should be specified as Ant properties.  For example, to get help about the "export-artifacts" command, enter:

ant -f <aldsp_install_dir>/bin/cmdline_build.xml help -Dcmd=export-artifacts

To get help on all ALDSP commands, specify the following property:


or omit the optional -Dcmd property completely:

ant -f <aldsp_install_dir>/bin/cmdline_build.xml help all


The "validate-project" target validates the data service (.ds) files in the specified dataspace project.  Data service error messages that would show up 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 <aldsp_install_dir>/bin/cmdline_build.xml -Dworkspace=/bea/projects/myworkspace   -Dproject=MyFirstDspProject validate-project

validate-project {project}


The export-mediator-client target is for generating an ALDSP mediator client JAR file of a dataspace project. 

The default value of the output JAR file name is:


export-mediator-client export-mediator-client {project} {jardir} [dsp30:jarname.jar]


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. 

The default value of the output JAR filename is:


The default value of the ws_locators is all wsmap file locators in the project.

An example of a wsmap file locator is:

export-ws-client export-ws-client {project} {jardir} [jarname[dsp30:.jar]]  [dsp30:ws_locator,...]


The "export-artifacts" target creates a JAR file containing the definitions and artifacts of the dataspace project. The content would be identical to the artifact JAR file created in the IDE.  By default , the name of the artifact JAR file is:


export-artifacts {project} {jardir} [jarname[dsp30:.jar]]
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 ALDSP command using Ant and Java.

Getting the help text of all the commands using Ant and Java at the prompt window


ant -f <bea_home>\aldsp_3.0\bin\cmdline_build.xml help -Dcmd=all


java -cp <eclipse_home>/eclipse/startup.jar org.eclipse.core.launcher.Main -application help all

Getting the help text of a specific command using Ant and Java at the prompt window


ant -f <bea_home>\aldsp_3.0\bin\cmdline_build.xml help -Dcmd=export-artifacts


java -cp <eclipse_home>/startup.jar org.eclipse.core.launcher.Main -application help export-artifacts

Exporting the artifacts of a dataspace project

This example exports the project: 


in workspace:




directory using the default JAR file name:



ant -f <bea_home>\aldsp_3.0\bin\cmdline_build.xml -Dworkspace=/MyWorkspace -Dproject=DspProj -Djardir=/temp export-artifacts


java -cp <eclipse_home>/startup.jar org.eclipse.core.launcher.Main -data /MyWorkspace -application export-artifacts DspProj /temp

Document generated by Confluence on Apr 28, 2008 15:54