1

We have been building our Flex app forever using Maven. Due to the fact that we use RIATest for integration testing we need to create a special test version of the app with the RIATest agent compiled in it and with the Flex automation libraries available. Apparently for the latter we need to provide the flex compiler with our license since this is only available from a version higher than Standard.

Up until Flex 4.0 and RIATest 3.8 this worked fine, we had our license information defined in a flex-config file in the user home directory.

However currently with the combination Flex 4.5 and RIATest 4 we are having problems, the tests always fail with "License not present. With the trial version only limited replays are allowed."

We have tried multiple variations of defining the license key for Flashbuilder 4.5 but we have had no success. Currently our flexmojo configuration in the POM references an external flex-config file and there we try to define the license key.

Boris Terzic
  • 10,858
  • 8
  • 45
  • 59
  • Wait, you're saying you need a license for the automation library? Can't say I've seen that personally. Can you please post your pom? Are you talking about Flash Builder license or RIATest license? – J_A_X Aug 09 '11 at 23:40
  • You need a Flash Builder license higher than Standard in order to use the automation library for automated testing. – Boris Terzic Aug 11 '11 at 08:15

3 Answers3

2

Using flexmojos 3.8, RIATest 4 and the Flex SDK 4.5.1 we have figured out a solution.

First off it turns out that we had a stray configuration lying around in the

.adobe/Flex/license.properties

file in the Jenkins user's home directory on the build server. It's important to know that configuration from here gets automatically included in builds by flexmojos. So if you want to make sure you have a nice isolated build with no external dependencies, remove this file.

Then we figured out that we can reference an external flex-config.xml file from the flexmojo configuration like so:

<execution>
  <id>build-release-version</id>
  <phase>compile</phase>
  <goals>
    <goal>compile-swf</goal>
  </goals>
  <configuration>
    <configFiles> 
      <configFile>flex-config.xml</configFile> 
    </configFiles> 
  </configuration>
</execution>

Inside the flex-config.xml file you need to use the following license syntax:

<licenses>
   <license>
      <product>flashbuilder45</product>
      <serial-number>LICENSE CODE</serial-number>
   </license>
</licenses>

And now for the final kicker: the LICENSE CODE we need to use in the serial-number element is NOT the license number that we got from Adobe (and that we use when installing the Flash Builder tooling) but it is a derived form of that license number that can be found for example in the license.properties file of a developer that has Flash Builder installed. This derived license number does not resemble the original license number and has no dashes.

Mysterious.

Boris Terzic
  • 10,858
  • 8
  • 45
  • 59
  • Hi, we have a similar problem but with Flash Builder 4.6 I have been unable to locate the license.properties file you mention. Additionnally, does specifying the configFile as you do force you to specify the whole config in your flex-config.xml ? does flex-mojo merge it with the configuration from the pom ? – Jean Jan 26 '12 at 17:51
  • I don't know whether using "configFile" requires your entire config to be in there, but I assume so. When in doubt look at the source code for the maven plugin. – Boris Terzic Jan 30 '12 at 08:19
  • 1
    thanks, I experimented some more and found that when providing config in the pom the configFile is ignored. In the end I had to change the section in my pom to provide my flashbuilder45 S/N, manually deploy the corresponding license.jar to our nexus repository _AND_ copy the license.properties generated by flashbuilder over to the continuous integration server. Removing any of these would yield the trial limit when running RIA tests. (we use flashbuilder 4.6) – Jean Jan 30 '12 at 09:36
0

It seems that you can define it directly in Flexmojos configuration itself without the need for an external file like so:

<configuration>
  <licenses>
    <flashbuilder45>LICENSE CODE</flashbuider45>
  </licenses>
</configuration>

Note as @Boris said, you need to take the derived license number you can get after installing FlashBuilder (See About configuration files for locations for each OS where this file can be found).

Wim Deblauwe
  • 25,113
  • 20
  • 133
  • 211
0

Well we defined our flexmojo (4.0-RC1) configuration this way:

            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>${flexmojos.version}</version>
                <configuration>
                    <debug>${flex.debug}</debug>
                    <swfVersion>11</swfVersion>
                    <licenses>
                        <flashbuilder4>${flex.serial-number}</flashbuilder4>
                    </licenses>
                    <themes>
                        <theme>
                            ${settings.localRepository}/com/adobe/flex/framework/framework/${flex.version}/configs_zip/themes/Spark/spark.css
                        </theme>
                    </themes>
                    <rslUrls>
                        <url>rsl/{artifactId}-{version}.{extension}</url>
                    </rslUrls>
                </configuration>
                <dependencies>
                    <!-- This handles a bug in maven which causes problems with flex resources -->
                    <dependency>
                        <groupId>org.sonatype.flexmojos</groupId>
                        <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
                        <version>${flexmojos.version}</version>
                    </dependency>
                    <!-- Without this FM will use the compiler configured in its
                    master pom, which will result in version conflicts -->
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>${flex.version}</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
            </plugin>

With this I am able to build Applications using Flex SDK 4.5.0.20967 using my FlashBuilder 4 Key ... don't know if something has changed with the 4.5 Keys.

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34