yuchen931201 / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

mvn install fails on Windows for packaging=android:platformTest #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download the samples 2.0.0-alpha4
2. Set up environment variables according to 
http://code.google.com/p/maven-android-plugin/wiki/GettingStarted
3. cd apidemos-15
4. Update the poms to use maven-android-plugin 2.0.0-alpha5-SNAPSHOT.
5. mvn install

What is the expected output?
It should build and install the samples. Then it should install the apk files 
to ~/.m2/repository/...

What do you see instead?
When it tries to install the apidemos-15-platformtest apk to ~/.m2/repository, 
it fails. The problem is that <packaging>android:apk:platformTest</packaging> 
contains a ":", which is not valid for filenames in Windows.

[INFO] [install:install]
[INFO] Installing 
C:\java\maven-android-plugin-samples\apidemos-15\apidemos-15-platformtests\targe
t\apidemos-15-platformtests-2.0.0-alpha4.apk to C:\Documents and 
Settings\Administrator\.m2\repository\com\jayway\maven\plugins\android\generatio
n2\samples\apidemos-15\apidemos-15-platformtests\2.0.0-alpha4\apidemos-15-platfo
rmtests-2.0.0-alpha4.android:apk:platformTest
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error installing artifact: The filename, directory name, or volume label 
syntax is incorrect

What version of maven-android-plugin are you using?
2.0.0-alpha5-SNAPSHOT

What is the output of "mvn -version" on your machine?
Maven version: 2.0.9
Java version: 1.6.0_14
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

Please use labels and text to provide additional information.

Original issue reported on code.google.com by hugo.josefson.old@gmail.com on 21 Jun 2009 at 10:48

GoogleCodeExporter commented 9 years ago
Postponing to the next alpha, so that we can release a small bugfix before 
(Issue 23).

Original comment by hugo.josefson.old@gmail.com on 21 Jun 2009 at 10:51

GoogleCodeExporter commented 9 years ago
This Issue 24 is still there in 2.0.0-alpha5.

Original comment by hugo.josefson.old@gmail.com on 21 Jun 2009 at 11:23

GoogleCodeExporter commented 9 years ago
An idea:

Change both:
  <packaging>android:apk</packaging>
  <packaging>android:apk:platformTest</packaging>
to:
  <packaging>apk</packaging>

Introduce optional plugin config parameter:
  <platformtest>true/false/auto</platformtest>

default => auto

true:
  run the integration-test phase, just as <packaging>android:apk:platformTest</packaging> did.

false:
  don't run the integration-test phase, just as <packaging>android:apk</packaging> didn't.

auto:
  based on if there are any test classes in the main sources (usually /src/main/java). Test classes for this purpose should be considered anything inheriting 
junit.framework.Test.

Original comment by hugo.josefson.old@gmail.com on 21 Jun 2009 at 11:33

GoogleCodeExporter commented 9 years ago
We can probably autodetect test classes with ASM.

See section 2.2.2 of the ASM User Guide:

http://download.forge.objectweb.org/asm/asm-guide.pdf

Since the plugin will have all project dependencies (for example the 
android.jar 
which includes junit.framework.*) on its classpath (will it?) when running in a 
project, we should be able to figure these things out.

ASM homepage:
http://asm.ow2.org/

Original comment by hugo.josefson.old@gmail.com on 21 Jun 2009 at 2:47

GoogleCodeExporter commented 9 years ago
Yes, that worked. Fixed in my local fix-branch. Deployed 2.0.0-alpha6-SNAPSHOT.

This results in a major change in how poms are defined. It is however necessary 
for fixing this issue. Can't be done without changing the <packaging> to 
something 
without ":", so it's best to do it all at once now while we're still in alpha.

<packaging>apk</packaging> also makes more sense, especially when comparing to 
other packaging types such as jar, war and so on...

The change is that all Android application poms and all Android platformTest 
poms will have to have <packaging>apk</packaging> instead of the separate 
<packaging>android:apk</packaging> and 
<packaging>android:apk:platformTest</packaging> which they've had before. Also, 
of course, if the platformTest pom has a 
dependency to another apk, that <dependency> will now have to be 
<type>apk</type> instead of <type>android:apk</type>.

Will release tomorrow.

Original comment by hugo.josefson.old@gmail.com on 21 Jun 2009 at 8:22

GoogleCodeExporter commented 9 years ago
I'll wait one more day until releasing the next alpha. I want to verify this 
fix with a project at work 
tomorrow first.

Original comment by hugo.josefson.old@gmail.com on 22 Jun 2009 at 2:51

GoogleCodeExporter commented 9 years ago
Released 2.0.0-alpha6.

Original comment by hugo.josefson.old@gmail.com on 23 Jun 2009 at 9:02

GoogleCodeExporter commented 9 years ago

Original comment by hugo.josefson.old@gmail.com on 24 Jun 2009 at 1:55