Installing SWC to local repository

10 views
Skip to first unread message

Hannu Leinonen

unread,
May 12, 2008, 11:10:15 AM5/12/08
to Israfil Mojo User Discussions
I have a project which I'm compiling to swc. The project has FlexUnit
unit test cases and the test runner which are compiled to swf. Running
the tests and packaging the swc works perfectly well, but when I'm
about to install the swc to my local repository it is installing the
swf as the swc. Here's what's critical in my POM:

<plugin>
<groupId>net.israfil.mojo</groupId>
<artifactId>maven-flex2-plugin</artifactId>
<version>1.3</version>
<extensions>true</extensions>
<configuration>
<useNetwork>true</useNetwork>
<strict>true</strict>
<warning>true</warning>
</configuration>
<executions>
<execution>
<id>compile-test-swf</id>
<phase>test</phase>
<configuration>
<source>src/test/flex</source>
<extraParameters>
<parameter>
<name>
source-path+=${basedir}/src/main/flex
</name>
</parameter>
</extraParameters>
<finalName>${project.build.finalName}-Test</finalName>
<main>Test.mxml</main>
</configuration>
<goals>
<goal>compile-swf</goal>
</goals>
</execution>
<execution>
<id>compile-swc</id>
<phase>compile</phase>
<goals>
<goal>compile-swc</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<executions>
<execution>
<id>test-swf</id>
<phase>test</phase>
<configuration>
<tasks unless="maven.test.skip">
<!-- Flex Unit Tests -->
<taskdef
resource="com/adobe/ac/ant/tasks/tasks.properties"
classpathref="maven.compile.classpath" />
<flexunit timeout="10000"
swf="${project.build.directory}/${project.build.finalName}-
Test.swf"
toDir="${project.build.directory}/reports" haltonfailure="true"
verbose="true" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

Any ideas how to avoid the plugin to try to install the swf?

Regards,
Hannu

Christian Edward Gruber

unread,
May 12, 2008, 1:17:12 PM5/12/08
to israfil-m...@googlegroups.com
So what's interesting here is that you're not using the plugin to
generate an artifact with a packaging of swf or swc, you're using the
default packaging (which is .jar) and you're manually invoking the
plugin. If you look at the docs, you should be including
<packaging>swc</packaging> in your main pom, at which point you don't
need to have the second execution. You will also find that the final
artifact of the project is a .swc, so it should install the swc
appropriately.

If you create a miniature project (one class, one test) that
illustrates your problem, I can post the correct pom config for it.

By the way, thanks for the config details on flex-unit... you've
helped me think of a way to integrate flex-unit support better than I
had originally been thinking.

Christian

Hannu Leinonen

unread,
May 12, 2008, 5:09:25 PM5/12/08
to israfil-m...@googlegroups.com
Sorry, I wasn't posting the whole POM. Ofcourse the project's packaging
is swc. I have also got an AIR testrunner application which doesn't have
to use the socket to transfer the unit test data, which might be at
least an alternative solution.

Here's a tiny project based on ADOGO's great example.
http://adogo.us/meetings/#2007oct

I removed the Coldfusion things, the mxml files except Test.mxml, moved
the test-specific resources to src/test/flex folder and modified the POM.

Dependency flexunit equals:
http://as3flexunitlib.googlecode.com/files/flexunit-.85.zip
flexunitoptional equals:
http://weblogs.macromedia.com/pmartin/tooling/flexunit/FlexUnitOptional-src.zip
flexunitant equals:
http://weblogs.macromedia.com/pmartin/tooling/flexunit/FlexAntTasks-src.zip

Regards, Hannu

adogo-combo-swc.zip
Reply all
Reply to author
Forward
0 new messages