Hi Guys,

I invested several days in extending Flexmojos to use the flex-sdk-converter 
(AKA Mavenizer). I ended up with a version of Flexmojos that allowed to build 
flex applications without any dependencies at all (compiler, player/airglobal, 
framework were added automatically). By setting some properties flexmojos would 
auto-download the resources and convert them. I even managed to have the 
compiler resources automatically added to the plugin classpath.


The huge downside of this approach is that other maven plugins don't deal 
really well with this. For example the dependency:tree plugin doesn't show the 
libs and IntelliJ doesn't either. I was also really worried that I was working 
around mavens dependency resolutions strategies which could mess up some things 
big time.


I therefore tried something completely different. I created a core maven 
extension. You can think of this as a plugin for maven itself. With this I 
added a Maven "EventSpy" which monitors Maven for resolution requests to Flex 
related artifacts. If one of these fail to resolve, the SDK Converter kicks in 
to download, convert and install the artifacts. Depending on the Maven version 
you are using this has to be installed slightly different.


-------------------------------------------------------------

If you are using Maven 3.3.1 or above (Yeah ... not too much above that yet ;-):

-------------------------------------------------------------

- create a ".mvn" directory in your projects root.

- create an "extensions.xml" inside that directory with the following content

<?xml version="1.0" encoding="UTF-8"?>
<extensions>
    <extension>
        <groupId>org.apache.flex.utilities.converter</groupId>
        <artifactId>maven-extension</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </extension>
</extensions>

-------------------------------------------------------------

If you are using Maven below 3.3.1

-------------------------------------------------------------

Copy the flex-maven-extension jar to your MAVEN_HOME/lib/ext directory
(Have to do a little more testing with this though ... the 3.3.1 approach 
should work)


So you should be able to build the above project without having ANYTHING 
related to flex installed by executing:

mvn install

I did change 2 minor things in the current sdk-converter though ... FDKs now 
have three digit versions an no longer contain the build number ... so instead 
of using 4.14.1.20150325 you just use 4.14.1 instead. Additionally now for the 
flash sdk a "com.adobe.flash:framework:pom" is created in order to have all sdk 
parts in sync.

Really glad I didn't release the converter the first time ;-)

Have Fun, looking forward for feedback

    Chris






Reply via email to