aboutsummaryrefslogtreecommitdiffstats
path: root/sonar/pom.xml
blob: 3bdf6ae5ffe0e70b4688e55c56bae9f3e1dea3b6 (plain)
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
<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>org.apache.poi</groupId>
    <artifactId>poi-parent</artifactId>
    <packaging>pom</packaging>
    <version>4.0.0-SNAPSHOT</version>
    <name>Apache POI - the Java API for Microsoft Documents</name>
    <description>Maven build of Apache POI for Sonar checks</description>
    <url>http://poi.apache.org/</url>

    <mailingLists>
        <mailingList>
            <name>POI Users List</name>
            <subscribe>user-subscribe@poi.apache.org</subscribe>
            <unsubscribe>user-unsubscribe@poi.apache.org</unsubscribe>
            <archive>http://mail-archives.apache.org/mod_mbox/poi-user/</archive>
        </mailingList>
        <mailingList>
            <name>POI Developer List</name>
            <subscribe>dev-subscribe@poi.apache.org</subscribe>
            <unsubscribe>dev-unsubscribe@poi.apache.org</unsubscribe>
            <archive>http://mail-archives.apache.org/mod_mbox/poi-dev/</archive>
        </mailingList>
    </mailingLists>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <organization>
        <name>Apache Software Foundation</name>
        <url>http://www.apache.org/</url>
    </organization>

    <issueManagement>
        <system>Bugzilla</system>
        <url>https://bz.apache.org/bugzilla/</url>
    </issueManagement>

    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/poi/trunk</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/poi/trunk</developerConnection>
        <url>http://svn.apache.org/viewvc/poi</url>
    </scm>

    <repositories>
        <repository>
            <id>apache-releases-repo</id>
            <name>apache releases repo</name>
            <url>https://repository.apache.org/content/repositories/releases</url>
        </repository>
    </repositories>

    <modules>
        <module>main</module>
        <module>ooxml-schema</module>
        <module>ooxml-schema-encryption</module>
        <module>ooxml-schema-security</module>
        <module>ooxml</module>
        <module>scratchpad</module>
        <module>excelant</module>
        <module>examples</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Try to disable running SVN blame as it causes errors here because the source is copied from the actual SVN location here! -->
        <sonar.scm.disabled>true</sonar.scm.disabled>

        <!-- define some of the third-party or plugin-versions globally to use the same in all modules -->
        <xmlbeans.version>3.0.1</xmlbeans.version>
        <junit.version>4.12</junit.version>
        <xmlunit.version>2.5.1</xmlunit.version>
        <mockito.version>2.13.0</mockito.version>
        <maven.plugin.resources.version>3.0.1</maven.plugin.resources.version>
        <maven.plugin.jar.version>3.0.1</maven.plugin.jar.version>
        <maven.plugin.clean.version>3.0.0</maven.plugin.clean.version>
        <maven.plugin.download.version>1.1.0</maven.plugin.download.version>
        <maven.plugin.antrun.version>1.8</maven.plugin.antrun.version>
        <maven.plugin.surefire.version>2.19.1</maven.plugin.surefire.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.plugin.surefire.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${maven.plugin.surefire.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <systemPropertyVariables>
                        <POI.testdata.path>../../test-data</POI.testdata.path>
                        <java.awt.headless>true</java.awt.headless>
                        <org.apache.poi.util.POILogger>org.apache.poi.util.NullLogger</org.apache.poi.util.POILogger>
                    </systemPropertyVariables>
                    <!-- use to following to analyze OOM issues:	-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -->
                    <argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=target/tmp
                    </argLine>
                    <excludes>
                        <exclude>**/All*Tests.java</exclude>
                        <exclude>**/TestUnfixedBugs.java</exclude>
                        <exclude>**/TestcaseRecordInputStream.java</exclude>
                        <exclude>**/POITestCase.java</exclude>
                        <!-- TODO: error about no public construct, seems to run with JUnit 3.8... -->
                        <exclude>**/TestWordToConverterSuite*.java</exclude>
                        <exclude>**/TestExcelConverterSuite*.java</exclude>
                    </excludes>
                    <!--test>TestPPTX2PNG</test-->
                    <!--parallel>both</parallel>
                <threadCount>10</threadCount-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.2</version>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <version>${xmlunit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <!-- We need a fair amount of memory to compile the xml schema, -->
        <!-- but limit it in case it goes wrong!                        -->
        <!-- Pick the right amount based on 32 vs 64 bit jvm            -->
        <!-- ********************************************************** -->
        <!-- If you are using IntelliJ, you might want to check         -->
        <!-- http://stackoverflow.com/questions/24115142                -->
        <!-- ********************************************************** -->
        <profile>
            <id>32bitstuff</id>
            <activation>
                <property>
                    <name>sun.arch.data.model</name>
                    <value>32</value>
                </property>
            </activation>
            <properties>
                <maven.compiler.maxmem>512m</maven.compiler.maxmem>
                <argLine>-Xmx768m</argLine>
            </properties>
        </profile>

        <profile>
            <id>64bitstuff</id>
            <activation>
                <property>
                    <name>sun.arch.data.model</name>
                    <value>64</value>
                </property>
            </activation>
            <properties>
                <maven.compiler.maxmem>768m</maven.compiler.maxmem>
                <argLine>-Xmx1024m</argLine>
            </properties>
        </profile>

        <profile>
            <id>xmlbean</id>
            <activation>
                <file>
                    <exists>xmlbeans.marker</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xmlbeans-maven-plugin</artifactId>
                        <version>2.3.3</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>xmlbeans</goal>
                                </goals>
                                <configuration>
                                    <schemaDirectory>${basedir}/target/schemas</schemaDirectory>
                                    <javaSource>1.5</javaSource>
                                    <noJavac>true</noJavac>
                                    <noUpa>${xmlbeans.noUpa}</noUpa>
                                    <noPvr>${xmlbeans.noPvr}</noPvr>
                                    <xmlConfigs>
                                        <xmlConfig implementation="java.io.File">
                                            ${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionCertificate.xsdconfig
                                        </xmlConfig>
                                        <xmlConfig implementation="java.io.File">
                                            ${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionInfo.xsdconfig
                                        </xmlConfig>
                                        <xmlConfig implementation="java.io.File">
                                            ${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionPassword.xsdconfig
                                        </xmlConfig>
                                        <xmlConfig implementation="java.io.File">
                                            ${basedir}/../../src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig
                                        </xmlConfig>
                                    </xmlConfigs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>${maven.plugin.antrun.version}</version>
                        <executions>
                            <execution>
                                <id>copy-xmltype-and-xsdconfig</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <copy todir="${basedir}/target/schemas">
                                            <fileset dir="${basedir}/../../src/ooxml/resources/org/apache/poi/schemas"/>
                                        </copy>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>replace-xmltypeloader</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <property name="xmlbean.sources.dir"
                                                  location="${basedir}/target/generated-sources/xmlbeans"/>

                                        <property name="loaderMethod"><![CDATA[
        private static java.lang.ref.SoftReference<org.apache.xmlbeans.SchemaTypeLoader> typeLoader;

        private static synchronized org.apache.xmlbeans.SchemaTypeLoader getTypeLoader() {
            org.apache.xmlbeans.SchemaTypeLoader stl = (typeLoader == null) ? null : typeLoader.get();
            if (stl == null) {
                stl = org.apache.xmlbeans.XmlBeans.typeLoaderForClassLoader(\2.class.getClassLoader());
                typeLoader = new java.lang.ref.SoftReference(stl);
            }
            return stl;
        }

        public static \2 newInstance\(\) \{]]></property>

                                        <replaceregexp byline="true"
                                                       match="(\s*)public static ([^ ]+) newInstance\(\) \{"
                                                       replace="${loaderMethod}">
                                            <fileset dir="${xmlbean.sources.dir}" includes="**/*.java"
                                                     excludes="**/impl/**"/>
                                        </replaceregexp>

                                        <replace dir="${xmlbean.sources.dir}" includes="**/*.java"
                                                 excludes="**/impl/**">
                                            <replacetoken>org.apache.xmlbeans.XmlBeans.getContextTypeLoader
                                            </replacetoken>
                                            <replacevalue>getTypeLoader</replacevalue>
                                        </replace>

                                        <!-- remove deprecated warnings, as we prefer the array methods - see #56854 -->
                                        <replace dir="${xmlbean.sources.dir}" includes="**/*.java"
                                                 excludes="**/impl/**">
                                            <replacetoken><![CDATA[     * @deprecated
]]></replacetoken>
                                        </replace>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>remove-xmltypeloader-from-schema-jar</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <touch file="${basedir}/target/generated-sources/xmlbeans/.staleFlag"/>
                                        <delete dir="${basedir}/target/classes/org/apache"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <dependencies>
                <dependency>
                    <groupId>org.apache.xmlbeans</groupId>
                    <artifactId>xmlbeans</artifactId>
                    <version>${xmlbeans.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>