2013-12-09 77 views
1

我已經檢查出osmdroid項目,並試圖運行「maven install」,但是;我每次都遇到這個錯誤。無法運行maven安裝osmdroid

無法執行目標com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.0:項目中的generate-sources(default-generate-sources)OpenStreetMapViewer:插件com.jayway .maven.plugins.android.generation2:機器人-行家-插件:3.8.0需要的Maven版本3.1.1

並且示出了代碼旁邊此錯誤提示:

插件執行未包括生命週期配置:com.jayway.maven.plugins.android.generation2:android-maven-plugin: 3.8.0:consume-aar(執行:default-consume-aar,phase:c ompile)

這裏是我的POM:

<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>org.sonatype.oss</groupId> 
    <artifactId>oss-parent</artifactId> 
    <version>7</version> 
</parent> 

<groupId>org.osmdroid</groupId> 
<artifactId>osmdroid-parent</artifactId> 
<version>4.1-SNAPSHOT</version> 
<packaging>pom</packaging> 

<name>OSMdroid parent</name> 
<description>An Android library to display OpenStreetMap views.</description> 
<url>http://code.google.com/p/osmdroid</url> 

<licenses> 
    <license> 
     <name>Apache License 2.0</name> 
     <url>http://www.apache.org/licenses/LICENSE-2.0</url> 
     <distribution>repo</distribution> 
    </license> 
</licenses> 

<scm> 
    <url>http://osmdroid.googlecode.com/svn/trunk</url> 
    <connection>scm:svn:http://osmdroid.googlecode.com/svn/trunk</connection> 
    <developerConnection>scm:svn:https://osmdroid.googlecode.com/svn/trunk</developerConnection> 
</scm> 

<issueManagement> 
    <system>Google Project</system> 
    <url>http://code.google.com/p/osmdroid/issues/list</url> 
</issueManagement> 

<developers> 
    <!-- TODO --> 
    <developer> 
     <id>id</id> 
     <name>name</name> 
     <roles> 
      <role>developer</role> 
      <role>contributor</role> 
      <role>...</role> 
     </roles> 
    </developer> 
</developers> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 

<dependencyManagement> 
    <dependencies> 
     <!-- Android included libraries --> 
     <dependency> 
      <groupId>com.google.android</groupId> 
      <artifactId>android</artifactId> 
      <version>4.1.1.4</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.google.android</groupId> 
      <artifactId>support-v4</artifactId> 
      <version>r7</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.android.maps</groupId> 
      <artifactId>maps</artifactId> 
      <version>16_r3</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.google.android.gms</groupId> 
      <artifactId>google-play-services</artifactId> 
      <type>apklib</type> 
      <version>10</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.android.gms</groupId> 
      <artifactId>google-play-services</artifactId> 
      <type>jar</type> 
      <version>10</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-logging</groupId> 
      <artifactId>commons-logging</artifactId> 
      <version>1.1.1</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.json</groupId> 
      <artifactId>json</artifactId> 
      <version>20070829</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpmime</artifactId> 
      <version>4.0.1</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.james</groupId> 
      <artifactId>apache-mime4j</artifactId> 
      <version>0.6</version> 
      <scope>provided</scope> 
     </dependency> 

     <!-- --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>1.6.1</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-android</artifactId> 
      <version>1.6.1-RC1</version> 
     </dependency> 

     <!-- test dependencies --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
      <version>1.6.1</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.2</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

<build> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.1</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
       <artifactId>android-maven-plugin</artifactId> 
       <version>3.8.0</version> 
       <configuration> 
        <sdk> 
         <platform>16</platform> 
        </sdk> 
       </configuration> 
       <extensions>true</extensions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-source-plugin</artifactId> 
       <version>2.2.1</version> 
       <executions> 
        <execution> 
         <id>attach-sources</id> 
         <phase>package</phase> 
         <goals> 
          <goal>jar-no-fork</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-javadoc-plugin</artifactId> 
       <version>2.9.1</version> 
       <executions> 
        <execution> 
         <id>attach-javadocs</id> 
         <phase>package</phase> 
         <goals> 
          <goal>jar</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-gpg-plugin</artifactId> 
       <version>1.4</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-deploy-plugin</artifactId> 
       <version>2.8.1</version> 
       <configuration> 
        <autoVersionSubmodules>true</autoVersionSubmodules> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jarsigner-plugin</artifactId> 
       <version>1.2</version> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 

<modules> 
    <module>osmdroid-android</module> 
    <module>osmdroid-third-party</module> 
    <module>OpenStreetMapViewer</module> 
    <module>GoogleWrapperSample</module> 
    <module>OSMMapTilePackager</module> 
</modules> 

<profiles> 
    <profile> 
     <!-- this profile is activated when using 'mvn release:perform' --> 
     <!-- it signs artifacts before staging to Sonatype --> 
     <id>release-sign-artifacts</id> 
     <activation> 
      <property> 
       <name>performRelease</name> 
       <value>true</value> 
      </property> 
     </activation> 
     <build> 
      <plugins> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-source-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>attach-sources</id> 
          <phase>verify</phase> 
          <goals> 
           <goal>jar</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-javadoc-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>attach-javadocs</id> 
          <goals> 
           <goal>jar</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-gpg-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>sign-artifacts</id> 
          <phase>verify</phase> 
          <goals> 
           <goal>sign</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 

       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-jarsigner-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>signing</id> 
          <goals> 
           <goal>sign</goal> 
          </goals> 
          <phase>package</phase> 
          <inherited>true</inherited> 
          <configuration> 
           <archiveDirectory /> 
           <includes> 
            <include>target/*.apk</include> 
           </includes> 
           <keystore>${sign.keystore}</keystore> 
           <storepass>${sign.storepass}</storepass> 
           <keypass>${sign.keypass}</keypass> 
           <alias>${sign.alias}</alias> 
           <arguments> 
            <argument>-sigalg</argument> 
            <argument>MD5withRSA</argument> 
            <argument>-digestalg</argument> 
            <argument>SHA1</argument> 
           </arguments> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 

       <plugin> 
        <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
        <artifactId>android-maven-plugin</artifactId> 
        <inherited>true</inherited> 
        <executions> 
         <execution> 
          <id>alignApk</id> 
          <phase>install</phase> 
          <goals> 
           <goal>zipalign</goal> 
          </goals> 
         </execution> 
        </executions> 
        <configuration> 
         <zipalign> 
          <verbose>true</verbose> 
          <skip>false</skip> 
         </zipalign> 
         <sign> 
          <debug>false</debug> 
         </sign> 
        </configuration> 
       </plugin> 

      </plugins> 
     </build> 
    </profile> 
</profiles> 

回答

0

我設法建立項目使用的「com.jayway.maven.plugins.android.generation2」插件.. 一個版本的舊版本,不需要行家3.1.1

+0

請你能分享爲你工作的版本嗎? – tomasb

0

插件 com.jayway.maven.plugins.android.generation2:Android的Maven的插件:3.8.0 需要Maven版本3.1.1

你確定你安裝了最新版本的Maven(> = 3.1.1)?

+0

是,我在我的ubuntu上安裝了maven 3.1.1,並且「mvn --version」命令給我當前版本是3.1.1 – Abuzaid