The said problem generally occurs when the FlexMojo’s Maven build environment has not been configured to correctly link both the SilkTest and Adobe automation libraries to the Flex application. The steps that are normally used to link the required automation libraries, i.e. modifying the flex-config.xml, cannot be applied to this type of build environment. As FlexMojo’s does not ship with the Adobe automation libraries or the SilkTest automation library, the user must “install” the automation libraries to their Maven build environment. When this is done, those files are then available to the Maven build environment and they can then be subsequently linked to a Flex application. To install the automation libraries you must first have the relevant files on the build machine, these files are:

- FlexTechDomain.swc
- automation.swc
- automation_rb.swc
- automation_agent.swc
- automation_agent_rb.swc
- datavisualization.swc
- datavisualization_rb.swc

The FlexTechDomain.swc is shipped with SilkTest and can generally be located in the following directory:

 <SilkTest_Directory>\ng\AutomationSDK\Flex\\FlexTechDomain.swc

The other files listed above are shipped with Adobe FlexBuilder for earlier Flex SDK versions or can be retrieved via Adobes website for later versions.


When all the required files have been retrieved, the following commands must be executed to install the automation libraries:


mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=automation -Dversion=3.2.0 -Dpackaging=swc -Dfile=automation.swc

mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=automation_agent -Dversion=3.2.0 -Dpackaging=swc -Dfile=automation_agent.swc

mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=FlexTechDomain -Dversion=3.2.0 -Dpackaging=swc -Dfile=FlexTechDomain.swc

mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=datavisualization -Dversion=3.2.0 -Dpackaging=swc -Dfile=datavisualization.swc


We must also remember to install the locale files for the automation libraries to prevent unexpected compilation errors, to do this execute the following commands:


mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=automation_rb -Dversion=3.2.0 -Dpackaging=swc -Dfile=automation_rb.swc

mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=automation_agent_rb -Dversion=3.2.0 -Dpackaging=swc -Dfile=automation_agent_rb.swc

mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=datavisualization_rb -Dversion=3.2.0 -Dpackaging=swc -Dfile=datavisualization_rb.swc


On completing the above, all the required files for Flex automation should now be available to the FlexMojo’s Maven build environment. In order to “tell” Maven to link the libraries when building the Flex application, we must modify the POM (Project Object Model) which is an XML representation of a Maven project held in a file named “pom.xml”. Open the “pom.xml” in and editor of your choice and modify the dependencies to link the automation libraries, as shown below:

 
  <DEPENDENCIES>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>automation</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>automation_rb</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>automation_agent</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>automation_agent_rb</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>FlexTechDomain</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>datavisualization</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
   <DEPENDENCY>
    <GROUPID>com.adobe.flex.framework</GROUPID>
    <ARTIFACTID>datavisualization_rb</ARTIFACTID>
    <VERSION>3.2.0</VERSION>
    <TYPE>swc</TYPE>
    <SCOPE>internal</SCOPE>
   </DEPENDENCY>
  </DEPENDENCIES> 


The final step is to now build your application by running the following command in your project directory: mvn install You should now have recognition of your Flex application when using SilkTest.