views:

950

answers:

1

I am writing an Adobe AIR application that needs to build in a CI using maven and nexus. I tried to follow this article which is the most up to date article from the source, but I still don't understand these things:

  1. Are the first and second pom.xml examples in the article in the same pom.xml file?
  2. How do I get the Flex SDK dependencies on my CI?

It would be awesome if someone had a complete project setup and went through the whole thing.

+2  A: 

This blog has some useful information on building Air applications with Maven 2.

As far as your numbered questions are concerned

Part 1: The two POMs in the tutorial are different. The first creates the swf package containing your application components. The second POM has a dependency on the swf package (note the dependency in the second POM for the artifactId Air in the first). The second POM defines processing to unpack the swf package (using the dependency plugin), then uses the exec plugin to invoke adt on the unpacked package contents.

The process described is therefore in two parts. The first POM packages the swf files so they are available in the repository. The second POM will retrieve any packages required from the Maven repository and invoke adt to compile them. So if you have multiple Air packages, the second POM can be modified to download the extra packages and compile them.

Part 2: Most of the dependencies you need are hosted in the Sonatype public repository, one notable exception seems to be the adt.jar. You can deploy the adt.jar to a Maven repository manager such as Nexus using the deploy plugin's deploy-file goal.

This would deploy the adt.jar to the repository with credentials matching the tutorial:

mvn deploy:deploy-file -Durl=http://path/to/repository -DrepositoryId=[some.id]
    -Dfile=adt.jar -DgroupId=com.adobe.flex.compiler -DartifactId=adt
    -Dversion=3.3.0.4852 -DgeneratePom=true -DgeneratePom.description="Flex ADT"

To reference the Nexus public repository, add a repository declaration to your settings.xml or pom.xml like this:

<repositories>
  <repository>
    <id>nexus-public</id>
    <url>http://repository.sonatype.org/content/groups/public&lt;/url&gt;
  </repository>
</repositories>
Rich Seller