我将flex应用程序从flex 3.5更新为flex 4.0。 我们使用ant来编译我们的项目,我们有一个mxmlc任务来处理flex部分。 升级后,我们的mxmlc任务中断了。
这是任务定义:
<taskdef resource="flexTasks.tasks">
<classpath>
<pathelement path="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<fileset dir="${FLEX_HOME}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath> </taskdef>
这是mxmlc任务
<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>
我们正在接受:
The class not found in jar file: mxmlc.jar
我检查了$ {FLEX_HOME} / lib文件夹,我可以在那里看到mxmlc.jar文件。
这是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)
感谢您对解决此事的意见,
谢谢, -A
答案 0 :(得分:3)
朋友,
请从{FLEX HOME} \ ant \ lib目录复制最新的flexTask.jar文件并粘贴到Ant \ lib。
拉吉。
答案 1 :(得分:1)
我将此问题追溯到Adobe SDK zip文件,使解压缩内容具有不允许我的hudson用户阅读内容的权限。一旦我对已安装的FLEX_HOME中的文件和目录执行了一些chmod,一切正常。
答案 2 :(得分: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>
答案 3 :(得分:1)
我也有这个问题。我发现我的$ ANT_HOME / lib目录中有一个旧的flexTasks.jar。当我删除此文件时,问题中的ANT配置对我有用。
答案 4 :(得分:0)
升级到ant 1.8解决了这个问题。
编辑:Ant 1.8.1遇到了同样的问题,但在Ant 1.8.2中修复了它。
答案 5 :(得分:0)
我遇到了同样的问题,这是因为运行Ant的用户没有对Flex sdk目录的读取权限。