aboutsummaryrefslogtreecommitdiffstats
path: root/sonar
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2015-11-21 19:37:26 +0000
committerAndreas Beeker <kiwiwings@apache.org>2015-11-21 19:37:26 +0000
commit01a6730ea7798a5e506053e48b97feae2fded60d (patch)
tree421e6a95c07f32e926b8d1adccaca58d59005b85 /sonar
parent74d58c8bde9a00b9b3695665c3b7b12fe2a262f1 (diff)
downloadpoi-01a6730ea7798a5e506053e48b97feae2fded60d.tar.gz
poi-01a6730ea7798a5e506053e48b97feae2fded60d.zip
#58617 - Add custom safe XmlBeans type loader / rename vendor specific schema packages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1715555 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sonar')
-rw-r--r--sonar/ooxml-schema-encryption/pom.xml30
-rw-r--r--sonar/ooxml-schema-security/pom.xml33
-rw-r--r--sonar/ooxml-schema/pom.xml96
-rw-r--r--sonar/pom.xml333
4 files changed, 255 insertions, 237 deletions
diff --git a/sonar/ooxml-schema-encryption/pom.xml b/sonar/ooxml-schema-encryption/pom.xml
index 3c2118f35d..dec7da0a41 100644
--- a/sonar/ooxml-schema-encryption/pom.xml
+++ b/sonar/ooxml-schema-encryption/pom.xml
@@ -7,11 +7,12 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.14-beta1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>poi-ooxml-schema-encryption</artifactId>
<packaging>jar</packaging>
- <name>Apach POI - Openxmlformats Encryption Schema package</name>
+ <name>Apache POI - Openxmlformats Encryption Schema package</name>
<properties>
<!-- see http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus for details of this property -->
@@ -21,28 +22,25 @@
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xmlbeans-maven-plugin</artifactId>
- <version>2.3.3</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
<executions>
<execution>
+ <id>unzip-schema</id>
<phase>generate-sources</phase>
<goals>
- <goal>xmlbeans</goal>
+ <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>
- <configuration>
- <schemaDirectory>../../src/ooxml/resources/org/apache/poi/poifs/crypt</schemaDirectory>
- <sourceSchemas>
- <sourceSchema>encryptionInfo.xsd</sourceSchema>
- </sourceSchemas>
- <xmlConfigs>
- <xmlConfig implementation="java.io.File">../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionInfo.xsdconfig</xmlConfig>
- </xmlConfigs>
- <javaSource>1.5</javaSource>
- <optimize>yes</optimize>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/sonar/ooxml-schema-security/pom.xml b/sonar/ooxml-schema-security/pom.xml
index c947a16411..4a9d0993bb 100644
--- a/sonar/ooxml-schema-security/pom.xml
+++ b/sonar/ooxml-schema-security/pom.xml
@@ -7,18 +7,20 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.14-beta1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>poi-ooxml-schema-security</artifactId>
<packaging>jar</packaging>
- <name>Apach POI - Openxmlformats Security-Schema package</name>
+ <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 -->
@@ -104,6 +106,9 @@
<execution>
<id>unzip-schema</id>
<phase>generate-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
<configuration>
<target>
<echo message="unzip schemas" />
@@ -112,34 +117,10 @@
todir="target/schemas"/>
</target>
</configuration>
- <goals>
- <goal>run</goal>
- </goals>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xmlbeans-maven-plugin</artifactId>
- <version>2.3.3</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>xmlbeans</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <schemaDirectory>target/schemas</schemaDirectory>
- <noUpa>true</noUpa>
- <noPvr>true</noPvr>
- <noJavac>true</noJavac>
- <javaSource>1.5</javaSource>
- <optimize>yes</optimize>
- </configuration>
- </plugin>
</plugins>
</build>
diff --git a/sonar/ooxml-schema/pom.xml b/sonar/ooxml-schema/pom.xml
index a40fb9a2ac..3d234e02cc 100644
--- a/sonar/ooxml-schema/pom.xml
+++ b/sonar/ooxml-schema/pom.xml
@@ -7,50 +7,20 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.14-beta1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>poi-ooxml-schema</artifactId>
<packaging>jar</packaging>
- <name>Apach POI - Openxmlformats Schema package</name>
+ <name>Apache POI - Openxmlformats 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.xsdconfig>${basedir}/../../src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig</xmlbeans.xsdconfig>
</properties>
- <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 -->
-
- <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>
- </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>
- </properties>
- </profile>
- </profiles>
-
<build>
<plugins>
<!-- Download and unpack the OfficeOpenXML Schema and use xmlbeans to create classes from the XSDs -->
@@ -60,7 +30,7 @@
<version>1.1.0</version>
<executions>
<execution>
- <id>install-xsds-part-4</id>
+ <id>download-xsds</id>
<phase>generate-sources</phase>
<goals>
<goal>wget</goal>
@@ -85,7 +55,9 @@
<configuration>
<target>
<echo message="unzip schemas" />
- <unzip src="target/OfficeOpenXML-XMLSchema.zip" dest="target/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>
<goals>
@@ -94,49 +66,6 @@
</execution>
</executions>
</plugin>
-
- <!-- include the visio schema -->
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>target/schemas/</outputDirectory>
- <resources>
- <resource>
- <directory>../../src/ooxml/resources/org/apache/poi/xdgf/</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xmlbeans-maven-plugin</artifactId>
- <version>2.3.3</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>xmlbeans</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <schemaDirectory>target/schemas</schemaDirectory>
- <javaSource>1.5</javaSource>
- <optimize>yes</optimize>
- <noJavac>true</noJavac>
- </configuration>
- </plugin>
</plugins>
</build>
@@ -151,11 +80,10 @@
<artifactId>poi-scratchpad</artifactId>
<version>${project.version}</version>
</dependency>
-
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <version>2.6.0</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.xmlbeans</groupId>
+ <artifactId>xmlbeans</artifactId>
+ <version>2.6.0</version>
+ </dependency>
</dependencies>
</project>
diff --git a/sonar/pom.xml b/sonar/pom.xml
index f17c0655af..fe10ac3b01 100644
--- a/sonar/pom.xml
+++ b/sonar/pom.xml
@@ -1,58 +1,52 @@
-<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>3.14-beta1-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>
+<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>3.14-beta1-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://issues.apache.org/bugzilla/</url>
</issueManagement>
-
- <scm>
+
+ <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>
-
- <modules>
+ </scm>
+
+ <modules>
<module>main</module>
<module>ooxml-schema</module>
<module>ooxml-schema-encryption</module>
@@ -60,76 +54,193 @@
<module>ooxml</module>
<module>scratchpad</module>
<module>excelant</module>
- <module>examples</module>
- </modules>
-
+ <module>examples</module>
+ </modules>
+
<properties>
<project.build.sourceEncoding>ASCII</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>
</properties>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>surefire-junit47</artifactId>
- <version>2.16</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>-Duser.language=en -Duser.country=US -Xmx1024m</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>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-junit47</artifactId>
+ <version>2.16</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>-Duser.language=en -Duser.country=US -Xmx1024m</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>
- </plugins>
- </build>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</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 -->
+ <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>
+ </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>
+ </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>
- <dependencies>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>copy-xmltype-and-xsdconfig</id>
+ <phase>generate-sources</phase>
+ <goals><goal>run</goal></goals>
+ <configuration>
+ <target>
+ <copy todir="${basedir}/target/generated-sources/xmlbeans">
+ <fileset dir="${basedir}/../../src/ooxml/java" includes="org/apache/poi/POIXMLTypeLoader.java"/>
+ </copy>
+ <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>
+ <replace dir="${basedir}/target/generated-sources/xmlbeans" includes="**/*.java" excludes="**/impl/**">
+ <replacetoken>org.apache.xmlbeans.XmlBeans.getContextTypeLoader()</replacetoken>
+ <replacevalue>org.apache.poi.POIXMLTypeLoader</replacevalue>
+ </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>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
+ <groupId>org.apache.xmlbeans</groupId>
+ <artifactId>xmlbeans</artifactId>
+ <version>2.6.0</version>
</dependency>
- </dependencies>
+ </dependencies>
+ </profile>
+ </profiles>
</project>