forked from Pi4J/pi4j-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
executable file
·335 lines (313 loc) · 14.3 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<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>
<!-- MAVEN ARTIFACT INFORMATION -->
<artifactId>pi4j-core</artifactId>
<name>Pi4J :: Java Library (Core)</name>
<description>Pi4J Java Library for the Raspberry Pi</description>
<packaging>jar</packaging>
<parent>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-parent</artifactId>
<version>1.4</version>
</parent>
<!-- PROJECT DEPENDENCIES -->
<dependencies>
<!-- while the pi4j-native dependency is not needed for compiling this
project, including it here ensures that it gets compiled in the maven
build lifecycle before the pi4j-core project. -->
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<classifier>raspberrypi-dynamic-armhf</classifier>
<version>${project.version}</version>
<type>so</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<classifier>raspberrypi-dynamic-aarch64</classifier>
<version>${project.version}</version>
<type>so</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- BUILD INSTRUCTIONS -->
<build>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<filtering>false</filtering>
<includes>
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
<include>README.md</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>-noverify</argLine> <!-- needed for running PowerMock for com.pi4j.jni.I2C -->
<excludes>
<!-- TEMPORARILY EXCLUDED TEST; TEST FAILS ON OSX -->
<exclude>
**/I2CBusImplTest.java
</exclude>
</excludes>
<excludedGroups>com.pi4j.IntegrationTests</excludedGroups>
</configuration>
</plugin>
<!-- JAVA COMPILER -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<!-- INCLUDE SOURCE JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- INCLUDE JAVADOC JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<!-- GENERATE LICENSE HEADERS IN SOURCE FILES -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<!-- RETRIEVE THE JNI NATIVE LIBRARY DEPENDENCY -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<!-- we define the libpi4j native project as a dependency so that
native library can be included in the final packaged pi4j.jar -->
<!-- LIBPI4J for the Raspberry-Pi platform -->
<!-- NOTE: As of 2018-04-23, Pi4J no longer includes
a statically linked wiringPi lib for the Raspberry Pi platform. -->
<artifactItem>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<version>${project.version}</version>
<classifier>raspberrypi-dynamic-armhf</classifier>
<type>so</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/raspberrypi/dynamic
</outputDirectory>
<destFileName>libpi4j-armhf.so</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<version>${project.version}</version>
<classifier>raspberrypi-dynamic-aarch64</classifier>
<type>so</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/raspberrypi/dynamic
</outputDirectory>
<destFileName>libpi4j-aarch64.so</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- EMBED THE JNI NATIVE LIBRARY INSIDE THE JAR -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>embed-jni-native-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/lib</directory>
<targetPath>lib</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- OSGi BUNDLE -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>
com.pi4j.concurrent.*,
com.pi4j.util.*,
com.pi4j.jni.*,
com.pi4j.wiringpi.*,
com.pi4j.system.*,
com.pi4j.temperature.*,
com.pi4j.io.serial.*,
com.pi4j.io.gpio.*,
com.pi4j.io.i2c.*,
com.pi4j.io.spi.*,
com.pi4j.io.w1.*,
com.pi4j.io.wdt.*
</Export-Package>
<Import-Package>!com.pi4j.*</Import-Package>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- INCLUDE OSGi MANIFEST IN JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- OPTIONALLY DEPLOY THE FINAL JAR TO THE RASPBERRY PI -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- copy the compiled JAR file to the Raspberry Pi platform platform -->
<execution>
<id>transfer-compiled-pi4j-jar</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<if>
<equals arg1="${pi4j.dev.transfer}" arg2="true"/>
<then>
<!-- ensure the target directory exists on the Raspberry Pi -->
<sshexec host="${pi4j.dev.host}" port="${pi4j.dev.port}"
username="${pi4j.dev.user}"
password="${pi4j.dev.password}" trust="true" failonerror="false"
verbose="true" command="mkdir --parents ${pi4j.dev.directory}"/>
<!-- copy the JAR file to the Raspberry Pi -->
<scp
file="${project.build.directory}/${project.build.finalName}.jar"
todir="${pi4j.dev.user}:${pi4j.dev.password}@${pi4j.dev.host}:${pi4j.dev.directory}"
port="${pi4j.dev.port}" trust="true" verbose="true" failonerror="true">
</scp>
</then>
</if>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>${ant-jsch.version}</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>${jsch.version}</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>${ant-contrib.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<configuration>
<includes>
<include>**/*</include>
</includes>
<groups>com.pi4j.IntegrationTests</groups>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>