[英]Eclipse android Maven : Plugin execution not covered by lifecycle configuration (execution: ndk- build, phase: compile)
我已經看到了這兩個問題:
com.jayway.maven.plugins.android.generation2:生命周期配置未涵蓋插件執行?
我嘗試按照建議的問題安裝連接器。 它擺脫了一些錯誤,但我仍然遇到錯誤:
Plugin execution not covered by lifecycle configuration:
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:ndk-build (execution: ndk-
build, phase: compile)
我是Maven的新手,還是想解決此問題。
這是我的整個pom.xml
,我評論了錯誤的出處:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>info.kghost.android</groupId>
<artifactId>openvpn</artifactId>
<version>0.9.4</version>
<packaging>apk</packaging>
<name>OpenVpn</name>
<profiles>
<profile>
<id>sign</id>
<activation>
<file>
<exists>signkey.keystore</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
</goals>
<inherited>true</inherited>
<configuration>
<includes>
<include>target/*.apk</include>
</includes>
<keystore>${basedir}/signkey.keystore</keystore>
<alias>CERT</alias>
<arguments>
<argument>-digestalg</argument>
<argument>SHA1</argument>
<argument>-sigalg</argument>
<argument>MD5withRSA</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<sign>
<debug>false</debug>
</sign>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.1.2_r4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.4c</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.khronos</groupId>
<artifactId>opengl-api</artifactId>
<version>gl1.1-android-2.1_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<url>https://github.com/kghost/ics-openvpn</url>
<inceptionYear>2011</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scm.branch>master</scm.branch>
<maven.version>3.0.3</maven.version>
</properties>
<scm>
<url>https://github.com/kghost/ics-openvpn/tree/${scm.branch}</url>
<connection>scm:git:git://github.com/kghost/ics-openvpn.git</connection>
<developerConnection>scm:git:git@github.com:kghost/ics-openvpn.git</developerConnection>
</scm>
<issueManagement>
<system>Github Issue Tracking</system>
<url>https://github.com/kghost/ics-openvpn/issues</url>
</issueManagement>
<licenses>
<license>
<name>GPL</name>
<url>LICENSE</url>
</license>
</licenses>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<!-- ERROR HERE -->
<execution>
<id>ndk-build</id>
<goals>
<goal>ndk-build</goal>
</goals>
<configuration>
<target>all</target>
<attachNativeArtifacts>false</attachNativeArtifacts>
</configuration>
</execution>
<execution>
<id>zipalign</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
<emulator>
<avd>22</avd>
</emulator>
<zipalign>
<verbose>true</verbose>
</zipalign>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>libs</directory>
</fileset>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>1.2</version>
</plugin>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.3</version>
<configuration>
<scmVersionType>branch</scmVersionType>
<scmVersion>${scm.branch}</scmVersion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestEntries>
<Build-Source-Version>1.6</Build-Source-Version>
<Build-Target-Version>1.6</Build-Target-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[${maven.version},)</version>
<message>Check for Maven version >=${maven.version} failed.
Update your Maven install.</message>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
請幫幫我,謝謝您的幫助。
回答
感謝回答者,我設法編輯了他的代碼,這是我的工作pom.xml:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>info.kghost.android</groupId>
<artifactId>openvpn</artifactId>
<version>0.9.4</version>
<packaging>apk</packaging>
<name>OpenVpn</name>
<profiles>
<profile>
<id>sign</id>
<activation>
<file>
<exists>signkey.keystore</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
</goals>
<inherited>true</inherited>
<configuration>
<includes>
<include>target/*.apk</include>
</includes>
<keystore>${basedir}/signkey.keystore</keystore>
<alias>CERT</alias>
<arguments>
<argument>-digestalg</argument>
<argument>SHA1</argument>
<argument>-sigalg</argument>
<argument>MD5withRSA</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<sign>
<debug>false</debug>
</sign>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.1.2_r4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.4c</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.khronos</groupId>
<artifactId>opengl-api</artifactId>
<version>gl1.1-android-2.1_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<url>https://github.com/kghost/ics-openvpn</url>
<inceptionYear>2011</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scm.branch>master</scm.branch>
<maven.version>3.0.3</maven.version>
</properties>
<scm>
<url>https://github.com/kghost/ics-openvpn/tree/${scm.branch}</url>
<connection>scm:git:git://github.com/kghost/ics-openvpn.git</connection>
<developerConnection>scm:git:git@github.com:kghost/ics-openvpn.git</developerConnection>
</scm>
<issueManagement>
<system>Github Issue Tracking</system>
<url>https://github.com/kghost/ics-openvpn/issues</url>
</issueManagement>
<licenses>
<license>
<name>GPL</name>
<url>LICENSE</url>
</license>
</licenses>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<versionRange>[3.0.0-alpha-13,)</versionRange>
<goals>
<goal>ndk-build</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<!-- <execution>
<id>ndk-build</id>
<goals>
<goal>ndk-build</goal>
</goals>
<configuration>
<target>all</target>
<attachNativeArtifacts>false</attachNativeArtifacts>
</configuration>
</execution> -->
<execution>
<id>zipalign</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
<emulator>
<avd>22</avd>
</emulator>
<zipalign>
<verbose>true</verbose>
</zipalign>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>libs</directory>
</fileset>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>1.2</version>
</plugin>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.3</version>
<configuration>
<scmVersionType>branch</scmVersionType>
<scmVersion>${scm.branch}</scmVersion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestEntries>
<Build-Source-Version>1.6</Build-Source-Version>
<Build-Target-Version>1.6</Build-Target-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[${maven.version},)</version>
<message>Check for Maven version >=${maven.version} failed.
Update your Maven install.</message>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
請考慮在pom.xml中添加標簽<pluginManagement> (並包含標簽):
<build>
<pluginManagement>
<plugins>
....
</plugins>
</pluginManagement>
</build>
遵循android-maven-plugin示例代碼,您可以嘗試在代碼中添加以下內容(在pluginManagement標簽內部):
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
</plugin>
</plugins>
並且還包括以下內容:
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<versionRange>[3.2.0,)</versionRange>
<goals>
<goal>manifest-update</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
編輯:以下代碼段也是如此:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
<emulator>
<avd>23</avd>
<wait>10000</wait>
<!--<options>-no-skin</options> -->
</emulator>
<zipalign>
<verbose>true</verbose>
</zipalign>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.