${buildNumber} in finalName not resolved to value when Artifact.getFile() 
called in maven-android-plugin
--------------------------------------------------------------------------------------------------------

                 Key: MBUILDNUM-76
                 URL: https://jira.codehaus.org/browse/MBUILDNUM-76
             Project: Mojo Build Number Maven Plugin
          Issue Type: Bug
    Affects Versions: buildnumber-maven-plugin-1.0
         Environment: Java 1.6.0_26
Maven 3.0.3
Mac OS X Snow Leopard 10.6.8
            Reporter: Eric Chen
         Attachments: androidBuildNumber.tar.gz

In the attached pom file, maven-jar-plugin:2.3.1 successfully builds jar using 
a finalName that contains the buildNumber. However, in the following step 
maven-android-plugin:2.8.4 fails to unpack that jar into a temp directory 
because ${buildNumber} is not resolved to a value.

The error is as follows:
[ERROR] Failed to execute goal 
com.jayway.maven.plugins.android.generation2:maven-android-plugin:2.8.4:unpack 
(default-unpack) on project androidBuildNumber: IOException while unjarring 
/androidBuildNumber/target/androidBuildNumber-1.0.0-SNAPSHOT-${buildNumber}.jar 
into /androidBuildNumber/target/android-classes: error in opening zip file

And the stack trace:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
com.jayway.maven.plugins.android.generation2:maven-android-plugin:2.8.4:unpack 
(default-unpack) on project androidBuildNumber: IOException while unjarring 
/androidBuildNumber/target/androidBuildNumber-1.0.0-SNAPSHOT-${buildNumber}.jar 
into /androidBuildNumber/target/android-classes
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: IOException while 
unjarring 
/androidBuildNumber/target/androidBuildNumber-1.0.0-SNAPSHOT-${buildNumber}.jar 
into /androidBuildNumber/target/android-classes
        at 
com.jayway.maven.plugins.android.phase04processclasses.UnpackMojo.unpackClasses(UnpackMojo.java:95)
        at 
com.jayway.maven.plugins.android.phase04processclasses.UnpackMojo.execute(UnpackMojo.java:58)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)


maven-android-plugin UnpackMojo.java:95 is:
unjar(new JarFile(artifact.getFile()), outputDirectory);

I tested replacing ${buildNumber} in finalName with ${testProperty} and it 
works correctly, leading me to suspect that the problem may lie within the 
BuildNumber plugin somewhere rather than with the maven-android-plugin, unless 
there is something wrong with calling (Maven) Artifact.getFile()?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to