forked from fengzhizi715/SAF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
215 lines (192 loc) · 9.13 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?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>cn.salesuite.saf</groupId>
<artifactId>android-saf</artifactId>
<packaging>jar</packaging>
<version>1.1.4-SNAPSHOT</version>
<name>Simple Android Framework</name>
<url>https://github.com/fengzhizi715/SAF</url>
<!--
https://code.google.com/p/maven-android-plugin/wiki/GettingStarted
maven build的前提条件
Prerequisites
JDK 1.6+ installed as required for Android development
Android SDK (r21.1 or later, latest is best supported) installed, preferably with all platforms, see http://developer.android.com/sdk/index.html
Maven 3.1.1+ installed, see http://maven.apache.org/download.html
Set environment variable ANDROID_HOME to the path of your installed Android SDK and add $ANDROID_HOME/tools as well as $ANDROID_HOME/platform-tools to your $PATH. (or on Windows %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools).
修改Maven的用户配置文件setting.xml
该文件位于 {USER.HOME}/.m2 目录下(如 C:\Documents and Settings\{当前用户名}\.m2),编辑该文件并添加如下内容:
<?xml version="1.0" encoding="UTF-8"?>
<settings> ...
<pluginGroups>
<pluginGroup>com.jayway.maven.plugins.android.generation2</pluginGroup>
</pluginGroups>
</settings>
配置这个是为了可以使用简短的maven-android-plugin插件的命令行,否则
>mvn android:deploy
就要长篇大论的写为:
>mvn com.jayway.maven.plugins.android.generation2:maven-android-plugin:deploy
<parent>
<version>1.0</version>
<groupId></groupId>
<artifactId>android-saf-parent</artifactId>
</parent>
-->
<properties>
<platform_version>4.1.1.4</platform_version>
</properties>
<dependencies>
<!-- android.jar 依赖 -->
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform_version}</version>
<scope>provided</scope>
</dependency>
<!--
The Support Package includes static "support libraries" that you can add to your Android application in order to use APIs that are either not available for older platform versions or that offer "utility" APIs that aren't a part of the framework APIs.
-->
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
</dependency>
<!-- A library jar that provides annotations for the Google Android Platform. -->
<dependency>
<groupId>com.google.android</groupId>
<artifactId>annotations</artifactId>
<version>4.1.1.4</version>
</dependency>
<!--
The codec package contains simple encoder and decoders for various formats such as Base64 and Hexadecimal.
In addition to these widely used encoders and decoders, the codec package also maintains a collection of phonetic encoding utilities.
-->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.7</version>
</dependency>
<!-- A disk-based implementaion of a least-recently used cache.-->
<dependency>
<groupId>com.jakewharton</groupId>
<artifactId>disklrucache</artifactId>
<version>2.0.3</version>
</dependency>
<!-- Fastjson is a JSON processor (JSON parser + JSON generator) written in Java-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.34.android</version>
</dependency>
<!-- Date and time library to replace JDK date handling-->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<dependencies>
<!--
<dependency>
<groupId>com.squareup.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>${dagger.version}</version>
</dependency>
-->
</dependencies>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>utf8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<!-- via this activation the profile is automatically used when the release is done with the maven release
plugin -->
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
<goal>verify</goal>
</goals>
<phase>package</phase>
<inherited>true</inherited>
<configuration>
<removeExistingSignatures>true</removeExistingSignatures>
<archiveDirectory />
<!-- These values can either be placed directly into to file below, or provided
via the command line during the build process as such:
"mvn clean release -DkeyFile=foobar" ... etc.
This will keep the keystore out of your file so no prying eyes can see.
Also, if you have a ci (Continuous Integration) profile, these values can be
passed in via the build server. -->
<keystore>${keyFile}</keystore>
<storepass>${storePassword}</storepass>
<keypass>${keyPassword}</keypass>
<alias>${keyAlias}</alias>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
<!-- the signed apk then needs to be zipaligned
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<sign>
<debug>false</debug>
</sign>
<zipalign>
<verbose>true</verbose>
<outputApk>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk</outputApk>
</zipalign>
<manifest>
<debuggable>false</debuggable>
</manifest>
</configuration>
<executions>
<execution>
<id>alignApk</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>
</profile>
</profiles>
</project>