]> source.dussan.org Git - poi.git/commitdiff
try to fix sonar build
authorAndreas Beeker <kiwiwings@apache.org>
Fri, 23 Oct 2020 22:30:33 +0000 (22:30 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Fri, 23 Oct 2020 22:30:33 +0000 (22:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882792 13f79535-47bb-0310-9956-ffa450edef68

sonar/integration-test/pom.xml
sonar/main/pom.xml
sonar/ooxml-schema-encryption/pom.xml [deleted file]
sonar/ooxml-schema-encryption/xmlbeans.marker [deleted file]
sonar/ooxml-schema-security/pom.xml [deleted file]
sonar/ooxml-schema-security/xmlbeans.marker [deleted file]
sonar/ooxml-schema/pom.xml
sonar/ooxml/pom.xml
sonar/pom.xml
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
src/testcases/org/apache/poi/ss/formula/functions/TestDateValue.java

index 668c6469b35ea2b8b783074d9b347ffaaf1eb501..d28861c891c3adfebcd46f916d00460c8329ce33 100644 (file)
@@ -18,7 +18,7 @@
             <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
-                <version>${maven.plugin.resources.version}</version>
+<!--                <version>${mavnen.plugin.resources.version}</version>-->
                 <executions>
                     <execution>
                         <id>copy-tests</id>
                                 <resource>
                                     <directory>../../src/integrationtest</directory>
                                 </resource>
+                                <resource>
+                                    <directory>../../src/testcases</directory>
+                                    <includes>
+                                        <include>org/apache/poi/POIDataSamples.java</include>
+                                        <include>org/apache/poi/util/NullPrintStream.java</include>
+                                        <include>org/apache/poi/util/NullOutputStream.java</include>
+                                        <include>org/apache/poi/hssf/HSSFTestDataSamples.java</include>
+                                    </includes>
+                                </resource>
                             </resources>
                         </configuration>
                     </execution>
index 00c49dae1b26bfea5122d8bf88657527d53adce0..b2a7da5992106cc9b067f48b372c39293f6fe063 100644 (file)
                                                </goals>
                                                <configuration>
                                                        <outputDirectory>${basedir}/src/main/java</outputDirectory>
-                                                       <resources>          
+                                                       <resources>
                                                                <resource>
                                                                        <directory>../../src/java</directory>
                                                                </resource>
-                                                       </resources>              
-                                               </configuration>            
+                                                       </resources>
+                                               </configuration>
                                        </execution>
                                        <execution>
                                                <id>copy-resources</id>
                                                </goals>
                                                <configuration>
                                                        <outputDirectory>${basedir}/src/main/resources</outputDirectory>
-                                                       <resources>          
+                                                       <resources>
                                                                <resource>
                                                                        <directory>../../src/resources/main</directory>
                                                                </resource>
-                                                       </resources>              
-                                               </configuration>            
+                                                       </resources>
+                                               </configuration>
                                        </execution>
                                        <execution>
                                                <id>copy-tests</id>
                                                </goals>
                                                <configuration>
                                                        <outputDirectory>${basedir}/src/test/java</outputDirectory>
-                                                       <resources>          
+                                                       <resources>
                                                                <resource>
                                                                        <directory>../../src/testcases</directory>
                                                                </resource>
-                                                       </resources>              
-                                               </configuration>            
+                                                       </resources>
+                                               </configuration>
                                        </execution>
                                </executions>
                        </plugin>
@@ -81,8 +81,8 @@
                         </fileset>
                     </filesets>
                 </configuration>
-            </plugin>                  
-                       
+            </plugin>
+
                        <!-- provide the test-jar for other modules -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                        </execution>
                                </executions>
                        </plugin>
-
-            <!-- set jvm parameters for surefire plugin -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>${maven.plugin.surefire.version}</version>
-                <configuration>
-                    <argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=${basedir}/target/tmp -XX:-OmitStackTraceInFastThrow</argLine>
-                </configuration>
-            </plugin>
                </plugins>
     </build>
 
             <artifactId>commons-logging</artifactId>
             <version>1.2</version>
         </dependency>
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-            <version>2.3.1</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>2.3.2</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-core</artifactId>
-            <version>2.3.0.1</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.activation</groupId>
-            <artifactId>activation</artifactId>
-            <version>1.1.1</version>
-        </dependency>
     </dependencies>
 </project>
diff --git a/sonar/ooxml-schema-encryption/pom.xml b/sonar/ooxml-schema-encryption/pom.xml
deleted file mode 100644 (file)
index 40a114e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<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>
-    <parent>
-        <groupId>org.apache.poi</groupId>
-        <artifactId>poi-parent</artifactId>
-        <version>5.0.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-    <artifactId>poi-ooxml-schema-encryption</artifactId>
-    <packaging>jar</packaging>
-
-    <name>Apache POI - Openxmlformats Encryption Schema package</name>
-
-       <properties>
-               <!-- see http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus for details of this property -->
-               <sonar.exclusions>target/generated-sources/*</sonar.exclusions>
-       </properties>
-  
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-antrun-plugin</artifactId>
-                               <version>${maven.plugin.antrun.version}</version>
-                               <executions>
-                                       <execution>
-                                               <id>unzip-schema</id>
-                                               <phase>generate-sources</phase>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <target>
-                                                               <copy todir="target/schemas">
-                                                                       <fileset dir="../../src/ooxml/resources/org/apache/poi/poifs/crypt" includes="encryption*.*"/>
-                                                               </copy>
-                                                       </target>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
-       </build>
-
-       <dependencies>
-               <dependency>
-                       <groupId>org.apache.xmlbeans</groupId>
-                       <artifactId>xmlbeans</artifactId>
-                       <version>${xmlbeans.version}</version>
-               </dependency>
-    </dependencies>
-</project>
diff --git a/sonar/ooxml-schema-encryption/xmlbeans.marker b/sonar/ooxml-schema-encryption/xmlbeans.marker
deleted file mode 100644 (file)
index 2744493..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This purpose of this marker file is solely to activate the xmlbeans maven profile.
\ No newline at end of file
diff --git a/sonar/ooxml-schema-security/pom.xml b/sonar/ooxml-schema-security/pom.xml
deleted file mode 100644 (file)
index 493dd64..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-<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>
-    <parent>
-        <groupId>org.apache.poi</groupId>
-        <artifactId>poi-parent</artifactId>
-        <version>5.0.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-    <artifactId>poi-ooxml-schema-security</artifactId>
-    <packaging>jar</packaging>
-
-    <name>Apache POI - Openxmlformats Security-Schema package</name>
-
-       <properties>
-               <!-- see http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus for details of this property -->
-               <sonar.exclusions>target/generated-sources/*</sonar.exclusions>
-               <maven.compiler.fork>true</maven.compiler.fork>
-               <xmlbeans.noUpa>true</xmlbeans.noUpa>
-               <xmlbeans.noPvr>true</xmlbeans.noPvr>
-       </properties>
-    <build>
-               <plugins>
-                       <!-- Download and unpack the OfficeOpenXML Schema and use xmlbeans to create classes from the XSDs -->
-                       <!-- use maven plugin instead of ant tasks get because of caching feature ... -->
-                       <plugin>
-                               <groupId>com.googlecode.maven-download-plugin</groupId>
-                               <artifactId>download-maven-plugin</artifactId>
-                               <version>${maven.plugin.download.version}</version>
-                               <executions>
-                                       <execution>
-                                               <id>install-xsds-part-1</id>
-                                               <phase>generate-sources</phase>
-                                               <goals><goal>wget</goal></goals>
-                                               <configuration>
-                                                       <url>https://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%201st%20edition%20Part%202%20(PDF).zip</url>
-                                                       <unpack>true</unpack>
-                                                       <md5>c8f0eac388691d5be0d1647146400a10</md5>
-                                               </configuration>
-                                       </execution>
-                                       <execution>
-                                               <id>install-xsds-part-2</id>
-                                               <phase>generate-sources</phase>
-                                               <goals><goal>wget</goal></goals>
-                                               <configuration>
-                                                       <outputDirectory>target/schemas</outputDirectory>
-                                                       <url>https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd</url>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
-
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-antrun-plugin</artifactId>
-                               <version>${maven.plugin.antrun.version}</version>
-                               <executions>
-                                       <execution>
-                                               <id>unzip-schema</id>
-                                               <phase>generate-sources</phase>
-                                               <goals>
-                                                       <goal>run</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <target>
-                                                               <echo message="unzip schemas" />
-                                                               <unzip src="target/OpenPackagingConventions-XMLSchema.zip" dest="target/schemas/">
-                                                                       <patternset>
-                                                                               <include name="opc-digSig.xsd"/>
-                                                                               <include name="opc-relationships.xsd"/>
-                                                                       </patternset>
-                                                               </unzip>
-                                                               <copy todir="target/schemas">
-                                                                       <fileset dir="../../src/ooxml/resources/org/apache/poi">
-                                                                               <include name="poifs/crypt/signatureInfo.xsd"/>
-                                                                               <include name="schemas/XAdES*.xsd"/>
-                                                                       </fileset>
-                                                               </copy>
-                                                       </target>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
-               </plugins>
-    </build>
-
-    <dependencies>
-               <dependency>
-                       <groupId>org.apache.xmlbeans</groupId>
-                       <artifactId>xmlbeans</artifactId>
-                       <version>${xmlbeans.version}</version>
-               </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>poi-main</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>poi-scratchpad</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/sonar/ooxml-schema-security/xmlbeans.marker b/sonar/ooxml-schema-security/xmlbeans.marker
deleted file mode 100644 (file)
index 2744493..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This purpose of this marker file is solely to activate the xmlbeans maven profile.
\ No newline at end of file
index 184e7ebdedd8cb12d6915faa7565170b5a1d4616..b65bf6168a1d1c6136f3408a73bcbb54d81263c9 100644 (file)
                <!-- see http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus for details of this property -->
                <sonar.exclusions>target/generated-sources/*</sonar.exclusions>
                <maven.compiler.fork>true</maven.compiler.fork>
-               <xmlbeans.xsdconfig>${basedir}/../../src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig</xmlbeans.xsdconfig>
        </properties>
 
     <build>
                <plugins>
-                       <!-- Download and unpack the OfficeOpenXML Schema and use xmlbeans to create classes from the XSDs -->
                        <plugin>
-                               <groupId>com.googlecode.maven-download-plugin</groupId>
-                               <artifactId>download-maven-plugin</artifactId>
-                               <version>${maven.plugin.download.version}</version>
+                               <artifactId>maven-antrun-plugin</artifactId>
+                               <version>${maven.plugin.antrun.version}</version>
                                <executions>
                                        <execution>
-                                               <id>download-xsds</id>
+                                               <id>copy-xmltype-and-xsdconfig</id>
                                                <phase>generate-sources</phase>
                                                <goals>
-                                                       <goal>wget</goal>
+                                                       <goal>run</goal>
                                                </goals>
                                                <configuration>
-                                                       <url>https://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%201st%20edition%20Part%204%20(PDF).zip</url>
-                                                       <unpack>true</unpack>
-                                                       <md5>abe6bb6e7799e854934b3c634e8bcf7b</md5>
+                                                       <target>
+                                                               <property name="xsdir" value="${basedir}/../../src/ooxml/resources/org/apache/poi"/>
+                                                               <copy todir="${basedir}/target/schemas">
+                                                                       <zipfileset src="${xsdir}/schemas/OfficeOpenXML-XMLSchema.zip"/>
+                                                                       <zipfileset src="${xsdir}/schemas/OpenPackagingConventions-XMLSchema.zip" includes="opc-digSig.xsd,opc-relationships.xsd"/>
+                                                                       <fileset dir="${xsdir}/xdgf" includes="*.xsd,*.xsdconfig"/>
+                                                                       <fileset dir="${xsdir}/schemas" includes="*.xsd,*.xsdconfig"/>
+                                                                       <fileset dir="${xsdir}/poifs/crypt" includes="signatureInfo.xsd"/>
+                                                               </copy>
+                                                       </target>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
 
                        <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-antrun-plugin</artifactId>
-                               <version>${maven.plugin.antrun.version}</version>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>exec-maven-plugin</artifactId>
+                               <version>3.0.0</version>
                                <executions>
                                        <execution>
-                                               <id>unzip-schema</id>
-                                               <phase>generate-sources</phase>
-                                               <configuration>
-                                                       <target>
-                                                               <echo message="unzip schemas" />
-                                                               <unzip src="target/OfficeOpenXML-XMLSchema.zip" dest="target/schemas" />
-                                                               <copy file="../../src/ooxml/resources/org/apache/poi/xdgf/visio.xsd"
-                                                                       todir="target/schemas"/>
-                                                       </target>
-                                               </configuration>
+                                               <phase>process-sources</phase>
                                                <goals>
-                                                       <goal>run</goal>
+                                                       <!-- need to use exec instead of java, because SchemaCompiler calls System.exit() -->
+                                                       <goal>exec</goal>
                                                </goals>
                                        </execution>
                                </executions>
+                               <configuration>
+                                       <executable>java</executable>
+                                       <arguments>
+                                               <argument>-classpath</argument>
+                                               <!-- automatically creates the classpath using all project dependencies,
+                                                        also adding the project build directory -->
+                                               <classpath/>
+                                               <argument>org.apache.xmlbeans.impl.tool.SchemaCompiler</argument>
+                                               <argument>-srconly</argument>
+                                               <argument>-name</argument>
+                                               <argument>ooxml</argument>
+                                               <argument>-repackage</argument>
+                                               <argument>org.apache.xmlbeans.metadata:org.apache.poi.schemas.ooxml</argument>
+                                               <argument>-d</argument>
+                                               <argument>${basedir}/target/generated-resources</argument>
+                                               <argument>-src</argument>
+                                               <argument>${basedir}/target/generated-sources</argument>
+                                               <argument>${basedir}/target/schemas</argument>
+                                       </arguments>
+                                       <additionalClasspathElements>
+                                               <additionalClasspathElement>
+                                                       ${basedir}/../../lib/ooxml/xmlbeans-4.0.0.jar
+                                               </additionalClasspathElement>
+                                       </additionalClasspathElements>
+                               </configuration>
+                       </plugin>
+
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>build-helper-maven-plugin</artifactId>
+                               <version>3.2.0</version>
+                               <executions>
+                                       <execution>
+                                               <id>add-source</id>
+                                               <goals>
+                                                       <goal>add-source</goal>
+                                                       <goal>add-resource</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>${basedir}/target/generated-resources</directory>
+                                                               </resource>
+                                                               <resource>
+                                                                       <directory>${basedir}/../../src/multimodule/ooxml-schemas/java9</directory>
+                                                                       <targetPath>META-INF/versions/9</targetPath>
+                                                                       <includes>
+                                                                               <include>*.class</include>
+                                                                       </includes>
+                                                               </resource>
+                                                       </resources>
+                                                       <sources>
+                                                               <source>${basedir}/target/generated-sources</source>
+                                                       </sources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                               <version>3.2.0</version>
+                               <configuration>
+                                       <archive>
+                                               <manifestEntries>
+                                                       <Multi-Release>true</Multi-Release>
+                                                       <Automatic-Module-Name>org.apache.poi.ooxml.schemas</Automatic-Module-Name>
+                                               </manifestEntries>
+                                       </archive>
+                               </configuration>
                        </plugin>
                </plugins>
     </build>
 
-    <dependencies>
+       <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>poi-main</artifactId>
index 17c383eb1ed90615db268b2a657c91896d4e9a1a..dd908ed814af7e13410024771c17c1052dfee8a9 100644 (file)
             <artifactId>poi-ooxml-schema</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>poi-ooxml-schema-encryption</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>poi-ooxml-schema-security</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>poi-main</artifactId>
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>29.0-jre</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <!-- don't add it to the distribution -->
             <groupId>org.apache.xmlgraphics</groupId>
index 35de60c29f2389f2ee22004cad81854b58e434a6..62301c2a46e94122ebf34f17bd948c4571b02e5a 100644 (file)
@@ -58,8 +58,6 @@
     <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>
         <junit.version>4.13</junit.version>
         <xmlunit.version>2.7.0</xmlunit.version>
         <mockito.version>3.5.15</mockito.version>
-        <maven.plugin.resources.version>3.1.0</maven.plugin.resources.version>
+        <maven.plugin.resources.version>3.2.0</maven.plugin.resources.version>
         <maven.plugin.jar.version>3.2.0</maven.plugin.jar.version>
         <maven.plugin.clean.version>3.1.0</maven.plugin.clean.version>
-        <maven.plugin.download.version>1.5.0</maven.plugin.download.version>
-        <maven.plugin.antrun.version>1.8</maven.plugin.antrun.version>
-        <maven.plugin.surefire.version>3.0.0-M4</maven.plugin.surefire.version>
+        <maven.plugin.download.version>1.6.0</maven.plugin.download.version>
+        <maven.plugin.antrun.version>3.0.0</maven.plugin.antrun.version>
+        <maven.plugin.surefire.version>3.0.0-M5</maven.plugin.surefire.version>
     </properties>
 
     <build>
                         <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=${basedir}/target/tmp
-                    </argLine>
+                    <argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=${basedir}/target/tmp -XX:-OmitStackTraceInFastThrow</argLine>
                     <excludes>
                         <exclude>**/All*Tests.java</exclude>
                         <exclude>**/TestUnfixedBugs.java</exclude>
             </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" excludes="XAdES*.xsd"/>
-                                        </copy>
-                                    </target>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>replace-xmltypeloader</id>
-                                <phase>process-sources</phase>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
-                                <configuration>
-                                    <target>
-                                        <!-- the space between "public  static" is on purpose to prevent double execution -->
-                                        <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>
-
-                                        <fileset id="xsrc" dir="${basedir}/target/generated-sources/xmlbeans" includes="**/*.java" excludes="**/impl/**"/>
-
-                                        <replaceregexp byline="true"
-                                                       match="(\s*)public static ([^ ]+) newInstance\(\) \{"
-                                                       replace="${loaderMethod}">
-                                            <fileset refid="xsrc"/>
-                                        </replaceregexp>
-
-                                        <replace>
-                                            <fileset refid="xsrc"/>
-                                            <replacetoken>org.apache.xmlbeans.XmlBeans.getContextTypeLoader
-                                            </replacetoken>
-                                            <replacevalue>getTypeLoader</replacevalue>
-                                        </replace>
-
-                                        <!-- remove deprecated warnings, as we prefer the array methods - see #56854 -->
-                                        <replace>
-                                            <fileset refid="xsrc"/>
-                                            <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>
index 446d9b1d0e882ca2f1b17d16361db6b61751e6b6..129a74fd96d8ab98137fd8cb9807239873934a34 100644 (file)
@@ -134,6 +134,8 @@ public final class TestBugs extends BaseTestBugzillaIssues {
             }
             SIMPLE_REFS.put(fileName, wb.getCreationHelper().createFormulaEvaluator());
         }
+
+        LocaleUtil.setUserLocale(Locale.US);
     }
 
     @AfterClass
