我創建了一個Android Maven項目,正如本文中所述(link to post)。我使用最後一個原型:android-release。如何使用maven-android-plugin項目的外部settings.xml中的maven設置?
所以一切工作正常,除非我想發佈一個版本,我不知道如何通過證書屬性。我創建了一個settings.xml中包含以下內容:
<?xml version="1.0" encoding="UTF-8"?>
<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-debug</id>
<properties>
<sign.keystore>/Users/me/.android/debug.keystore</sign.keystore>
<sign.alias>androiddebugkey</sign.alias>
<sign.storepass>android</sign.storepass>
<sign.keypass>android</sign.keypass>
</properties>
</profile>
<profile>
<id>android-release</id>
<properties>
<sign.keystore>/Users/me/myKeystore.keystore</sign.keystore>
<sign.alias>myAlias</sign.alias>
<sign.storepass><![CDATA[myPassword]]></sign.storepass>
<sign.keypass><![CDATA[myPassword]]></sign.keypass>
</properties>
</profile>
</profiles>
然後我運行:
mvn -s setttings.xml clean release:prepare release:perform -Pandroid-release
但我一直忽略了Android的釋放曲線定義的值。
任何想法如何讓這個工作?當我剛運行時:
mvn -s setttings.xml clean install -Pandroid-release,release
它建立一個apk並用正確的證書籤名。所以也許它只是maven-enforcer插件,它不能從settings.xml讀取屬性?