在其文档中指出要在settings.xmlfile中添加androID-release配置文件.
我的〜/ .m2 / settings.xml看起来像这样:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <profiles> <profile> <ID>androID-release</ID> <propertIEs> <sign.keystore>absolute path</sign.keystore> <sign.alias>my_alias</sign.alias> <sign.storepass>pass</sign.storepass> <sign.keypass>pass</sign.keypass> </propertIEs> </profile> </profiles></settings>
我的父pom.xmlfile与原型(版本1.0.8)几乎相同:
<?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>myapp-androID</groupID> <artifactID>myapp-androID-parent</artifactID> <version>1.1-SNAPSHOT</version> <packaging>pom</packaging> <name>myapp-androID - Parent</name> <modules> <module>myapp-androID</module> <module>myapp-androID-it</module> </modules> <scm> <url>....</url> <connection>....</connection> <developerConnection>....</developerConnection> <tag>head</tag> </scm> <propertIEs> <platform.version>4.1.1.4</platform.version> <androID.dex.optimize>false</androID.dex.optimize> <project.build.sourceEnCoding>UTF-8</project.build.sourceEnCoding> </propertIEs> <repositorIEs> <repository> <ID>ignition-releases</ID> <url>http://nexus.qype.com/content/repositorIEs/releases</url> </repository> <repository> <ID>central</ID> <url>http://repo1.maven.org/maven2</url> </repository> <repository> <ID>com.jakewharton</ID> <url>http://r.jakewharton.com/maven/release</url> </repository> </repositorIEs> <dependencyManagement> <dependencIEs> <dependency> <groupID>com.Google.androID</groupID> <artifactID>androID</artifactID> <version>${platform.version}</version> <scope>provIDed</scope> </dependency> <dependency> <groupID>com.Google.androID</groupID> <artifactID>androID-test</artifactID> <version>${platform.version}</version> <scope>provIDed</scope> </dependency> <dependency> <groupID>junit</groupID> <artifactID>junit</artifactID> <version>4.10</version> <scope>provIDed</scope> </dependency> </dependencIEs> </dependencyManagement> <build> <pluginManagement> <plugins> <plugin> <groupID>com.jayway.maven.plugins.androID.generation2</groupID> <artifactID>androID-maven-plugin</artifactID> <version>3.5.0</version> <inherited>true</inherited> <configuration> <androIDManifestfile>${project.basedir}/AndroIDManifest.xml</androIDManifestfile> <assetsDirectory>${project.basedir}/assets</assetsDirectory> <resourceDirectory>${project.basedir}/res</resourceDirectory> <nativelibrarIEsDirectory>${project.basedir}/src/main/native</nativelibrarIEsDirectory> <sdk> <platform>16</platform> </sdk> <undeployBeforedeploy>false</undeployBeforedeploy> </configuration> </plugin> <plugin> <artifactID>maven-compiler-plugin</artifactID> <version>2.5.1</version> <inherited>true</inherited> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactID>maven-enforcer-plugin</artifactID> <version>1.0</version> </plugin> <plugin> <artifactID>maven-release-plugin</artifactID> <version>2.3</version> <configuration> <autoVersionSubmodules>true</autoVersionSubmodules> <!-- We need this since our pom.xml is not insIDe repo root --> <arguments>-f ./androID/pom.xml</arguments> </configuration> </plugin> <plugin> <artifactID>maven-jarsigner-plugin</artifactID> <version>1.2</version> <inherited>true</inherited> <configuration> <removeExistingSignatures>true</removeExistingSignatures> <archiveDirectory /> <archive>${project.build.directory}/${project.build.finalname}.${project.packaging}</archive> <verbose>true</verbose> <certs>true</certs> <keystore>${sign.keystore}</keystore> <alias>${sign.alias}</alias> <storepass>${sign.storepass}</storepass> <keypass>${sign.keypass}</keypass> </configuration> </plugin> <plugin> <groupID>com.pyx4me</groupID> <artifactID>proguard-maven-plugin</artifactID> <version>2.0.4</version> <dependencIEs> <dependency> <groupID>net.sf.proguard</groupID> <artifactID>proguard</artifactID> <version>4.4</version> <scope>runtime</scope> </dependency> </dependencIEs> <configuration> <proguardVersion>4.4</proguardVersion> </configuration> </plugin> </plugins> </pluginManagement> </build> <profiles> <profile> <ID>release</ID> <activation> <property> <name>performRelease</name> <value>true</value> </property> </activation> <build> <plugins> <plugin> <groupID>com.jayway.maven.plugins.androID.generation2</groupID> <artifactID>androID-maven-plugin</artifactID> <version>3.5.0</version> <configuration> <release>true</release> </configuration> </plugin> <plugin> <artifactID>maven-enforcer-plugin</artifactID> <executions> <execution> <ID>enforce-signing-propertIEs</ID> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireProperty> <property>sign.keystore</property> <message>The 'sign.keystore' property is missing. It must contain the path to the keystore used to sign the application. </message> </requireProperty> <requirefilesExist> <files> <file>${sign.keystore}</file> </files> <message>The 'sign.keystore' property does not point to a file. It must contain the path to the keystore used to sign the application. </message> </requirefilesExist> <requireProperty> <property>sign.alias</property> <message>The 'sign.alias' property is missing. It must contain the key alias used to sign the application. </message> </requireProperty> <requireProperty> <property>sign.storepass</property> <message>The 'sign.storepass' property is missing. It must contain the password of the keystore used to sign the application. </message> </requireProperty> <requireProperty> <property>sign.keypass</property> <message>The 'sign.keypass' property is missing. It must contain the password of the key used to sign the application. </message> </requireProperty> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <ID>linux</ID> <activation> <os> <family>unix</family> </os> </activation> <propertIEs> <rt.jar.path>${java.home}/jre/lib/rt.jar</rt.jar.path> <Jsse.jar.path>${java.home}/jre/lib/Jsse.jar</Jsse.jar.path> </propertIEs> </profile> <!-- mac profile has to be after unix since running on mac will trigger both --> <profile> <ID>mac</ID> <activation> <os> <family>mac</family> </os> </activation> <propertIEs> <!-- absolute path --> <!--<rt.jar.path>/System/library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar</rt.jar.path> --> <!-- or with JAVA_HOME /System/library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ --> <rt.jar.path>${java.home}/../Classes/classes.jar</rt.jar.path> <Jsse.jar.path>${java.home}/../Classes/Jsse.jar</Jsse.jar.path> </propertIEs> </profile> <profile> <ID>windows</ID> <activation> <os> <family>windows</family> </os> </activation> <propertIEs> <rt.jar.path>${java.home}/jre/lib/rt.jar</rt.jar.path> <Jsse.jar.path>${java.home}/jre/lib/Jsse.jar</Jsse.jar.path> </propertIEs> </profile> </profiles></project>
当我运行mvn release时:performlooks就像它没有找到关于要使用的密钥库的信息:
[INFO] [INFO] ------------------------------------------------------------------------[INFO] [INFO] Building myapp-androID - Parent 1.0[INFO] [INFO] ------------------------------------------------------------------------[INFO] [INFO] [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-signing-propertIEs) @ myapp-androID-parent ---[INFO] [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireProperty Failed with message:[INFO] The 'sign.keystore' property is missing. It must contain the path to the[INFO] keystore used to sign the application.[INFO] [WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequirefilesExist Failed with message:[INFO] The 'sign.keystore' property does not point to a file. It must contain the[INFO] path to the keystore used to sign the application.[INFO] Some required files are missing:[INFO] (an empty filename was given and allowNulls is false)[INFO] [INFO] [WARNING] Rule 2: org.apache.maven.plugins.enforcer.RequireProperty Failed with message:[INFO] The 'sign.alias' property is missing. It must contain the key alias used to[INFO] sign the application.[INFO] [WARNING] Rule 3: org.apache.maven.plugins.enforcer.RequireProperty Failed with message:[INFO] The 'sign.storepass' property is missing. It must contain the password of[INFO] the keystore used to sign the application.[INFO] [WARNING] Rule 4: org.apache.maven.plugins.enforcer.RequireProperty Failed with message:[INFO] The 'sign.keypass' property is missing. It must contain the password of the[INFO] key used to sign the application.[INFO] [INFO] ------------------------------------------------------------------------[INFO] [INFO] Reactor Summary:[INFO] [INFO] [INFO] [INFO] myapp-androID - Parent ......................... FAILURE [0.577s][INFO] [INFO] myapp-androID - Application .................... SKIPPED[INFO] [INFO] myapp-androID-it - Integration tests ........... SKIPPED[INFO] [INFO] ------------------------------------------------------------------------[INFO] [INFO] BUILD FAILURE[INFO] [INFO] ------------------------------------------------------------------------[INFO] [INFO] Total time: 1.862s[INFO] [INFO] Finished at: Thu Jan 31 21:24:41 CET 2013[INFO] [INFO] Final Memory: 7M/81M[INFO] [INFO] ------------------------------------------------------------------------[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (enforce-signing-propertIEs) on project myapp-androID-parent: Some Enforcer rules have Failed. Look above for specific messages explaining why the rule Failed. -> [Help 1][INFO] [ERROR] [INFO] [ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.[INFO] [ERROR] Re-run Maven using the -X switch to enable full deBUG logging.[INFO] [ERROR] [INFO] [ERROR] For more information about the errors and possible solutions,please read the following articles:[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException[INFO] ------------------------------------------------------------------------[INFO] Reactor Summary:[INFO] [INFO] myapp-androID - Parent ......................... FAILURE [22.389s][INFO] myapp-androID - Application .................... SKIPPED[INFO] myapp-androID-it - Integration tests ........... SKIPPED[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 23.799s[INFO] Finished at: Thu Jan 31 21:24:41 CET 2013[INFO] Final Memory: 9M/81M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3:perform (default-cli) on project myapp-androID-parent: Maven execution Failed,exit code: '1' -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full deBUG logging.[ERROR] [ERROR] For more information about the errors and possible solutions,please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
我还尝试将keystore参数传递给release:perform
mvn release:perform -Dsign.keystore=/path/to/keystore \ -Dsign.alias=key-alias \ -Dsign.storepass=keystore-password \ -Dsign.keypass=key-password
但具有相同的效果.
关于如何使它有效的任何想法?
这可能是愚蠢的事,但我是Maven的初学者,我无法弄明白.
以上是内存溢出为你收集整理的android – Maven发布:执行无法识别密钥库参数全部内容,希望文章能够帮你解决android – Maven发布:执行无法识别密钥库参数所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)