index 1598c7a8f01e3275a4b69a94c70cb59b17820e88..edaa5da0429127f1ad45cb2898b0a73c254cd323 100644 (file)
 
 package org.apache.poi.ss.formula.functions;
 
+import static org.junit.Assert.assertEquals;
+
+import java.util.Locale;
+
 import org.apache.poi.ss.formula.eval.BlankEval;
 import org.apache.poi.ss.formula.eval.ErrorEval;
 import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.StringEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.util.LocaleUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
-import java.util.Locale;
-
-import static org.junit.Assert.assertEquals;
-
 /**
  * Tests for Excel function DATEVALUE()
  *
@@ -36,6 +38,16 @@ import static org.junit.Assert.assertEquals;
  */
 public final class TestDateValue {
 
+    @BeforeClass
+    public static void init() {
+        LocaleUtil.setUserLocale(Locale.US);
+    }
+
+    @AfterClass
+    public static void clear() {
+        LocaleUtil.setUserLocale(null);
+    }
+
     @Test
     public void testDateValue() {
         confirmDateValue(new StringEval("2020-02-01"), 43862);
@@ -56,18 +68,13 @@ public final class TestDateValue {
 
         confirmDateValueError(new StringEval("non-date text"));
 
-        LocaleUtil.setUserLocale(Locale.ENGLISH);
-        try {
-            // // EXCEL
-            confirmDateValue(new StringEval("8/22/2011"), 40777); // Serial number of a date entered as text.
-            confirmDateValue(new StringEval("22-MAY-2011"), 40685); // Serial number of a date entered as text.
-            confirmDateValue(new StringEval("2011/02/23"), 40597); // Serial number of a date entered as text.
-
-            // LibreOffice compatibility
-            confirmDateValue(new StringEval("1954-07-20"), 19925);
-        } finally {
-            LocaleUtil.setUserLocale(null);
-        }
+        // // EXCEL
+        confirmDateValue(new StringEval("8/22/2011"), 40777); // Serial number of a date entered as text.
+        confirmDateValue(new StringEval("22-MAY-2011"), 40685); // Serial number of a date entered as text.
+        confirmDateValue(new StringEval("2011/02/23"), 40597); // Serial number of a date entered as text.
+
+        // LibreOffice compatibility
+        confirmDateValue(new StringEval("1954-07-20"), 19925);
     }
 
     private ValueEval invokeDateValue(ValueEval text) {