forked from documents4j/documents4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
488 lines (443 loc) · 21.2 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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-parent</artifactId>
<version>1.1.8-SNAPSHOT</version>
<packaging>pom</packaging>
<!--
Note: This project can be built on any machine. However, any MS Office specific test requires an installation
of MS Office for Windows on the same physical machine. For running these tests, activate the 'ms-office' profile.
Additionally, the following setup is required:
(1) An installation of the Microsoft Scripting Host (comes with most versions of MS Windows).
(2) An installation of Microsoft Word 2007 or higher (MS Word 2007 additionally requires the PDF plugin) or
and installation of Microsoft Excel 2007 or higher.
(3) Microsoft Word and Microsoft Excel are not running when the built process is started and are neither started
manually while the tests are running.
(4) Microsoft Word and Microsoft Excel are properly activated and do not require any startup configuration.
If MS Word or MS Excel are starting a wizard on program startup, any conversion attempts will fail.
Furthermore, for running the tests of the documents4j-server-standalone module, you require:
(4) Your machine must have a free port and it must be possible to bind a server listener to this port
(the Jersey related tests suggest port 9998 to be available for testing).
Many tests throughout all modules require:
(5) Possibility to create temporary folders on the local file system and creating, deleting and executing
files in these folders.
Please note that Microsoft does not recommend or officially supports MS Office automation. Also note the legal
requirements to run MS Office in a server context on 'http://support.microsoft.com/kb/257757'.
Also, be careful when running a local MS Word or MS Excel transformer since they require synchronization with
the MS Office installation. When the JVM running this program exits abnormally (for example by a user interrupt
causing a process termination signal), the application cannot run any shut down hooks to terminate MS Office
components. The MS Office process will therefore leak. When developing and testing this application, always
keep an eye on your machine's task manager. However, note that documents4j attempts to pick up orphaned MS
Office processes on startup, i.e. due to an unexpected restart.
Profile summary:
(1) ms-office: Runs tests that require MS Word and MS Excel installed on MS Windows.
(2) shaded-jar: Build a shaded jar for the standalone conversion server and standalone client
(3) javadoc: build javadoc
(4) source: build source jar
(5) checks: Perform additional source code checks (activated by default).
Note that MS Office components do not officially support their execution in a service context. When run as a
service, MS Office components are always started with MS Window's local service account which does not configure
a desktop. However, MS Office components expect a desktop to exist in order to run properly. Without such a
desktop configuration, MS Office will start up correctly but fail to read any input file. In order to allow
MS Office components to run in a service context, there are two possible approaches of which the first approach is
more recommended:
(1) On a 32-bit system, create the folder 'C:\Windows\System32\config\systemprofile\Desktop'.
On a 64-bit system, create the folder 'C:\Windows\SysWOW64\config\systemprofile\Desktop'.
For more information, see
'http://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008-x64?forum=innovateonoffice'.
(2) You can manipulate MS Window's registry such that MS Office applications are run with another account than
the local service account. For an explanation of this approach, see
'http://social.technet.microsoft.com/Forums/en-US/334c9f30-4e27-4904-9e71-abfc65975e23/problem-running-windows-service-with-excel-object-on-windows-server-2008-64-bit?forum=officesetupdeploylegacy'.
-->
<modules>
<module>documents4j-api</module>
<module>documents4j-local</module>
<module>documents4j-local-demo</module>
<module>documents4j-transformer</module>
<module>documents4j-transformer-api</module>
<module>documents4j-transformer-msoffice</module>
<module>documents4j-client</module>
<module>documents4j-client-standalone</module>
<module>documents4j-server</module>
<module>documents4j-server-standalone</module>
<module>documents4j-aggregation</module>
<module>documents4j-util-all</module>
<module>documents4j-util-conversion</module>
<module>documents4j-util-ws</module>
<module>documents4j-util-standalone</module>
<module>documents4j-util-transformer-process</module>
<module>documents4j-test</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shaded.classifier>shaded</shaded.classifier>
<version.javax.rs>2.0.1</version.javax.rs>
<version.javax.servlet>3.0.1</version.javax.servlet>
<version.javax.inject>1</version.javax.inject>
<version.javax.annotation>1.2</version.javax.annotation>
<version.javax.activation>1.1.1</version.javax.activation>
<version.javax.jaxb>2.3.0</version.javax.jaxb>
<version.jersey>2.29</version.jersey>
<version.guava>30.0-jre</version.guava>
<version.zt-exec>1.11</version.zt-exec>
<version.jopt-simple>5.0.4</version.jopt-simple>
<version.slf4j>1.7.28</version.slf4j>
<version.logback>1.2.3</version.logback>
<version.junit>4.13.1</version.junit>
<version.mockito>3.0.0</version.mockito>
<version.thread-weaver>0.2</version.thread-weaver>
<version.jetty>9.4.20.v20190813</version.jetty>
<version.maven.compiler-plugin>3.1</version.maven.compiler-plugin>
<version.maven.surefire-plugin>2.16</version.maven.surefire-plugin>
<version.maven.source-plugin>2.2.1</version.maven.source-plugin>
<version.maven.javadoc-plugin>2.9.1</version.maven.javadoc-plugin>
<version.maven.gpg-plugin>1.6</version.maven.gpg-plugin>
<version.maven.war-plugin>2.3</version.maven.war-plugin>
<version.maven.shade-plugin>2.1</version.maven.shade-plugin>
<version.maven.cobertura-plugin>2.7</version.maven.cobertura-plugin>
<version.maven.checkstyle-plugin>2.15</version.maven.checkstyle-plugin>
<version.maven.resources-plugin>2.6</version.maven.resources-plugin>
<version.maven.compiler-plugin>3.1</version.maven.compiler-plugin>
<version.maven.release-plugin>2.5.1</version.maven.release-plugin>
<version.maven.install-plugin>2.5.1</version.maven.install-plugin>
<version.maven.jxr-plugin>2.3</version.maven.jxr-plugin>
<version.java>8</version.java>
</properties>
<developers>
<developer>
<id>raphw</id>
<name>Rafael Winterhalter</name>
<email>[email protected]</email>
<url>http://rafael.codes</url>
<roles>
<role>developer</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers>
<inceptionYear>2013</inceptionYear>
<url>http://documents4j.com</url>
<name>documents4j</name>
<description>A Java library for converting documents.</description>
<scm>
<connection>scm:git:[email protected]:documents4j/documents4j.git</connection>
<developerConnection>scm:git:[email protected]:documents4j/documents4j.git</developerConnection>
<url>[email protected]:documents4j/documents4j.git</url>
<tag>documents4j-parent-0.1.2</tag>
</scm>
<issueManagement>
<system>github.com</system>
<url>https://github.com/documents4j/documents4j/issues</url>
</issueManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${version.maven.jxr-plugin}</version>
</plugin>
</plugins>
</reporting>
<distributionManagement>
<snapshotRepository>
<id>central</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>central</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<dependencyManagement>
<dependencies>
<!-- General -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${version.guava}</version>
</dependency>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-exec</artifactId>
<version>${version.zt-exec}</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>${version.jopt-simple}</version>
</dependency>
<!-- Jersey -->
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${version.jersey}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${version.jersey}</version>
</dependency>
<!-- Java extensions -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${version.javax.rs}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${version.javax.servlet}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>${version.javax.inject}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${version.javax.annotation}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${version.javax.activation}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${version.javax.jaxb}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${version.javax.jaxb}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${version.javax.jaxb}</version>
</dependency>
<!-- Testing / Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${version.logback}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${version.mockito}</version>
</dependency>
<dependency>
<groupId>com.googlecode.thread-weaver</groupId>
<artifactId>threadweaver</artifactId>
<version>${version.thread-weaver}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<!-- Release configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${version.maven.release-plugin}</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>shaded-jar,javadoc,source</releaseProfiles>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>documents4j-@{project.version}</tagNameFormat>
</configuration>
</plugin>
<!-- Cobertura test case coverage -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${version.maven.cobertura-plugin}</version>
<configuration>
<aggregate>true</aggregate>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<check />
</configuration>
</plugin>
<!-- Setup plugin for deployment to Maven Central. -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>central</serverId>
<nexusUrl>https://oss.sonatype.org</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.maven.resources-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${version.maven.install-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven.compiler-plugin}</version>
<inherited>true</inherited>
<configuration>
<source>${version.java}</source>
<target>${version.java}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${version.maven.release-plugin}</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>shaded-jar,javadoc,source</releaseProfiles>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>source</id>
<build>
<plugins>
<!-- Create source artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${version.maven.source-plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>javadoc</id>
<build>
<plugins>
<!-- Create javadoc artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${version.maven.javadoc-plugin}</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>aggregate-javadoc</id>
<goals>
<goal>aggregate</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<!-- Sign artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.maven.gpg-plugin}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>checks</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<!-- Check style on build -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${version.maven.checkstyle-plugin}</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>