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.
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
The export-mediator-client target is for generating an ALDSP mediator client JAR file of a dataspace project.
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:
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 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 -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 com.bea.dsp.ide.app.runCmdline help export-artifacts
Exporting the artifacts of a dataspace project
This example exports the project:
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