Flex&Maven:如何在pom.xml中升级playerglobal版本(Flex & Maven : How to upgrade playerglobal version in pom.xml)

我目前正在开发一个flex应用程序,并且我已经使用本机游标支持在特定条件下动态更改游标。

我的应用程序使用Flex Sdk 4.1.0.16076运行,默认情况下使用Flash player 10.0。 我已在项目首选项中将此版本升级到10.2,以便使用MouseCursorData类。

它在eclipse中运行正常,但我使用maven作为依赖项,并且在进行maven构建时遇到编译错误,说找不到MouseCursorData类。

这很正常,因为我在我的依赖项中使用了玩家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上执行目标org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:compile-swf(default-compile-swf):TargetPlayer和playerglobal依赖版本不匹配! 目标牌手:10.2,全球玩家:10.0 - > [帮助1]

所以,我有依赖强制播放全球版本:

<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的新手所以也许我这样做非常糟糕。

I'm currently developping an flex application, and i've used native cursor support to dynamically change cursor in particular conditions.

My application runs with Flex Sdk 4.1.0.16076, which use flash player 10.0 by default. I have upgrade this version to 10.2 in project preferences, in order to use MouseCursorData class.

It works fine in eclipse but i'm using maven for dependencies and I have compilation error when doing a maven build, saying MouseCursorData Class can't be found.

It's pretty normal since i'm using player 10 in my dependencies. So I tried to update my pom.xml file for upgrading player to 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>

First, I have changed the targetPlayer in flex mojo plugin from 10.0 to 10.2. Then I obtain the compilation error :

[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:compile-swf (default-compile-swf) on project opale-ui: TargetPlayer and playerglobal dependency version doesn't match! Target player: 10.2, player global: 10.0 -> [Help 1]

So, i had a dependency to force playerglobal version :

<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>playerglobal</artifactId> <version>${flex.sdk.version}</version> <classifier>10.2.0</classifier> <type>swc</type> </dependency>

Then, i have the following error :

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]

I new to maven so maybe i'm doing this pretty badly.

最满意答案

您可以在插件中配置它

<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>

You can configure this in plugins

<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>

And dependency:

<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>playerglobal</artifactId> <version>4.5.1.21328</version> <classifier>10.2</classifier> <type>swc</type> </dependency>Flex&Maven:如何在pom.xml中升级playerglobal版本(Flex & Maven : How to upgrade playerglobal version in pom.xml)

我目前正在开发一个flex应用程序,并且我已经使用本机游标支持在特定条件下动态更改游标。

我的应用程序使用Flex Sdk 4.1.0.16076运行,默认情况下使用Flash player 10.0。 我已在项目首选项中将此版本升级到10.2,以便使用MouseCursorData类。

它在eclipse中运行正常,但我使用maven作为依赖项,并且在进行maven构建时遇到编译错误,说找不到MouseCursorData类。

这很正常,因为我在我的依赖项中使用了玩家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上执行目标org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:compile-swf(default-compile-swf):TargetPlayer和playerglobal依赖版本不匹配! 目标牌手:10.2,全球玩家:10.0 - > [帮助1]

所以,我有依赖强制播放全球版本:

<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的新手所以也许我这样做非常糟糕。

I'm currently developping an flex application, and i've used native cursor support to dynamically change cursor in particular conditions.

My application runs with Flex Sdk 4.1.0.16076, which use flash player 10.0 by default. I have upgrade this version to 10.2 in project preferences, in order to use MouseCursorData class.

It works fine in eclipse but i'm using maven for dependencies and I have compilation error when doing a maven build, saying MouseCursorData Class can't be found.

It's pretty normal since i'm using player 10 in my dependencies. So I tried to update my pom.xml file for upgrading player to 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>

First, I have changed the targetPlayer in flex mojo plugin from 10.0 to 10.2. Then I obtain the compilation error :

[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:compile-swf (default-compile-swf) on project opale-ui: TargetPlayer and playerglobal dependency version doesn't match! Target player: 10.2, player global: 10.0 -> [Help 1]

So, i had a dependency to force playerglobal version :

<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>playerglobal</artifactId> <version>${flex.sdk.version}</version> <classifier>10.2.0</classifier> <type>swc</type> </dependency>

Then, i have the following error :

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]

I new to maven so maybe i'm doing this pretty badly.

最满意答案

您可以在插件中配置它

<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>

You can configure this in plugins

<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>

And dependency:

<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>playerglobal</artifactId> <version>4.5.1.21328</version> <classifier>10.2</classifier> <type>swc</type> </dependency>