Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android maven插件打包失败,存在分层项目和apklib依赖项_Android_Maven_Android Maven Plugin_Apklib - Fatal编程技术网

android maven插件打包失败,存在分层项目和apklib依赖项

android maven插件打包失败,存在分层项目和apklib依赖项,android,maven,android-maven-plugin,apklib,Android,Maven,Android Maven Plugin,Apklib,我有一个主要的根项目,我们把它叫做where is pom.xml,它包含所有模块的列表和pom的打包类型 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.

我有一个主要的根项目,我们把它叫做where is pom.xml,它包含所有模块的列表和pom的打包类型

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>A</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<properties>
    <android.version>4.1.1.4</android.version>
    <android.target.version>17</android.target.version>
    <android.plugin.version>3.6.0</android.plugin.version>
    <android.roboelectric.version>2.2</android.roboelectric.version>
    <android.support.version.4>r7</android.support.version.4>
</properties>

<modules>
    <module>AA</module>
    <module>AB</module>
</modules>

4.0.0
com.example
)->[帮助1]

我已经在AA项目上运行了mvn安装,看起来它安装在.m2中


有什么想法吗?提前感谢。

好的,我解决了问题。问题是我在没有安装的情况下更改了根pom,所以我只是在根项目上再次运行mvn install,解决了问题

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>com.example</groupId>
    <artifactId>A</artifactId>
    <version>0.0.1</version>
</parent>

<groupId>com.example</groupId>
<artifactId>AB</artifactId>
<packaging>apklib</packaging>

<build>
    <finalName>${project.artifactId}-${project.parent.version}</finalName>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>${android.plugin.version}</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <configuration>
                <sdk>
                    <platform>17</platform>
                    <path>${env.ANDROID_HOME}</path>
                </sdk>
            </configuration>
        </plugin>
    </plugins>
</build>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>com.example</groupId>
    <artifactId>A</artifactId>
    <version>0.0.1</version>
</parent>

<groupId>com.example</groupId>
<artifactId>AB</artifactId>
<packaging>apklib</packaging>

<dependencies>
    <dependency>
        <groupId>com.examplet</groupId>
        <artifactId>AA</artifactId>
        <version>0.0.1</version>
        <type>apklib</type>
    </dependency>
</dependencies>

<build>
    <finalName>${project.artifactId}-${project.version}</finalName>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>${android.plugin.version}</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <configuration>
                <sdk>
                    <platform>17</platform>
                </sdk>
            </configuration>
        </plugin>
    </plugins>
</build>