qickrooms / flex-mojos

Automatically exported from code.google.com/p/flex-mojos
0 stars 0 forks source link

compiler mojo with rb.swc types and locales other than en_US fail #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My project use fr_FR locale and flex-mojo 2.0-alpha4

The compiler mojo fail with the following error because a rb.swc for fr_FR
locale. It will be better to catch the exception if a resources artifact
doesn't exist instead of this exception.

java.lang.ClassCastException: java.io.File
        at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonMa
nager.java:305)
        at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifa
ctResolver.java:200)
        at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifa
ctResolver.java:74)
        at
info.rvin.flexmojos.utilities.MavenUtils.resolveArtifact(MavenUtils.java:173)
        at
info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo.getResourcesBundles(Ab
stractFlexCompilerMojo.java:1429)
        at
info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo.configure(AbstractFlex
CompilerMojo.java:1015)
        at
info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo.setUp(AbstractFlexComp
ilerMojo.java:924)
        at
info.rvin.mojo.flexmojo.compiler.LibraryMojo.setUp(LibraryMojo.java:175)
        at
info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:143)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.ja
va:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
eExecutor.java:558)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(Def
aultLifecycleExecutor.java:499)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycle
Executor.java:478)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:330)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultL
ifecycleExecutor.java:291)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExec
utor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Original issue reported on code.google.com by emmanuel...@gmail.com on 25 Aug 2008 at 11:56

GoogleCodeExporter commented 9 years ago
This ClassCastException is not related to dependency resolution.  When 
dependency
resolution fails it throws a AbstractArtifactResolutionException.

Probably is some maven bug.  What version are you using?

VELO

Original comment by velo...@gmail.com on 25 Aug 2008 at 12:49

GoogleCodeExporter commented 9 years ago
I use maven 2.0.9

Original comment by emmanuel...@gmail.com on 25 Aug 2008 at 1:03

GoogleCodeExporter commented 9 years ago
No idea...

I add you at gtalk, when you can ping me there.

VELO

Original comment by velo...@gmail.com on 25 Aug 2008 at 1:06

GoogleCodeExporter commented 9 years ago
fix checked in to r704. Can you test it?

Original comment by RedB...@gmail.com on 25 Aug 2008 at 2:17

GoogleCodeExporter commented 9 years ago
Now I get this:

Downloading:
http://repo1.maven.org/maven2/com/adobe/flex/framework/rpc/3.1.0.2710/rpc-3.1.0.
2710-fr_FR.rb.swc
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: com.adobe.flex.framework
ArtifactId: rpc
Version: 3.1.0.2710

Reason: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=com.adobe.flex.framework -DartifactId=rpc
-Dversion=3.1.0.2710 -Dclassifier=fr_FR -Dpackaging=rb.swc -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=com.adobe.flex.framework -DartifactId=rpc
-Dversion=3.1.0.2710 -Dclassifier=fr_FR -Dpackaging=rb.swc -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

  com.adobe.flex.framework:rpc:rb.swc:3.1.0.2710

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  maven2-repository.dev.java.net (http://download.java.net/maven/2/),
  archiva.accovia.internal (https://svn.ibiza.accovia.com/archiva/repository/internal/),
  flex-mojos-repository (http://svn.sonatype.org/flexmojos/repository/),
  archiva.accovia.snapshots (https://svn.ibiza.accovia.com/archiva/repository/snapshots/)

It is normal because this artifact doesn't exist, but I don't think it's the 
good option.
A resource bundle artifact is optional (at least with 3.0.0.477, it worked), so 
I
think it would be better to skip it if it doesn't exist (line 180 in
info.rvin.flexmojos.utilities.MavenUtils)

Original comment by emmanuel...@gmail.com on 25 Aug 2008 at 3:40

GoogleCodeExporter commented 9 years ago
Resource bundles are not optional. Did you do a copylocale on your sdk to get 
the
fr_FR resources and then do a install-mojo:install-sdk?

I'm not sure why it worked on 3.0.0.477, unless you forgot that you installed 
the
fr_FR resources manually yourself.

Original comment by RedB...@gmail.com on 25 Aug 2008 at 5:16

GoogleCodeExporter commented 9 years ago
Can you look in your local repository and see what was there before for rpc? It
should be in:
<user.home>/.m2/repository/com/adobe/flex/sdk/rpc/3.0.0.477/

Is there a rpc-3.0.0.477-fr_FR.swc?

Original comment by RedB...@gmail.com on 25 Aug 2008 at 5:19

GoogleCodeExporter commented 9 years ago
Before works, but, was a flex-mojos bug.

Prabably it worked at 2.0-alpha3 because flex-mojos inject all RB in all 
compilation.
 So, your fr_FR was using en_US resource bundles.

May be we should add resource chaining to flex-mojos....

Any thoughts?

Original comment by velo...@gmail.com on 25 Aug 2008 at 5:41

GoogleCodeExporter commented 9 years ago
With something like a warning?
WARNING: resource bundle not found for fr_FR, substituting en_EN in it's place

How would you do the substitution though? modify the dependency? create a tmp 
locale in target and point to 
it?

Original comment by RedB...@gmail.com on 25 Aug 2008 at 6:52

GoogleCodeExporter commented 9 years ago
I don't have rpc-3.0.0.477-fr_FR.swc in my local repo.

As Velo said, it worked before, but I don't think it was a bug in flex-mojos 
but in
sdk 3.0.0.477. It works with FlexBuilder too that use for the moment sdk 
3.0.0.477.

I tried to skip it with only a warning but it doesn't work with the following 
message:
[ERROR] Inconsistant linkage in C:\Documents and
Settings\evenisse\.m2\repository\com\adobe\flex\framework\rpc\3.1.0.2710\rpc-3.1
.0.2710-en_US.rb.swc$locale/en_US/core.properties
- 'en_US$core_properties' is marked as extern, but 'fr_FR$core_properties' is 
not.

About the substitution, I think the following process would work:
- add a warning about the substitution
- extract the en_US bundle in target
- open catalog.xml and replace all en_US strings by fr_FR
- create a new archive file with the modified content and point to it

Original comment by emmanuel...@gmail.com on 26 Aug 2008 at 9:15

GoogleCodeExporter commented 9 years ago
Why is it marked as fixed?

Original comment by emmanuel...@gmail.com on 26 Aug 2008 at 9:45

GoogleCodeExporter commented 9 years ago
Emmanuel: It works with FlexBuilder too that use for the moment sdk 3.0.0.477.
I curious how you are using.  It shouldn't be working :D

Well don't try to threat rb.swc as optional.  They are required and if not 
informed
will got a compilation error.  And if bad informed you can get applications half
en_US, half ja_JP or whatever.

To create a new resource bundle use copylocale.  Or download it from internet:
http://ttfx.org/Tontons_Flexeurs/BabelFlex.html.  But I'm not sure if this 
project is
compatible with flex 3.1.

This issue was fixed.  The original bug is already fixed and we are talking 
about a
new problem.

Original comment by velo...@gmail.com on 26 Aug 2008 at 11:37

GoogleCodeExporter commented 9 years ago
Ok, thank you. I'll look at ttfx.org

Original comment by emmanuel...@gmail.com on 26 Aug 2008 at 12:06

GoogleCodeExporter commented 9 years ago
I had checked in all locales available at BabelFlex.

Enjoy.

Original comment by velo...@gmail.com on 26 Aug 2008 at 12:06