- 浏览: 499095 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
devon.k:
推荐的一种解决方案:https://developer.jbo ...
JBoss应用遇到问题记录 -
liuzl121:
楼主你好,我遇到了你说的第一个问题,能不能详细一些?
JBoss应用遇到问题记录 -
showzh:
...
MySQL5.1列类型 -
zijie110:
...
使用SpringSide的PropertyFilter无法实现 where 属性名1 like '%值1%' or 属性名1 like '%值2%' 的效果 -
JAVA-JVM:
您好,我看了您的一篇文章“用Maven构建Flex4项目实践记 ...
用Maven构建Flex4项目实践记录
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
参考:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
一、相关环境
OS: Ubuntu 9.10
Maven V2.2.1
Flexmojos V3.7.1
Flex SDK 4.1
Adobe AIR 2.0.2 SDK
二、
构建过程
1、似乎目前 Flexmojos 还没有公布创建AIR应用的模板,所以通过其SVN获取AIR应用的样例源码:
simple-air 项目结构如下:
2、修改 simple-air / pom.xml文件:
增加 仓库配置 和 Flexmojos 、FlexSDK 版本属性、指定SDK编译版本等,修改后的 pom.xml 如下:
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2008 Marvin Herman Froeder Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>info.rvin.itest</groupId> <artifactId>simple-air</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>air</module> <module>swf</module> <module>swc</module> </modules> <properties> <flexmojos.version>3.7.1</flexmojos.version> <flex.sdk.version>4.0.0.13555</flex.sdk.version> </properties> <repositories> <repository> <id>flexmojos</id> <url>http://repository.sonatype.org/content/groups/flexgroup/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>flexmojos</id> <url>http://repository.sonatype.org/content/groups/flexgroup/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> <build> <sourceDirectory>src/main/flex</sourceDirectory> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <extensions>true</extensions> <configuration> <targetPlayer>10.0.0</targetPlayer> </configuration> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>${flex.sdk.version}</version> <type>pom</type> </dependency> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>adt</artifactId> <version>${flex.sdk.version}</version> <scope>compile</scope> </dependency> </dependencies> </plugin> </plugins> </build> <dependencies> <!-- Air SDK dependencies --> <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>air-framework</artifactId> <version>${flex.sdk.version}</version> <type>pom</type> </dependency> </dependencies> </project>
3、修改 simple-air / air / pom.xml, simple-air / swf / pom.xml , simple-air / swc / pom.xml 文件中的
%{flexmojos.version}
为
${flexmojos.version}
4、修改 simple-air/air/src/main/resources/descriptor.xml 中的
<application xmlns="http://ns.adobe.com/air/application/1.0">
为
<application xmlns="http://ns.adobe.com/air/application/1.5">
5、编译项目,终端执行:
mvn install
成功后, 在 simple-air/air/target 文件夹下会有成品:simple-air-air-1.0-SNAPSHOT.air,
运行该文件(需已安装AIR runtime),按提示安装并运行,运行结果如下:
至此,构建过程实践成功。
三、
遇到问题与解决
Q1、未修改 simple-air/air/src/main/resources/descriptor.xml 中的
<application xmlns="http://ns.adobe.com/air/application/1.0">
运行 mvn install 时出现错误:
error 305: Intial window content SWF version 10 exceeds namespace version http://ns.adobe.com/air/application/1.0
Q2、修改 simple-air/air/src/main/resources/descriptor.xml 中的 namespace为:
<application xmlns="http://ns.adobe.com/air/application/2.0">
运行 mvn install 时出现错误:
error 102: Invalid namespace http://ns.adobe.com/air/application/2.0
以上2个错误的原因及解决是相通的:
原因:Flash Player , Flex SDK, adt 的版本彼此之间是有关联的,Q1是由于pom.xml指定了Flash Player版本为10 (<targetPlayer>10.0.0</targetPlayer>), Q2是由于pom.xml指定了Flex SDK为4.0.0.13555(<flex.sdk.version>4.0.0.13555</flex.sdk.version>) ,该版本对应的 adt 版本为1.5。
注1:该原因是根据一些资料得出的,更多请参考:
2) http://forums.adobe.com/message/2894373
注2: 目前 flex.sdk.version 版本似乎最高只能是 4.0.0.13555,仓库中 adt 最高只有这个版本。
解决: 将命名空间URL改为:http://ns.adobe.com/air/application/1.5
评论
发表评论
-
Adobe AIR for BlackBerry要点记录
2012-01-20 12:58 15431. 使用AIR开发BlackBerry应用前,有几项前提工作 ... -
Adobe Flex/AIR release记要
2011-11-07 14:46 13341. Flex 1) SDK发布 : Flex ... -
Adobe AIR for iOS开发记录
2011-09-28 10:08 0相关资料: Packager for iPhone (官 ... -
自定义AIR mobile应用的样式或皮肤
2011-11-11 14:44 2461环境: Adobe Flash Builder ... -
iOS开发应用记录
2011-09-28 11:09 2200一、iOS应用设计 1. 参 ... -
Flex进阶持续学习——性能优化
2011-09-03 18:03 3122一. 参考资料 Performance-tuning ... -
开发AIR mobile应用时多设备上的显示处理
2011-08-18 18:48 3922移动设备关于显示效果的问题尤其突出,分辨率、屏幕尺寸各异,处理 ... -
Flex进阶持续学习
2011-07-22 16:49 11971. 生命周期 探究 Flex ... -
Adobe AIR for Android开发记录
2011-06-19 22:17 40051. 通过USB直接连接HTC Desire HD调试AIR ... -
Flex基础——事件
2011-03-31 23:08 714事件驱动是Flex的一大特点,初学者一定要先知道这个。 看了 ... -
Flex/AIR个性化——ProgressBar
2011-03-31 22:25 3551在Spark主题下,ProgressBar 的边框、进度条等都 ... -
Flex/AIR个性化——ToolTip
2011-03-31 11:34 1635编写自己的应用时,自定义ToolTip应该是满常用到的。 定 ... -
《Flex_4:开发RIA_应用程序》学习笔记脑图
2011-02-27 23:11 1208准备今年上半年考个Adobe RIA开发工程师认证,有幸觅得考 ... -
Flex/AIR开发记要——代码篇
2011-01-23 16:45 1693一、样式、皮肤相关 1. 自定义ToolTip,详见 ... -
Flex/AIR加载图片的几种方式
2011-01-23 16:43 2326网觅得,略作修改。 代码如下: (以下环境运 ... -
Flex/AIR开发遇到问题记录
2011-01-10 10:15 17601. 2010-11-? Number 对象 toFixed ... -
Flex/AIR开发记要——规范篇
2010-10-22 18:19 1328一、规范、规则 1、命名: 1)文件名(as类名除 ... -
CheckBoxFileSystemTree的实现笔记
2010-09-26 10:05 0关于Tree的相关参考与copy: Flex中Tree组件的 ... -
用Maven构建Flex4项目实践记录
2010-08-27 14:07 8460------------------------------- ... -
Flex/AIR开发环境之Intellij IDEA篇
2010-08-14 12:39 10877搭建过程如下: 1. 安装 Intellij IDEA ...
相关推荐
使用Maven构建多模块项目
本人博客里面“使用Maven构建Spring MVC项目的简单示例”的源代码
使用maven构建,打包的java项目demo
使用Maven构建JavaWeb项目实例
Maven 构建 项目 文档 java MyEclipse导入Maven项目及注意的事项
maven构建多模块项目,参考:http://blog.csdn.net/xiejx618/article/details/19849035
作为一个JAVA开发者,经常受到技术框架造型的烦恼本篇主要讲解的是maven自动化你的项目,以国外框架组合appfuse和国内springside为主,让你在短短的时间之内把想要的框架集成,并准备开发
这是用Maven 构建多个项目示例代码。
使用Eclipse使用Maven构建web项目视频教程,不包含框架内容
gs-maven, 使用 Maven 构建Java项目 标记项目maven目录你将构建什么。你需要什么。设置了项目项目。定义一个简单的Maven 构建工具。构建Java代码声明依赖项编写测试文件。摘要文件另请参阅本指南引导你使用 Maven
maven构建项目工程,简单构建方便,快速
maven项目构建文档maven项目构建文档maven项目构建文档
maven构建项目可以粘贴的内容
使用 Maven 构建 Web 项目 helloweb
基于Maven构建ssh项目,教程可参考http://www.cnblogs.com/tommychok/p/7340500.html
使用maven构建多模块项目。在一个项目中使用多个模块的一个方法是将模块添加为依赖项,正常情况下,我们会添加一个外部模块作为依赖。但是,当模块是一个项目的一部分,并密切相关的时候,该项目应被构造为一个多...
使用maven构件web项目,部署tomcat
一步一步详细描述用maven构建struts2的HelloWorld程序
使用maven构建多模块项目。在一个项目中使用多个模块的一个方法是将模块添加为依赖项,正常情况下,我们会添加一个外部模块作为依赖 工程由Eclipse环境导入,我用的Eclipse4.7 主工程shushuang-project 子WEB工程...
使用Maven构建SSM项目demo,包含有数据库文件sql。此处做了有关CRUD的一些基本操作。可参考搭建步骤地址:http://blog.csdn.net/baidu_37107022/article/details/78010343