2014-02-17 36 views
0

我有主根项目让我们把它作为一个地方是pom.xml的所有模块的列表和包装POMAndroid的Maven的插件封装失败,分层项目和apklib依赖

<?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> 

的类型

这个项目有两个孩子,免得说项目AA和AB也劲歌

项目AA是包装类型apklib并与编译安装NOP的问题也比Android的Maven的插件(安卓apklib)这里是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> 

<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> 

项目AB具有依赖性项目AA在PO​​M像波纹管

<?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> 

在包装,甚至安卓apklib我geeting错误是这样的

未能执行项目util的目标:可能n解决依赖关系 for com.example.AB:apklib:0.0.1:无法收集[com.example.AA:apklib:0.0.1(提供)]的 依存关系:无法为 读取com的工件描述符。 example.AA:apklib:0.0.1:无法找到 神器com。示例:A:POM:0.0.1在中央 (http://repo.maven.apache.org/maven2) - > [求助1]

我已经拼命地跑MVN安装上项目AA,看起来它安装在.m2

任何想法?提前致谢。

回答

0

好的我解决了这个问题,问题是我没有安装它而改变了root pom,所以我只是在root项目上再次运行mvn install并解决了这个问题。

相关问题