1

(经过几个小时的尝试,我终于辞职了。)

好吧:

-1。我愿意

mvn    -X   archetype:generate   -DarchetypeArtifactId=android-release 
-DarchetypeGroupId=de.akquinet.android.archetypes -DarchetypeVersion=1.0.9                           
-DgroupId=org.me -DartifactId=myAndroidApp     -Demulator=myEmu
-Dplatform=10

-2。第一个问题:您必须手动编辑顶级 pom.xml 以添加

< properties>
< platform.version>  2.3.3  < /platform.version>

< /属性>

-Dplatform=10尽管它是和 2.3.3之间的直接关系

-3。(可能)第二个问题(仪器测试:myAndroidApp-it dir。)您必须编辑 AndroidManifest.xml 并检查android:targetPackage值是否正确

-4。第三个问题(我无法解决)。仪器测试中 zipaligned-classifier 依赖项的问题(myAndroidApp-it dir.)

做的时候mvn install

-4.1

    [WARNING] The POM for org.me:myAndroidApp:apk:${zipaligned-classifier}:1.0-SNAPSHOT 

is missing, no dependency information available

[WARNING] The POM for org.me:myAndroidApp:jar:1.0-SNAPSHOT 

is missing, no dependency information available

-4.2

        [ERROR] Failed to execute goal on project myAndroidApp-it: 
    Could not resolve dependencies for 
project org.me:myAndroidApp-it:apk:1.0-SNAPSHOT: 
    The following artifacts could not be resolved: 
org.me:myAndroidApp:apk:${zipaligned-classifier}:1.0-SNAPSHOT, org.me:myAndroidApp:jar:1.0-SNAPSHOT: 
    Could not find artifact org.me:myAndroidApp:apk:${zipaligned-classifier}:1.0-

谢谢

更新:在这里报告了这个问题

4

1 回答 1

1

我在你的<Properties>部分添加这个可能会修复第一个警告:

<zipaligned-classifier>aligned</zipaligned-classifier>

然后在您的 myAndroidApp 项目中运行 mvn install。确保您的应用程序的构建成功(暂时不用关心您的 myAndroidApp-it),然后查看您的本地存储库以查看安装位置的工件。( <USER_HOME>/.m2/repository/org/me)

对于您的第二个警告:确保您在 myAndroidApp-it 的依赖项中有类似的内容:

<dependency>
    <groupId>org.me</groupId>
    <artifactId>myAndroidApp</artifactId>
    <type>apk</type>
    <version>1.0-SNAPSHOT</version>
<dependency>

根据安装的工件,您可能需要为此依赖项添加分类器(因为您没有发布 pom.xml,所以很难说 mvn 将安装什么)。

<dependency>
    <groupId>org.me</groupId>
    <artifactId>myAndroidApp</artifactId>
    <type>apk</type>
    <classifier>${zipaligned-classifier}</classfier>
    <version>1.0-SNAPSHOT</version>
<dependency>
于 2013-01-20T14:01:42.630 回答