Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search

COSMOS Change Analyzer Build Instructions

Building Change Analyzer

NOTE: These instructions are valid until we are able to remove the dependency on Tuscany and can fully integrate the Change Analyzer with the COSMOS Tooling SPI. (updated on 14 August 2008)

Using Eclipse SDK 3.4.0…

  • Checkout the project from
  • Right click in the CVS Repositories perspective in Eclipse, and select Paste Connection. Then all you have to do is copy in the path above.
  • Unzip the required jars from
  • NOTE: Please contact Jason Losh ( to obtain the file.
  • Put these jars into a directory that you can reference later.
  • Right click on project in Eclipse, select Build Path > Configure Build Path.
  • On the Libraries tab, select all the variables listed, and click Remove.
  • Then click Add External JARs….
  • Select all the jars you unzipped earlier and click Open.
  • Once they are all added to the list, you can click on OK.
  • The project should start to build.

There are a few settings that you may want to change, especially if you are using JRE 1.5, so that you aren’t bombarded with duplicate warnings.

  • In the main eclipse menu bar, click on Window > Preferences. When the Preferences dialog comes up on the left hand side select Java > Compiler > Errors/Warnings. The following changes are suggested:
    • Under Potential programming problems, change the first item, Serializable class without serialVersionUID: to Ignore.
    • Under Deprecated and restricted API, change the first item, Deprecated API: to Ignore.
    • Under Generic types, change the first item, Unchecked generic type operation: and the second item, Usage of a raw type: to Ignore.
  • Click Apply. The project should start to build again. When it’s finished you can click OK.

Running Change Analyzer

  • First, you will need a SDD deployment descriptor and a SDD package descriptor. I took the shopping cart example from the Change Analyzer documentation and fixed it so it would validate. I had to point it to local copies of my SDD CL1 schemas because the official schema files do not have the right URL’s in them. I also had to add a couple of “id” attributes to the resource constraints.
  • Next, create a file, and include the following properties (make sure to use “/” for path separators):
SDD_INPUT_FILE=<Path to deployment descriptor xml>
PKG_INPUT_FILE=<Path to package descriptor xml>
OUTPUT_FILE_PATH=<Path to some directory where you want the output files to go>
  • There are two places in the code that you will need to update, so that you will be able to run from the repository successfully.
    • In you need to update the copyFiles method to match the following:
 * @param outputFilePath
 public void copyFiles(String outputFilePath) {
   // Source File
   String source = "/";
   File f = new File(source);
   if(!f.exists()) {
      source = "/org/eclipse/cosmos/me/internal/deployment/sdd/resources/runtime/ca/plus.gif";
   String source1 = "/";
   String source2 = "/";
   f = new File(source1);
   if(!f.exists()) {
      source1 = "/org/eclipse/cosmos/me/internal/deployment/sdd/resources/runtime/ca/minus.gif";
   f = new File(source2);
   if(!f.exists()) {
      source2 = "/org/eclipse/cosmos/me/internal/deployment/sdd/resources/runtime/ca/chg.css";
   // Destination File
   String dest = outputFilePath + "plus.gif";
   String dest1 = outputFilePath + "minus.gif";
   String dest2 = outputFilePath + "chg.css";
   copyTo(source , dest);
   copyTo(source1 , dest1);
   copyTo(source2 , dest2);
    • You will also need to add an import; statement to this file.
    • In you need to update the transformToHtml method to match the following:
 * Tranforms the xml file to html using the xsl
 * @param outputFilePath -
 *            output path where the generated XSL file should be present
 public void transformToHtml(String outputFilePath) {
   TransformerFactory tf = TransformerFactory.newInstance();
   Transformer xsl;
   try {
      InputStream in = getClass().getResourceAsStream(
      if(in == null) {
	   in = getClass().getResourceAsStream(
      xsl = tf.newTransformer(new StreamSource(in));
      xsl.transform((new StreamSource(outputFilePath.trim()
                     + StringConstants.CA_XML_INPUT)), (new StreamResult(
	               outputFilePath.trim() + StringConstants.CA_HTML_OUTPUT)));
   } catch (TransformerConfigurationException e) {
   } catch (TransformerException e) {
  • Once these changes have been saved, in Eclipse go to Run > Debug Configurations and on the dialog that pops up, select the Arguments tab. Enter the path to the file that you created earlier.
  • You should also set a breakpoint on line 60 in, which will get the debugger to stop at the very beginning of the execution.
  • You should now be able to use the Debugger button on the main Eclipse Toolbar to run the Change Analyzer in debug mode.

Back to the top