我目前正在开发一个flex应用程序,并且已经使用本机游标支持在特定条件下动态更改游标。
我的应用程序使用Flex Sdk 4.1.0.16076运行,默认情况下使用flash Player10.0。为了使用MouseCursorData类,我在项目首选项中将这个版本升级到了10.2。
它在eclipse中工作得很好,但我使用maven作为依赖项,并且在进行maven构建时出现编译错误,说找不到MouseCursorData类。
这很正常,因为我在我的依赖中使用了player 10。所以我尝试更新我的pom.xml文件,以便将播放器升级到10.2:
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<configuration>
<targetPlayer>10.0</targetPlayer>
<compiledLocales>
<locale>en_US</locale>
<locale>fr_FR</locale>
</compiledLocales>
<warnings>
<noConstructor>false</noConstructor>
</warnings>
<sourceFile>Opale.mxml</sourceFile>
<generateHtmlWrapper>true</generateHtmlWrapper>
<contextRoot>opale-web</contextRoot>
<services>${basedir}/src/main/resources/services-config.xml</services>
<output>target/opale-ui.swf</output>
</configuration>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.sdk.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>首先,我将flex mojo插件中的targetPlayer从10.0更改为10.2。然后我得到编译错误:
在项目opale-ui上执行目标编译(默认编译-swf)失败错误: TargetPlayer和播放器全局依赖版本不匹配!目标玩家: 10.2,全局玩家: 10.0 ->帮助1
所以,我有一个依赖来强制playerglobal版本:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>${flex.sdk.version}</version>
<classifier>10.2.0</classifier>
<type>swc</type>
</dependency>然后,我会出现以下错误:
Downloading: http://repo.maven.apache.org/maven2/com/adobe/flex/framework/playerglobal/4.1.0.16076/playerglobal-4.1.0.16076-10.2.0.swc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.698s
[INFO] Finished at: Wed Sep 12 12:29:57 CEST 2012
[INFO] Final Memory: 9M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project opale-ui: Could not resolve dependencies for project com.igc.opale:opale-ui:swf:1.9-SNAPSHOT: Could not transfer artifact com.adobe.flex.framework:playerglobal:swc:10.2.0:4.1.0.16076 from/to jboss (http://repository.jboss.org/maven2/): Access denied to: http://repository.jboss.org/maven2/com/adobe/flex/framework/playerglobal/4.1.0.16076/playerglobal-4.1.0.16076-10.2.0.swc, ReasonPhrase:Forbidden. -> [Help 1]我刚接触maven,所以可能我做得很糟糕。
发布于 2012-09-12 20:27:49
您可以在插件中配置此功能
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<headlessServer>true</headlessServer>
<verboseStacktraces>true</verboseStacktraces>
<swfVersion>11</swfVersion>
<targetPlayer>10.2</targetPlayer>
...
</configuration>
</plugin>
</plugins>和依赖性:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>4.5.1.21328</version>
<classifier>10.2</classifier>
<type>swc</type>
</dependency>发布于 2012-09-12 20:30:54
如果您搜索sonatype代码库,您将发现您正在查找的实际依赖项是:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>4.1.0.16076</version>
<classifier>10</classifier>
<type>1.swc</type>
</dependency>注意类型的是如何为1.swc的,我相信这是为了弥补早期版本的不足。
https://stackoverflow.com/questions/12386300
复制相似问题