How to properly define the Flashbuilder 4.5 Premiu

2019-06-06 16:50发布

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.

3条回答
家丑人穷心不美
2楼-- · 2019-06-06 17:03

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.

查看更多
放荡不羁爱自由
3楼-- · 2019-06-06 17:09

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

查看更多
劳资没心,怎么记你
4楼-- · 2019-06-06 17:11

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.

查看更多
登录 后发表回答