无法为osmdroid运行maven安装

时间:2013-12-09 08:35:57

标签: maven osmdroid

我已经检查了osmdroid项目并试图运行“maven install”,但是;我每次都遇到这个错误。

无法在项目OpenStreetMapViewer上执行目标com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.0:generate-sources(default-generate-sources):插件com。 jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.0需要Maven版本3.1.1

并在代码旁边显示此错误提示:

生命周期配置未涵盖的插件执行:com.jayway.maven.plugins.android.generation2:android-maven-plugin:  3.8.0:consume-aar(执行:default-consume-aar,阶段:编译)

这是我的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>

2 个答案:

答案 0 :(得分:0)

  

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

您确定安装了最新版本的Maven(&gt; = 3.1.1)吗?

答案 1 :(得分:0)

我设法使用旧版本的“ com.jayway.maven.plugins.android.generation2 ”插件来构建项目。 一个不需要maven 3.1.1的版本