Ant and Flex-4 problem, MXMLC.jar not found!

I upgraded the flex application from flex 3.5 to flex 4.0. We use ant to compile our project, and we have the mxmlc task to handle the flexible part. After the upgrade, our mxmlc task broke down.

Here is the definition of the task:

<taskdef resource="flexTasks.tasks">
        <classpath>
            <pathelement path="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
            <fileset dir="${FLEX_HOME}/lib">
                <include name="**/*.jar"/>
            </fileset>
        </classpath> </taskdef>

And here is the mxmlc task

<mxmlc file="${src}/Main.mxml" output="${build}/main.swf" debug="true" 
target-player="10" services="../src/main/webapp/WEB-INF/flex/services-config.xml" 
context-root="/" >
            <compiler.library-path dir="${lib}">
                <include name="*.swc"/>
            </compiler.library-path>
            <compiler.library-path dir="${FLEX_HOME}/frameworks/libs">
                <include name="*.swc"/>
            </compiler.library-path>

            <compiler.library-path dir="${FLEX_HOME}/frameworks/libs/player/10.0">
                <include name="*.swc"/>
            </compiler.library-path>

            <compiler.library-path dir="${FLEX_HOME}/frameworks/locale">
                <include name="**/*"/>
            </compiler.library-path>
        </mxmlc>

And we get:

The class not found in jar file: mxmlc.jar

I checked the $ {FLEX_HOME} / lib folder and I see the mxmlc.jar file there.

Here is the detailed output of ant:

build.xml:69: The class not found in jar file: mxmlc.jar
    at flex.ant.FlexTask.resolveClass(FlexTask.java:347)
    at flex.ant.FlexTask.executeInProcess(FlexTask.java:273)
    at flex.ant.FlexTask.execute(FlexTask.java:225)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
    at org.apache.tools.ant.Main.runBuild(Main.java:758)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

I appreciate your comments to resolve this issue,

Thanks, -A

+3
source share
6 answers

Upgrading to ant 1.8 resolved the issue.

EDIT: ant 1.8.1 had the same problem, but it is fixed in ant 1.8.2.

0
source

Friend,

flexTask.jar {FLEX HOME}\ ant\lib Ant\lib.

.

+3

zip Adobe SDK, unzip , hudson . chmods FLEX_HOME, .

+1

<!-- CHANGE TO YOUR FLEX DIRECTORY //-->
<property name="FLEX_HOME" value="C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0"/>
<property name="APP_ROOT" value="myApp"/>

<taskdef resource="flexTasks.tasks" >
    <classpath> <pathelement path="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
        <pathelement path="${FLEX_HOME}/lib/flexTasks.jar"/> 
        <fileset dir="${FLEX_HOME}/lib"> 
            <include name="**/*.jar"/>
        </fileset> 
    </classpath>
</taskdef>

<target name="main">
    <antcall target="en_US"></antcall>
    <antcall target="ja_JP"></antcall>
</target>
<target name="en_US">
    <mxmlc>
        <locale>en_US</locale>
        <source-path>../locale/{locale}</source-path>
        <include-resource-bundles>calendarsample</include-resource-bundles>
        <include-resource-bundles>elixirsamplebar</include-resource-bundles>
        <include-resource-bundles>p1browzer</include-resource-bundles>
        <include-resource-bundles>security</include-resource-bundles>
        <include-resource-bundles>setupBundle</include-resource-bundles>
        <include-resource-bundles>customerBundle</include-resource-bundles>
        <include-resource-bundles>orderBundle</include-resource-bundles>
        <output>../bin-debug/Resources_en_US.swf</output>
    </mxmlc>
</target>
<target name="ja_JP">
        <mxmlc keep-generated-actionscript="false">
            <locale>ja_JP</locale>
            <source-path>../locale/{locale}</source-path>
            <compiler.library-path dir="${FLEX_HOME}/frameworks" append="false">
                <include name="libs" />
            </compiler.library-path>
            <include-resource-bundles>calendarsample</include-resource-bundles>
            <include-resource-bundles>elixirsamplebar</include-resource-bundles>
            <include-resource-bundles>p1browzer</include-resource-bundles>
            <include-resource-bundles>security</include-resource-bundles>
            <include-resource-bundles>setupBundle</include-resource-bundles>
            <include-resource-bundles>customerBundle</include-resource-bundles>
            <include-resource-bundles>orderBundle</include-resource-bundles>
            <output>../bin-debug/Resources_ja_JP.swf</output>
        </mxmlc>
    </target>

+1

. , flexTasks.jar $ANT_HOME/lib. , ANT .

+1

, , Ant, Flex sdk.

0

Source: https://habr.com/ru/post/1740312/


All Articles