]> source.dussan.org Git - poi.git/commitdiff
Move security schemas to security module
authorAndreas Beeker <kiwiwings@apache.org>
Thu, 20 Aug 2015 23:06:00 +0000 (23:06 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Thu, 20 Aug 2015 23:06:00 +0000 (23:06 +0000)
Fork xmlbeans plugin and run with more memory depending on 32/64bit runtime

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696874 13f79535-47bb-0310-9956-ffa450edef68

sonar/ooxml-schema-security/pom.xml
sonar/ooxml-schema/pom.xml

index 49cb86173277cf88af56caf03ca02c334ea0bd64..1ec9f02353cee4bea6dfa315929e0ae2abef074b 100644 (file)
        <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>
        </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>maven-download-plugin</artifactId>
+                               <version>1.1.0</version>
+                               <executions>
+                                       <execution>
+                                               <id>install-xsds-part-1</id>
+                                               <phase>generate-sources</phase>
+                                               <goals><goal>wget</goal></goals>
+                                               <configuration>
+                                                       <url>http://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>http://dublincore.org/schemas/xmls/qdc/2003/04/02/dc.xsd</url>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>install-xsds-part-3</id>
+                                               <phase>generate-sources</phase>
+                                               <goals><goal>wget</goal></goals>
+                                               <configuration>
+                                                       <outputDirectory>target/schemas</outputDirectory>
+                                                       <url>http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcterms.xsd</url>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>install-xsds-part-4</id>
+                                               <phase>generate-sources</phase>
+                                               <goals><goal>wget</goal></goals>
+                                               <configuration>
+                                                       <outputDirectory>target/schemas</outputDirectory>
+                                                       <url>http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcmitype.xsd</url>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>install-xsds-part-5</id>
+                                               <phase>generate-sources</phase>
+                                               <goals><goal>wget</goal></goals>
+                                               <configuration>
+                                                       <outputDirectory>target/schemas</outputDirectory>
+                                                       <url>http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd</url>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>install-xsds-part-6</id>
+                                               <phase>generate-sources</phase>
+                                               <goals><goal>wget</goal></goals>
+                                               <configuration>
+                                                       <outputDirectory>target/schemas</outputDirectory>
+                                                       <url>http://uri.etsi.org/01903/v1.3.2/XAdES.xsd</url>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>install-xsds-part-7</id>
+                                               <phase>generate-sources</phase>
+                                               <goals><goal>wget</goal></goals>
+                                               <configuration>
+                                                       <outputDirectory>target/schemas</outputDirectory>
+                                                       <url>http://uri.etsi.org/01903/v1.4.1/XAdESv141.xsd</url>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+
+                       <plugin>
+                               <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>
+                                               <configuration>
+                                                       <target>
+                                                               <echo message="unzip schemas" />
+                                                               <unzip src="target/OpenPackagingConventions-XMLSchema.zip" dest="target/schemas/" />
+                                                               <copy file="../../src/ooxml/resources/org/apache/poi/poifs/crypt/signatureInfo.xsd"
+                                                                       todir="target/schemas"/>
+                                                       </target>
+                                               </configuration>
+                                               <goals>
+                                                       <goal>run</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>xmlbeans-maven-plugin</artifactId>
                                        </execution>
                                </executions>
                                <configuration>
-                                       <schemaDirectory>../../src/ooxml/resources/org/apache/poi/poifs/crypt</schemaDirectory>
-                                       <sourceSchemas>
-                                               <sourceSchema>signatureInfo.xsd</sourceSchema>
-                                       </sourceSchemas>
+                                       <schemaDirectory>target/schemas</schemaDirectory>
                                        <noUpa>true</noUpa>
                                        <noPvr>true</noPvr>
+                                       <noJavac>true</noJavac>
                                        <javaSource>1.5</javaSource>
                                        <optimize>yes</optimize>
                                </configuration>
index 3200bce60f8d95718a2a34f940b7b0dd6d490db5..36183c643a4a679963e05b472ccc19349c9ef9ef 100644 (file)
        <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>
        </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>
                                                        <md5>abe6bb6e7799e854934b3c634e8bcf7b</md5>
                                                </configuration>
                                        </execution>
-                                       <execution>
-                                               <id>install-xsds-part-2</id>
-                                               <phase>generate-sources</phase>
-                                               <goals>
-                                                       <goal>wget</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <url>http://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>
                                </executions>
                        </plugin>
                        
                                                        <target>
                                                                <echo message="unzip schemas" />
                                                                <unzip src="target/OfficeOpenXML-XMLSchema.zip" dest="target/schemas/" />
-                                                               <unzip src="target/OpenPackagingConventions-XMLSchema.zip" dest="target/schemas/" />
-                                                               
-                                                               <property name="ooxml.xsds.dc.1" value="http://dublincore.org/schemas/xmls/qdc/2003/04/02/dc.xsd"/>
-                                                               <property name="ooxml.xsds.dc.2" value="http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcterms.xsd"/>
-                                                               <property name="ooxml.xsds.dc.3" value="http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcmitype.xsd"/>
-                                                               <property name="ooxml.xsds.dsig.1" value="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
-                                                               <property name="ooxml.xsds.dsig.2" value="http://uri.etsi.org/01903/v1.3.2/XAdES.xsd"/>
-                                                               <property name="ooxml.xsds.dsig.3" value="http://uri.etsi.org/01903/v1.4.1/XAdESv141.xsd"/>
-                                                       
-                                                               <get dest="target/schemas" skipexisting="true">
-                                                                       <url url="${ooxml.xsds.dc.1}"/>
-                                                                       <url url="${ooxml.xsds.dc.2}"/>
-                                                                       <url url="${ooxml.xsds.dc.3}"/>
-                                                                       <url url="${ooxml.xsds.dsig.1}"/>
-                                                                       <url url="${ooxml.xsds.dsig.2}"/>
-                                                                       <url url="${ooxml.xsds.dsig.3}"/>
-                                                               </get>
                                                        </target>
                                                </configuration>
                                                <goals>
                          </executions>
                                <configuration>
                                        <schemaDirectory>target/schemas</schemaDirectory>
-                                       <noUpa>true</noUpa>
-                                       <noPvr>true</noPvr>
                                        <javaSource>1.5</javaSource>
                                        <optimize>yes</optimize>
+                                       <noJavac>true</noJavac>
                                </configuration>
                        </plugin>
                </plugins>