git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884381 13f79535-47bb-0310-9956-ffa450edef68tags/before_junit5_update
<classpathentry kind="lib" path="lib/ant-1.10.1.jar"/> | <classpathentry kind="lib" path="lib/ant-1.10.1.jar"/> | ||||
<classpathentry kind="lib" path="lib/ant-launcher-1.10.1.jar"/> | <classpathentry kind="lib" path="lib/ant-launcher-1.10.1.jar"/> | ||||
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/> | <classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/> | ||||
<classpathentry exported="true" kind="lib" path="lib/ooxml/xmlbeans-4.0.0.jar" sourcepath="lib/ooxml/xmlbeans-3.1.0.jar"/> | |||||
<classpathentry exported="true" kind="lib" path="lib/ooxml/xmlbeans-4.0.0.jar" sourcepath="lib/ooxml/xmlbeans-4.0.0-sources.jar"/> | |||||
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/> | <classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/> | ||||
<classpathentry kind="lib" path="lib/junit-4.13.1.jar"/> | <classpathentry kind="lib" path="lib/junit-4.13.1.jar"/> | ||||
<classpathentry kind="lib" path="lib/ooxml/curvesapi-1.06.jar"/> | <classpathentry kind="lib" path="lib/ooxml/curvesapi-1.06.jar"/> | ||||
<classpathentry exported="true" kind="lib" path="lib/ooxml/ooxml-schemas-1.4.jar" sourcepath="lib/ooxml/ooxml-schemas-1.4-sources.jar"/> | |||||
<classpathentry exported="true" kind="lib" path="lib/ooxml/ooxml-security-1.1.jar" sourcepath="lib/ooxml/ooxml-security-1.1-sources.jar"/> | |||||
<classpathentry exported="true" kind="lib" path="build/dist/maven/poi-ooxml-full/poi-ooxml-full-5.0.0-SNAPSHOT.jar" sourcepath="build/xmlbean-sources"/> | |||||
<classpathentry kind="lib" path="lib/main-tests/jmh-core-1.26.jar"/> | <classpathentry kind="lib" path="lib/main-tests/jmh-core-1.26.jar"/> | ||||
<classpathentry kind="lib" path="lib/main-tests/jmh-generator-annprocess-1.26.jar"/> | <classpathentry kind="lib" path="lib/main-tests/jmh-generator-annprocess-1.26.jar"/> | ||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> |
sonar/main/src/ | sonar/main/src/ | ||||
sonar/ooxml/src/ | sonar/ooxml/src/ | ||||
sonar/scratchpad/src/ | sonar/scratchpad/src/ | ||||
sonar/ooxml-schema-security/src/ | |||||
sonar/ooxml-full/src/ | |||||
sonar/examples/src/ | sonar/examples/src/ | ||||
sonar/excelant/src/ | sonar/excelant/src/ | ||||
sonar/target | sonar/target |
Building jar files | Building jar files | ||||
------------------ | ------------------ | ||||
To build the jar files for poi, poi-ooxml, poi-ooxml-schemas, and poi-examples:: | |||||
To build the jar files for poi, poi-ooxml, poi-ooxml-lite, poi-ooxml-full and poi-examples:: | |||||
ant jar | ant jar | ||||
compile project(':main') | compile project(':main') | ||||
compile project(':scratchpad') // TODO: get rid of this dependency! | compile project(':scratchpad') // TODO: get rid of this dependency! | ||||
compile files('../../build/dist/maven/ooxml-schemas/ooxml-schemas-1.5.jar') | |||||
compile files('../../build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version}.jar') | |||||
testCompile "junit:junit:${junitVersion}" | testCompile "junit:junit:${junitVersion}" | ||||
testCompile "org.mockito:mockito-core:${mockitoVersion}" | testCompile "org.mockito:mockito-core:${mockitoVersion}" | ||||
compile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" | compile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" | ||||
compile files('../../build/dist/maven/ooxml-schemas/ooxml-schemas-1.5.jar') | |||||
compile files('../../build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version}.jar') | |||||
compile "org.apache.commons:commons-compress:${commonsCompressVersion}" | compile "org.apache.commons:commons-compress:${commonsCompressVersion}" | ||||
} | } | ||||
testCompile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" | testCompile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" | ||||
testCompile files('../../build/dist/maven/ooxml-schemas/ooxml-schemas-1.5.jar') | |||||
testCompile files('../../build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version}.jar') | |||||
testCompile files(this.project(':ooxml').sourceSets.test.runtimeClasspath) | testCompile files(this.project(':ooxml').sourceSets.test.runtimeClasspath) | ||||
} | } | ||||
<property name="ooxml.lite.agent" location="lib/ooxml-tests/ooxml-lite-agent.jar"/> | <property name="ooxml.lite.agent" location="lib/ooxml-tests/ooxml-lite-agent.jar"/> | ||||
<property name="ooxml.lite.report" location="build/ooxml-lite-report.txt"/> | <property name="ooxml.lite.report" location="build/ooxml-lite-report.txt"/> | ||||
<property name="ooxml.lite.jar" location="build/dist/maven/poi-ooxml-schemas/poi-ooxml-schemas-${version.id}.jar"/> | |||||
<property name="ooxml.lite.jar" location="build/dist/maven/poi-ooxml-lite/poi-ooxml-lite-${version.id}.jar"/> | |||||
<property name="ooxml.lite.includes" value="^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"/> | <property name="ooxml.lite.includes" value="^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"/> | ||||
<!-- "Copy these file(s), free of charge" --> | <!-- "Copy these file(s), free of charge" --> | ||||
<property name="ooxml.xsds.izip.1" value="${basedir}/src/ooxml/resources/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip"/> | <property name="ooxml.xsds.izip.1" value="${basedir}/src/ooxml/resources/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip"/> | ||||
<property name="ooxml.xsds.src.dir" location="build/ooxml-xsds-src"/> | <property name="ooxml.xsds.src.dir" location="build/ooxml-xsds-src"/> | ||||
<property name="ooxml.xsds.src.jar" location="build/dist/maven/ooxml-schemas/ooxml-schemas-${maven.ooxml.xsds.version.id}-sources.jar"/> | |||||
<property name="ooxml.xsds.jar" location="build/dist/maven/ooxml-schemas/ooxml-schemas-${maven.ooxml.xsds.version.id}.jar"/> | |||||
<property name="ooxml.xsds.src.jar" location="build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version.id}-sources.jar"/> | |||||
<property name="ooxml.xsds.jar" location="build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version.id}.jar"/> | |||||
<!-- additional schemas are packed into the poi schemas jar, --> | <!-- additional schemas are packed into the poi schemas jar, --> | ||||
<!-- so we don't have to care about a separate versioning of the original ooxml schemas --> | <!-- so we don't have to care about a separate versioning of the original ooxml schemas --> | ||||
</path> | </path> | ||||
<path id="ooxml.lite.verify.classpath"> | <path id="ooxml.lite.verify.classpath"> | ||||
<pathelement location="build/dist/maven/poi-ooxml-schemas/poi-ooxml-schemas-${version.id}.jar"/> | |||||
<pathelement location="build/dist/maven/poi-ooxml-lite/poi-ooxml-lite-${version.id}.jar"/> | |||||
<path refid="ooxml.base.classpath"/> | <path refid="ooxml.base.classpath"/> | ||||
</path> | </path> | ||||
</javac> | </javac> | ||||
<javac release="9" | <javac release="9" | ||||
srcdir="${basedir}/src/multimodule/ooxml-schemas/java9" | |||||
destdir="${basedir}/src/multimodule/ooxml-schemas/java9" | |||||
srcdir="${basedir}/src/multimodule/ooxml-full/java9" | |||||
destdir="${basedir}/src/multimodule/ooxml-full/java9" | |||||
includeantruntime="false" | includeantruntime="false" | ||||
fork="true" | fork="true" | ||||
modulepath="lib/ooxml" | modulepath="lib/ooxml" | ||||
<compilerarg line="--patch-module org.apache.poi.ooxml.schemas=${xmlbean.classes.dir}"/> | <compilerarg line="--patch-module org.apache.poi.ooxml.schemas=${xmlbean.classes.dir}"/> | ||||
</javac> | </javac> | ||||
<mkdir dir="build/dist/maven/ooxml-schemas"/> | |||||
<mkdir dir="build/dist/maven/poi-ooxml-full"/> | |||||
<jar destfile="${ooxml.xsds.jar}"> | <jar destfile="${ooxml.xsds.jar}"> | ||||
<fileset dir="${xmlbean.classes.dir}"/> | <fileset dir="${xmlbean.classes.dir}"/> | ||||
<zipfileset dir="${basedir}/src/multimodule/ooxml-schemas/java9" prefix="META-INF/versions/9" excludes="*.java"/> | |||||
<zipfileset dir="${basedir}/src/multimodule/ooxml-full/java9" prefix="META-INF/versions/9" excludes="*.java"/> | |||||
<metainf dir="legal/"/> | <metainf dir="legal/"/> | ||||
<manifest> | <manifest> | ||||
<attribute name="Multi-Release" value="true"/> | <attribute name="Multi-Release" value="true"/> | ||||
<jar destfile="${ooxml.xsds.src.jar}"> | <jar destfile="${ooxml.xsds.src.jar}"> | ||||
<fileset dir="${xmlbean.sources.dir}"/> | <fileset dir="${xmlbean.sources.dir}"/> | ||||
<zipfileset dir="${basedir}/src/multimodule/ooxml-schemas/java9" prefix="META-INF/versions/9/" excludes="*.class"/> | |||||
<zipfileset dir="${basedir}/src/multimodule/ooxml-full/java9" prefix="META-INF/versions/9/" excludes="*.class"/> | |||||
<metainf dir="legal"/> | <metainf dir="legal"/> | ||||
</jar> | </jar> | ||||
</target> | </target> | ||||
<compile-jar module="examples" | <compile-jar module="examples" | ||||
java="${examples.src}" classes="${examples.output.dir}"> | java="${examples.src}" classes="${examples.output.dir}"> | ||||
<lib> | <lib> | ||||
<pathelement path="build/dist/maven/ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-full"/> | |||||
<pathelement path="build/dist/maven/poi-tests"/> | <pathelement path="build/dist/maven/poi-tests"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad-tests"/> | <pathelement path="build/dist/maven/poi-scratchpad-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-tests"/> | <pathelement path="build/dist/maven/poi-ooxml-tests"/> | ||||
<lib> | <lib> | ||||
<pathelement path="build/dist/maven/poi-tests"/> | <pathelement path="build/dist/maven/poi-tests"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad-tests"/> | <pathelement path="build/dist/maven/poi-scratchpad-tests"/> | ||||
<pathelement path="build/dist/maven/ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-full"/> | |||||
<pathelement path="lib/main"/> | <pathelement path="lib/main"/> | ||||
<pathelement path="lib/main-tests"/> | <pathelement path="lib/main-tests"/> | ||||
<pathelement path="lib/ooxml"/> | <pathelement path="lib/ooxml"/> | ||||
</macrodef> | </macrodef> | ||||
<target name="retest-ooxml" depends="jar" | <target name="retest-ooxml" depends="jar" | ||||
description="run ooxml tests with poi-ooxml-schemas (= lite schema)"> | |||||
description="run ooxml tests with poi-ooxml-lite"> | |||||
<path id="restest.modules"> | <path id="restest.modules"> | ||||
<pathelement path="build/dist/maven/poi-tests"/> | <pathelement path="build/dist/maven/poi-tests"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad-tests"/> | <pathelement path="build/dist/maven/poi-scratchpad-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-tests"/> | <pathelement path="build/dist/maven/poi-ooxml-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-lite"/> | |||||
<pathelement path="lib/main"/> | <pathelement path="lib/main"/> | ||||
<pathelement path="lib/main-tests"/> | <pathelement path="lib/main-tests"/> | ||||
<pathelement path="lib/ooxml"/> | <pathelement path="lib/ooxml"/> | ||||
unless:true="${isJava8}"> | unless:true="${isJava8}"> | ||||
<compilerarg line="--patch-module org.apache.poi.stress=${integration.output.test.dir}"/> | <compilerarg line="--patch-module org.apache.poi.stress=${integration.output.test.dir}"/> | ||||
<modulepath> | <modulepath> | ||||
<pathelement path="build/dist/maven/ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-full"/> | |||||
<pathelement path="build/dist/maven/poi"/> | <pathelement path="build/dist/maven/poi"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml"/> | <pathelement path="build/dist/maven/poi-ooxml"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad"/> | <pathelement path="build/dist/maven/poi-scratchpad"/> | ||||
description="test OOXML classes"> | description="test OOXML classes"> | ||||
<path id="test-ooxml.modules"> | <path id="test-ooxml.modules"> | ||||
<!-- full schema --> | <!-- full schema --> | ||||
<pathelement path="build/dist/maven/ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-full"/> | |||||
<pathelement path="build/dist/maven/poi-tests"/> | <pathelement path="build/dist/maven/poi-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-tests"/> | <pathelement path="build/dist/maven/poi-ooxml-tests"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad-tests"/> | <pathelement path="build/dist/maven/poi-scratchpad-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml"/> | <pathelement path="build/dist/maven/poi-ooxml"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad"/> | <pathelement path="build/dist/maven/poi-scratchpad"/> | ||||
<pathelement path="build/dist/maven/poi-examples"/> | <pathelement path="build/dist/maven/poi-examples"/> | ||||
<pathelement path="build/dist/maven/ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-full"/> | |||||
<pathelement path="build/dist/maven/poi-integration"/> | <pathelement path="build/dist/maven/poi-integration"/> | ||||
<pathelement path="lib/main"/> | <pathelement path="lib/main"/> | ||||
<pathelement path="lib/main-tests"/> | <pathelement path="lib/main-tests"/> | ||||
<local name="full.schema"/> | <local name="full.schema"/> | ||||
<loadresource property="full.schema"> | <loadresource property="full.schema"> | ||||
<file file="${basedir}/src/multimodule/ooxml-schemas/java9/module-info.java"/> | |||||
<file file="${basedir}/src/multimodule/ooxml-full/java9/module-info.java"/> | |||||
<filterchain> | <filterchain> | ||||
<linecontains negate="true" matchany="true"> | <linecontains negate="true" matchany="true"> | ||||
<contains value="exports"/> | <contains value="exports"/> | ||||
org/apache/poi/schemas/ooxml/system/ooxml/rectaf36doctype.xsb | org/apache/poi/schemas/ooxml/system/ooxml/rectaf36doctype.xsb | ||||
</echo> | </echo> | ||||
<mkdir dir="build/dist/maven/poi-ooxml-schemas"/> | |||||
<mkdir dir="build/dist/maven/poi-ooxml-lite"/> | |||||
<jar destfile="${ooxml.lite.jar}" duplicate="preserve"> | <jar destfile="${ooxml.lite.jar}" duplicate="preserve"> | ||||
<zipfileset dir="${basedir}/src/multimodule/ooxml-lite/java9" prefix="META-INF/versions/9" excludes="*.java"/> | <zipfileset dir="${basedir}/src/multimodule/ooxml-lite/java9" prefix="META-INF/versions/9" excludes="*.java"/> | ||||
<include name="org/apache/poi/schemas/ooxml/element/**/*.xsb"/> | <include name="org/apache/poi/schemas/ooxml/element/**/*.xsb"/> | ||||
</patternset> | </patternset> | ||||
</zipfileset> | </zipfileset> | ||||
<zipfileset dir="src/multimodule/ooxml-schemas/java9" prefix="META-INF/versions/9" excludes="*.java"/> | |||||
<zipfileset dir="src/multimodule/ooxml-full/java9" prefix="META-INF/versions/9" excludes="*.java"/> | |||||
<manifest> | <manifest> | ||||
<attribute name="Multi-Release" value="true"/> | <attribute name="Multi-Release" value="true"/> | ||||
<attribute name="Automatic-Module-Name" value="org.apache.poi.ooxml.schemas"/> | <attribute name="Automatic-Module-Name" value="org.apache.poi.ooxml.schemas"/> | ||||
<target name="test-ooxml-lite" depends="jacocotask,compile-ooxml-lite"> | <target name="test-ooxml-lite" depends="jacocotask,compile-ooxml-lite"> | ||||
<delete file="${ooxml.testokfile}"/> | <delete file="${ooxml.testokfile}"/> | ||||
<echo message="Running ooxml tests against 'poi-ooxml-schemas'"/> | |||||
<echo message="Running ooxml tests against 'poi-ooxml-lite'"/> | |||||
<path id="test-ooxml-lite.modules"> | <path id="test-ooxml-lite.modules"> | ||||
<!-- lite schema --> | <!-- lite schema --> | ||||
<pathelement path="build/dist/maven/poi-ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-lite"/> | |||||
<pathelement path="build/dist/maven/poi-tests"/> | <pathelement path="build/dist/maven/poi-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-tests"/> | <pathelement path="build/dist/maven/poi-ooxml-tests"/> | ||||
<pathelement path="build/dist/maven/poi-scratchpad-tests"/> | <pathelement path="build/dist/maven/poi-scratchpad-tests"/> | ||||
<pathelement path="lib/excelant"/> | <pathelement path="lib/excelant"/> | ||||
<pathelement path="build/dist/maven/poi-tests"/> | <pathelement path="build/dist/maven/poi-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-tests"/> | <pathelement path="build/dist/maven/poi-ooxml-tests"/> | ||||
<pathelement path="build/dist/maven/poi-ooxml-schemas"/> | |||||
<pathelement path="build/dist/maven/poi-ooxml-lite"/> | |||||
<pathelement path="build/dist/maven/poi-scratchpad-tests"/> | <pathelement path="build/dist/maven/poi-scratchpad-tests"/> | ||||
<pathelement path="build/dist/maven/poi-excelant-tests"/> | <pathelement path="build/dist/maven/poi-excelant-tests"/> | ||||
</path> | </path> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
<mkdir dir="${dist.dir}/maven/ooxml-schemas"/> | |||||
<copy tofile="${dist.dir}/maven/ooxml-schemas/ooxml-schemas-${maven.ooxml.xsds.version.id}.pom" file="maven/ooxml-schemas.pom"> | |||||
<mkdir dir="${dist.dir}/maven/poi-ooxml-full"/> | |||||
<copy tofile="${dist.dir}/maven/poi-ooxml-full/poi-ooxml-full-${version.id}.pom" file="maven/poi-ooxml-full.pom"> | |||||
<filterchain> | <filterchain> | ||||
<replacetokens> | <replacetokens> | ||||
<token key="VERSION" value="${maven.ooxml.xsds.version.id}"/> | |||||
<token key="VERSION" value="${version.id}"/> | |||||
</replacetokens> | </replacetokens> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
<chainedmapper> | <chainedmapper> | ||||
<filtermapper> | <filtermapper> | ||||
<replaceregex pattern=".jar" replace="" flags="g"/> | <replaceregex pattern=".jar" replace="" flags="g"/> | ||||
<replaceregex pattern="ooxml-lite" replace="ooxml-schemas" flags="g"/> | |||||
<!-- <replaceregex pattern="ooxml-lite" replace="ooxml-schemas" flags="g"/>--> | |||||
<replaceregex pattern="(.java|.src)$$" replace="-sources"/> | <replaceregex pattern="(.java|.src)$$" replace="-sources"/> | ||||
<replaceregex pattern=".*(?:build|src).?(.*)?" replace="\1"/> | <replaceregex pattern=".*(?:build|src).?(.*)?" replace="\1"/> | ||||
<replaceregex pattern="(.*)(-classes|-sources)" replace="poi-\1/poi-\1-${version.id}\2"/> | <replaceregex pattern="(.*)(-classes|-sources)" replace="poi-\1/poi-\1-${version.id}\2"/> | ||||
<m2-install artifactId="poi-scratchpad"/> | <m2-install artifactId="poi-scratchpad"/> | ||||
<m2-install artifactId="poi-ooxml"/> | <m2-install artifactId="poi-ooxml"/> | ||||
<m2-install artifactId="poi-examples"/> | <m2-install artifactId="poi-examples"/> | ||||
<m2-install artifactId="poi-ooxml-schemas"/> | |||||
<m2-install artifactId="poi-excelant"/> | |||||
<m2-install artifactId="poi-ooxml-lite"/> | |||||
<m2-install artifactId="poi-ooxml-full"/> | |||||
<m2-install artifactId="poi-excelant"/> | <m2-install artifactId="poi-excelant"/> | ||||
<m2-install artifactId="ooxml-schemas" versionId="${maven.ooxml.xsds.version.id}"/> | |||||
</target> | </target> | ||||
<target name="rat-check" depends="init" description="Runs the Apache Creadur Rat check against the source code, to spot any files which are missing the correct license headers"> | <target name="rat-check" depends="init" description="Runs the Apache Creadur Rat check against the source code, to spot any files which are missing the correct license headers"> | ||||
<nexus-upload artifactId="poi-examples"/> | <nexus-upload artifactId="poi-examples"/> | ||||
<nexus-upload artifactId="poi-excelant"/> | <nexus-upload artifactId="poi-excelant"/> | ||||
<nexus-upload artifactId="poi-ooxml"/> | <nexus-upload artifactId="poi-ooxml"/> | ||||
<nexus-upload artifactId="poi-ooxml-schemas"/> | |||||
<nexus-upload artifactId="poi-ooxml-lite"/> | |||||
<nexus-upload artifactId="poi-ooxml-full"/> | |||||
<nexus-upload artifactId="poi-scratchpad"/> | <nexus-upload artifactId="poi-scratchpad"/> | ||||
</target> | </target> | ||||
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE) | localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE) | ||||
mavenInstallation(defaultMaven) | mavenInstallation(defaultMaven) | ||||
} | } | ||||
/* Currently not done, let's see if it is still necessary: | |||||
# Maven-Download fails for strange reasons, try to workaround... | |||||
mkdir -p sonar/ooxml-schema-security/target/schemas && wget -O sonar/ooxml-schema-security/target/schemas/xmldsig-core-schema.xsd http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd | |||||
*/ | |||||
maven { | maven { | ||||
if (poijob.sonar) { | if (poijob.sonar) { | ||||
goals('clean package sonar:sonar') | goals('clean package sonar:sonar') |
and conditions of the following licenses: | and conditions of the following licenses: | ||||
Office Open XML schemas (ooxml-schemas-1.*.jar) | |||||
Office Open XML schemas (poi-ooxml-full-*.jar) | |||||
The Office Open XML schema definitions used by Apache POI are | The Office Open XML schema definitions used by Apache POI are | ||||
a part of the Office Open XML ECMA Specification (ECMA-376, [1]). | a part of the Office Open XML ECMA Specification (ECMA-376, [1]). | ||||
b) in the case of each subsequent Contributor: | b) in the case of each subsequent Contributor: | ||||
i) changes to the Program, and | i) changes to the Program, and | ||||
ii) additions to the Program; | ii) additions to the Program; | ||||
where such changes and/or additions to the Program originate from and are | |||||
where such changes and/or additions to the Program originate from and are | |||||
distributed by that particular Contributor. A Contribution 'originates' from | distributed by that particular Contributor. A Contribution 'originates' from | ||||
a Contributor if it was added to the Program by such Contributor itself or | a Contributor if it was added to the Program by such Contributor itself or | ||||
anyone acting on such Contributor's behalf. Contributions do not include | anyone acting on such Contributor's behalf. Contributions do not include | ||||
SLF4J library (slf4j-api-*.jar) | SLF4J library (slf4j-api-*.jar) | ||||
Copyright (c) 2004-2013 QOS.ch | Copyright (c) 2004-2013 QOS.ch | ||||
All rights reserved. | |||||
All rights reserved. | |||||
Permission is hereby granted, free of charge, to any person obtaining | Permission is hereby granted, free of charge, to any person obtaining | ||||
a copy of this software and associated documentation files (the | a copy of this software and associated documentation files (the | ||||
inbot-utils (https://github.com/Inbot/inbot-utils) | inbot-utils (https://github.com/Inbot/inbot-utils) | ||||
The MIT License (MIT) | The MIT License (MIT) | ||||
Copyright (c) 2015 Inbot | Copyright (c) 2015 Inbot | ||||
Permission is hereby granted, free of charge, to any person obtaining a copy | Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
of this software and associated documentation files (the "Software"), to deal | of this software and associated documentation files (the "Software"), to deal | ||||
in the Software without restriction, including without limitation the rights | in the Software without restriction, including without limitation the rights | ||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
copies of the Software, and to permit persons to whom the Software is | copies of the Software, and to permit persons to whom the Software is | ||||
furnished to do so, subject to the following conditions: | furnished to do so, subject to the following conditions: | ||||
The above copyright notice and this permission notice shall be included in all | The above copyright notice and this permission notice shall be included in all | ||||
copies or substantial portions of the Software. | copies or substantial portions of the Software. | ||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
#! /bin/sh | |||||
# | |||||
# Licensed to the Apache Software Foundation (ASF) under one or more | |||||
# contributor license agreements. See the NOTICE file distributed with | |||||
# this work for additional information regarding copyright ownership. | |||||
# The ASF licenses this file to You under the Apache License, Version 2.0 | |||||
# (the "License"); you may not use this file except in compliance with | |||||
# the License. You may obtain a copy of the License at | |||||
# | |||||
# http://www.apache.org/licenses/LICENSE-2.0 | |||||
# | |||||
# Unless required by applicable law or agreed to in writing, software | |||||
# distributed under the License is distributed on an "AS IS" BASIS, | |||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
# See the License for the specific language governing permissions and | |||||
# limitations under the License. | |||||
# | |||||
# create md5 checksums and gpg signatures | |||||
echo "If you use gpg2 you need to set GPG_BIN accordingly" | |||||
GPG_BIN=gpg | |||||
stty -echo | |||||
echo "enter your GPG passphrase" | |||||
read passphrase | |||||
stty echo | |||||
# Do we have md5sum and sha1sum? | |||||
# (We can use openssl if not, but the files it produces aren't as nice) | |||||
which md5sum > /dev/null | |||||
LACKING_MD5SUM=$? | |||||
which sha1sum > /dev/null | |||||
LACKING_SHA1SUM=$? | |||||
for i in *; do | |||||
echo "" | |||||
echo Signing $i | |||||
echo $passphrase | $GPG_BIN --passphrase-fd 0 --output $i.asc --detach-sig --armor $i | |||||
$GPG_BIN --verify $i.asc $i | |||||
echo Hashing $i | |||||
if [ "$LACKING_MD5SUM" = "1" ]; then | |||||
openssl md5 < $i > $i.md5 | |||||
else | |||||
md5sum $i > $i.md5 | |||||
fi | |||||
if [ "$LACKING_SHA1SUM" = "1" ]; then | |||||
openssl sha1 < $i > $i.sha1 | |||||
else | |||||
sha1sum $i > $i.sha1 | |||||
fi | |||||
done |
#! /bin/sh | |||||
# | |||||
# Licensed to the Apache Software Foundation (ASF) under one or more | |||||
# contributor license agreements. See the NOTICE file distributed with | |||||
# this work for additional information regarding copyright ownership. | |||||
# The ASF licenses this file to You under the Apache License, Version 2.0 | |||||
# (the "License"); you may not use this file except in compliance with | |||||
# the License. You may obtain a copy of the License at | |||||
# | |||||
# http://www.apache.org/licenses/LICENSE-2.0 | |||||
# | |||||
# Unless required by applicable law or agreed to in writing, software | |||||
# distributed under the License is distributed on an "AS IS" BASIS, | |||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
# See the License for the specific language governing permissions and | |||||
# limitations under the License. | |||||
# | |||||
# Shell script to deploy POI artifacts in a maven repository. | |||||
# | |||||
# Note, You should configure your settings.xml and add a server with id=apache-releases: | |||||
# | |||||
# <server> | |||||
# <id>apache-releases</id> | |||||
# <username>apacheId</username> | |||||
# <password>mySecurePassw0rd</password> | |||||
# </server> | |||||
# | |||||
# <profiles> | |||||
# <profile> | |||||
# <id>apache-releases</id> | |||||
# <properties> | |||||
# <gpg.passphrase><!-- Your GPG passphrase --></gpg.passphrase> | |||||
# </properties> | |||||
# </profile> | |||||
# </profiles> | |||||
# | |||||
# Usage: | |||||
# 1. ant dist | |||||
# 2. cd build/dist | |||||
# 3. ./mvn-deploy.sh | |||||
M2_REPOSITORY=https://repository.apache.org/service/local/staging/deploy/maven2 | |||||
VERSION=@VERSION@ | |||||
DSTAMP=@DSTAMP@ | |||||
for artifactId in poi poi-scratchpad poi-ooxml poi-examples poi-ooxml-schemas poi-excelant | |||||
do | |||||
SENDS="-Dfile=$artifactId-$VERSION-$DSTAMP.jar" | |||||
SENDS="$SENDS -DpomFile=$artifactId-$VERSION.pom" | |||||
if [ -r $artifactId-$VERSION-sources-$DSTAMP.jar ]; then | |||||
SENDS="$SENDS -Dsources=$artifactId-$VERSION-sources-$DSTAMP.jar" | |||||
fi | |||||
if [ -r $artifactId-$VERSION-javadocs-$DSTAMP.jar ]; then | |||||
SENDS="$SENDS -Djavadoc=$artifactId-$VERSION-javadocs-$DSTAMP.jar" | |||||
fi | |||||
mvn gpg:sign-and-deploy-file \ | |||||
-DrepositoryId=apache-releases -P apache-releases \ | |||||
-Durl=$M2_REPOSITORY \ | |||||
$SENDS | |||||
done |
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
<groupId>org.apache.poi</groupId> | <groupId>org.apache.poi</groupId> | ||||
<artifactId>ooxml-schemas</artifactId> | |||||
<artifactId>poi-ooxml-full</artifactId> | |||||
<version>@VERSION@</version> | <version>@VERSION@</version> | ||||
<packaging>jar</packaging> | <packaging>jar</packaging> | ||||
<name>OOXML schemas</name> | |||||
<description>XmlBeans generated from the Ecma supplied xsds: | |||||
http://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%20Part%204%20(DOCX).zip</description> | |||||
<name>Apache POI - OOXML schemas (full)</name> | |||||
<description>XmlBeans generated from the Ecma supplied xsds (since POI 5.0.0, the 3rd edition is used): | |||||
https://www.ecma-international.org/publications/standards/Ecma-376.htm</description> | |||||
<url>https://poi.apache.org/</url> | <url>https://poi.apache.org/</url> | ||||
<mailingLists> | <mailingLists> |
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
<groupId>org.apache.poi</groupId> | <groupId>org.apache.poi</groupId> | ||||
<artifactId>poi-ooxml-schemas</artifactId> | |||||
<artifactId>poi-ooxml-lite</artifactId> | |||||
<version>@VERSION@</version> | <version>@VERSION@</version> | ||||
<packaging>jar</packaging> | <packaging>jar</packaging> | ||||
<name>Apache POI</name> | |||||
<name>Apache POI - OOXML Schemas (lite)</name> | |||||
<url>https://poi.apache.org/</url> | <url>https://poi.apache.org/</url> | ||||
<description>Apache POI - Java API To Access Microsoft Format Files</description> | <description>Apache POI - Java API To Access Microsoft Format Files</description> | ||||
<artifactId>poi-ooxml</artifactId> | <artifactId>poi-ooxml</artifactId> | ||||
<version>@VERSION@</version> | <version>@VERSION@</version> | ||||
<packaging>jar</packaging> | <packaging>jar</packaging> | ||||
<name>Apache POI</name> | |||||
<name>Apache POI - API based on OPC and OOXML schemas</name> | |||||
<url>https://poi.apache.org/</url> | <url>https://poi.apache.org/</url> | ||||
<description>Apache POI - Java API To Access Microsoft Format Files</description> | <description>Apache POI - Java API To Access Microsoft Format Files</description> | ||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> | ||||
<groupId>org.apache.poi</groupId> | <groupId>org.apache.poi</groupId> | ||||
<artifactId>poi-ooxml-schemas</artifactId> | |||||
<artifactId>poi-ooxml-lite</artifactId> | |||||
<version>@VERSION@</version> | <version>@VERSION@</version> | ||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> |
poi;inline=true, | poi;inline=true, | ||||
poi-scratchpad;inline=true, | poi-scratchpad;inline=true, | ||||
poi-ooxml;inline=true, | poi-ooxml;inline=true, | ||||
poi-ooxml-schemas;inline=true, | |||||
poi-ooxml-lite;inline=true, | |||||
xmlbeans;inline=true, | xmlbeans;inline=true, | ||||
SparseBitSet, | SparseBitSet, | ||||
curvesapi, | curvesapi, | ||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> | ||||
<groupId>org.apache.poi</groupId> | <groupId>org.apache.poi</groupId> | ||||
<artifactId>poi-ooxml-schemas</artifactId> | |||||
<artifactId>poi-ooxml-lite</artifactId> | |||||
<version>${poi.version}</version> | <version>${poi.version}</version> | ||||
</dependency> | </dependency> | ||||
<version>5.0.0-SNAPSHOT</version> | <version>5.0.0-SNAPSHOT</version> | ||||
<relativePath>..</relativePath> | <relativePath>..</relativePath> | ||||
</parent> | </parent> | ||||
<artifactId>poi-ooxml-schema</artifactId> | |||||
<artifactId>poi-ooxml-lite</artifactId> | |||||
<packaging>jar</packaging> | <packaging>jar</packaging> | ||||
<name>Apache POI - Openxmlformats Schema package</name> | <name>Apache POI - Openxmlformats Schema package</name> | ||||
<target> | <target> | ||||
<property name="xsdir" value="${basedir}/../../src/ooxml/resources/org/apache/poi"/> | <property name="xsdir" value="${basedir}/../../src/ooxml/resources/org/apache/poi"/> | ||||
<copy todir="${basedir}/target/schemas"> | <copy todir="${basedir}/target/schemas"> | ||||
<zipfileset src="${xsdir}/schemas/OfficeOpenXML-XMLSchema.zip"/> | |||||
<zipfileset src="${xsdir}/schemas/OfficeOpenXML-XMLSchema-Transitional.zip"/> | |||||
<zipfileset src="${xsdir}/schemas/OpenPackagingConventions-XMLSchema.zip" includes="opc-digSig.xsd,opc-relationships.xsd"/> | <zipfileset src="${xsdir}/schemas/OpenPackagingConventions-XMLSchema.zip" includes="opc-digSig.xsd,opc-relationships.xsd"/> | ||||
<fileset dir="${xsdir}/xdgf" includes="*.xsd,*.xsdconfig"/> | <fileset dir="${xsdir}/xdgf" includes="*.xsd,*.xsdconfig"/> | ||||
<fileset dir="${xsdir}/schemas" includes="*.xsd,*.xsdconfig"/> | <fileset dir="${xsdir}/schemas" includes="*.xsd,*.xsdconfig"/> | ||||
<directory>${basedir}/target/generated-resources</directory> | <directory>${basedir}/target/generated-resources</directory> | ||||
</resource> | </resource> | ||||
<resource> | <resource> | ||||
<directory>${basedir}/../../src/multimodule/ooxml-schemas/java9</directory> | |||||
<directory>${basedir}/../../src/multimodule/ooxml-full/java9</directory> | |||||
<targetPath>META-INF/versions/9</targetPath> | <targetPath>META-INF/versions/9</targetPath> | ||||
<includes> | <includes> | ||||
<include>*.class</include> | <include>*.class</include> |
<dependencies> | <dependencies> | ||||
<dependency> | <dependency> | ||||
<groupId>${project.groupId}</groupId> | <groupId>${project.groupId}</groupId> | ||||
<artifactId>poi-ooxml-schema</artifactId> | |||||
<artifactId>poi-ooxml-lite</artifactId> | |||||
<version>${project.version}</version> | <version>${project.version}</version> | ||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> |
<modules> | <modules> | ||||
<module>main</module> | <module>main</module> | ||||
<module>ooxml-schema</module> | |||||
<module>ooxml-full</module> | |||||
<module>ooxml</module> | <module>ooxml</module> | ||||
<module>scratchpad</module> | <module>scratchpad</module> | ||||
<module>excelant</module> | <module>excelant</module> | ||||
</dependency> | </dependency> | ||||
</dependencies> | </dependencies> | ||||
<configuration> | <configuration> | ||||
<printSummary>false</printSummary> | |||||
<systemPropertyVariables> | <systemPropertyVariables> | ||||
<POI.testdata.path>../../test-data</POI.testdata.path> | <POI.testdata.path>../../test-data</POI.testdata.path> | ||||
<java.awt.headless>true</java.awt.headless> | <java.awt.headless>true</java.awt.headless> |
See the License for the specific language governing permissions and | See the License for the specific language governing permissions and | ||||
limitations under the License. | limitations under the License. | ||||
==================================================================== */ | ==================================================================== */ | ||||
// Add the POI core and OOXML support dependencies into your build.sbt | // Add the POI core and OOXML support dependencies into your build.sbt | ||||
libraryDependencies ++= Seq( | libraryDependencies ++= Seq( | ||||
"org.apache.poi" % "poi" % "4.1.2", | |||||
"org.apache.poi" % "poi-ooxml" % "4.1.2", | |||||
"org.apache.poi" % "poi-ooxml-schemas" "4.1.2", | |||||
"org.apache.poi" % "poi" % "5.0.0", | |||||
"org.apache.poi" % "poi-ooxml" % "5.0.0", | |||||
"org.apache.poi" % "poi-ooxml-lite" "5.0.0", | |||||
) | ) |
/** | /** | ||||
* This program creates a simple WordprocessingML table using POI XWPF API, and | * This program creates a simple WordprocessingML table using POI XWPF API, and | ||||
* a more complex, styled table using both XWPF and ooxml-schema. It's possible | |||||
* that not all referenced wordprocessingml classes are defined in | |||||
* poi-ooxml-schemas-3.8-beta4. If this is the case, you'll need to use the full | |||||
* ooxml-schemas.jar library. | |||||
* a more complex, styled table using both XWPF and poi-ooxml-full. It's possible | |||||
* that not all referenced wordprocessingml classes are defined in the | |||||
* poi-ooxml-lite jar. If this is the case, you'll need to use the | |||||
* poi-ooxml-full jar library. | |||||
* | * | ||||
* @author gisella bronzetti (original) | * @author gisella bronzetti (original) | ||||
* @author Gregg Morris (styled table) | * @author Gregg Morris (styled table) |
* Ant task class for testing Excel workbook cells. | * Ant task class for testing Excel workbook cells. | ||||
*/ | */ | ||||
public class ExcelAntTask extends Task { | public class ExcelAntTask extends Task { | ||||
public static final String VERSION = "0.5.0" ; | public static final String VERSION = "0.5.0" ; | ||||
private String excelFileName ; | private String excelFileName ; | ||||
private boolean failOnError; | private boolean failOnError; | ||||
private ExcelAntWorkbookUtil workbookUtil ; | private ExcelAntWorkbookUtil workbookUtil ; | ||||
private ExcelAntPrecision precision ; | private ExcelAntPrecision precision ; | ||||
private LinkedList<ExcelAntTest> tests ; | private LinkedList<ExcelAntTest> tests ; | ||||
private LinkedList<ExcelAntUserDefinedFunction> functions ; | private LinkedList<ExcelAntUserDefinedFunction> functions ; | ||||
public ExcelAntTask() { | public ExcelAntTask() { | ||||
tests = new LinkedList<>() ; | tests = new LinkedList<>() ; | ||||
functions = new LinkedList<>() ; | functions = new LinkedList<>() ; | ||||
public void addPrecision( ExcelAntPrecision prec ) { | public void addPrecision( ExcelAntPrecision prec ) { | ||||
precision = prec ; | precision = prec ; | ||||
} | } | ||||
public void setFailOnError( boolean value ) { | public void setFailOnError( boolean value ) { | ||||
failOnError = value ; | failOnError = value ; | ||||
} | } | ||||
public void setFileName( String fileName ) { | public void setFileName( String fileName ) { | ||||
excelFileName = fileName ; | excelFileName = fileName ; | ||||
} | } | ||||
public void addTest( ExcelAntTest testElement ) { | public void addTest( ExcelAntTest testElement ) { | ||||
tests.add( testElement ) ; | tests.add( testElement ) ; | ||||
} | } | ||||
public void addUdf( ExcelAntUserDefinedFunction def ) { | public void addUdf( ExcelAntUserDefinedFunction def ) { | ||||
functions.add( def ) ; | functions.add( def ) ; | ||||
} | } | ||||
@Override | @Override | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
checkClassPath(); | checkClassPath(); | ||||
int totalCount = 0 ; | int totalCount = 0 ; | ||||
int successCount = 0 ; | int successCount = 0 ; | ||||
StringBuilder versionBffr = new StringBuilder() ; | StringBuilder versionBffr = new StringBuilder() ; | ||||
versionBffr.append( "ExcelAnt version " ) ; | versionBffr.append( "ExcelAnt version " ) ; | ||||
versionBffr.append( VERSION ) ; | versionBffr.append( VERSION ) ; | ||||
versionBffr.append( currYear ) ; | versionBffr.append( currYear ) ; | ||||
} | } | ||||
log( versionBffr.toString(), Project.MSG_INFO ) ; | log( versionBffr.toString(), Project.MSG_INFO ) ; | ||||
log( "Using input file: " + excelFileName, Project.MSG_INFO ) ; | log( "Using input file: " + excelFileName, Project.MSG_INFO ) ; | ||||
workbookUtil = ExcelAntWorkbookUtilFactory.getInstance(excelFileName); | workbookUtil = ExcelAntWorkbookUtilFactory.getInstance(excelFileName); | ||||
for (ExcelAntTest test : tests) { | for (ExcelAntTest test : tests) { | ||||
log("executing test: " + test.getName(), Project.MSG_DEBUG); | log("executing test: " + test.getName(), Project.MSG_DEBUG); | ||||
} | } | ||||
workbookUtil = null; | workbookUtil = null; | ||||
} | } | ||||
/** | /** | ||||
* ExcelAnt depends on external libraries not included in the Ant distribution. | * ExcelAnt depends on external libraries not included in the Ant distribution. | ||||
throw new BuildException( | throw new BuildException( | ||||
"The <classpath> for <excelant> must include poi.jar and poi-ooxml.jar " + | "The <classpath> for <excelant> must include poi.jar and poi-ooxml.jar " + | ||||
"if not in Ant's own classpath. Processing .xlsx spreadsheets requires " + | "if not in Ant's own classpath. Processing .xlsx spreadsheets requires " + | ||||
"additional poi-ooxml-schemas.jar, xmlbeans.jar" , | |||||
"additional poi-ooxml-lite.jar, xmlbeans.jar" , | |||||
e, getLocation()); | e, getLocation()); | ||||
} | } | ||||
<fileset dir="${dist}"> | <fileset dir="${dist}"> | ||||
<include name="**/poi-5.*.jar"/> | <include name="**/poi-5.*.jar"/> | ||||
<include name="**/poi-ooxml-5.*.jar"/> | <include name="**/poi-ooxml-5.*.jar"/> | ||||
<include name="**/poi-ooxml-schemas-5.*.jar"/> | |||||
<include name="**/poi-ooxml-lite-5.*.jar"/> | |||||
<exclude name="**/*-javadoc*"/> | <exclude name="**/*-javadoc*"/> | ||||
<exclude name="**/*-sources*"/> | <exclude name="**/*-sources*"/> | ||||
</fileset> | </fileset> | ||||
<fileset dir="${dist}"> | <fileset dir="${dist}"> | ||||
<include name="**/poi-5.*.jar"/> | <include name="**/poi-5.*.jar"/> | ||||
<include name="**/poi-ooxml-5.*.jar"/> | <include name="**/poi-ooxml-5.*.jar"/> | ||||
<include name="**/poi-ooxml-schemas-5.*.jar"/> | |||||
<include name="**/poi-ooxml-lite-5.*.jar"/> | |||||
<include name="**/poi-scratchpad-5.*.jar"/> | <include name="**/poi-scratchpad-5.*.jar"/> | ||||
<exclude name="**/*-javadoc*"/> | <exclude name="**/*-javadoc*"/> | ||||
<exclude name="**/*-sources*"/> | <exclude name="**/*-sources*"/> |
"Schemas (*.xsb) for <CLASS> can't be loaded - usually this happens when OSGI " + | "Schemas (*.xsb) for <CLASS> can't be loaded - usually this happens when OSGI " + | ||||
"loading is used and the thread context classloader has no reference to " + | "loading is used and the thread context classloader has no reference to " + | ||||
"the xmlbeans classes - please either verify if the <XSB>.xsb is on the " + | "the xmlbeans classes - please either verify if the <XSB>.xsb is on the " + | ||||
"classpath or alternatively try to use the full ooxml-schemas-x.x.jar"; | |||||
"classpath or alternatively try to use the poi-ooxml-full-x.x.jar"; | |||||
private static final String MC_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006"; | private static final String MC_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006"; | ||||
private static final String MAC_DML_NS = "http://schemas.microsoft.com/office/mac/drawingml/2008/main"; | private static final String MAC_DML_NS = "http://schemas.microsoft.com/office/mac/drawingml/2008/main"; | ||||
} | } | ||||
// Pesky XmlBeans bug - see Bugzilla #49934 | // Pesky XmlBeans bug - see Bugzilla #49934 | ||||
// it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas | |||||
// it never happens when using poi-ooxml-full jar but may happen with the abridged poi-ooxml-lite jar | |||||
xo = innerCur.getObject(); | xo = innerCur.getObject(); | ||||
if (xo instanceof XmlAnyTypeImpl) { | if (xo instanceof XmlAnyTypeImpl) { | ||||
String errorTxt = OSGI_ERROR | String errorTxt = OSGI_ERROR | ||||
alterCont = (AlternateContentDocument.AlternateContent)xo; | alterCont = (AlternateContentDocument.AlternateContent)xo; | ||||
} else { | } else { | ||||
// Pesky XmlBeans bug - see Bugzilla #49934 | // Pesky XmlBeans bug - see Bugzilla #49934 | ||||
// it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas | |||||
// it never happens when using poi-ooxml-full jar but may happen with the abridged poi-ooxml-lite jar | |||||
if (!reparseAlternate) { | if (!reparseAlternate) { | ||||
throw new XmlException(OSGI_ERROR | throw new XmlException(OSGI_ERROR | ||||
.replace("<CLASS>", "AlternateContent") | .replace("<CLASS>", "AlternateContent") |
XmlObject xo = xc.getObject(); | XmlObject xo = xc.getObject(); | ||||
// Pesky XmlBeans bug - see Bugzilla #49934 | // Pesky XmlBeans bug - see Bugzilla #49934 | ||||
// it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas | |||||
// it never happens when using poi-ooxml-full jar but may happen with the abridged poi-ooxml-lite jar | |||||
if (xo instanceof XmlAnyTypeImpl){ | if (xo instanceof XmlAnyTypeImpl){ | ||||
String errStr = | String errStr = | ||||
"Schemas (*.xsb) for CTTable can't be loaded - usually this happens when OSGI " + | "Schemas (*.xsb) for CTTable can't be loaded - usually this happens when OSGI " + |
import org.openxmlformats.schemas.drawingml.x2006.chart.*; | import org.openxmlformats.schemas.drawingml.x2006.chart.*; | ||||
import org.openxmlformats.schemas.drawingml.x2006.main.*; | import org.openxmlformats.schemas.drawingml.x2006.main.*; | ||||
// aim is to get these classes loaded and included in poi-ooxml-schemas.jar | |||||
// aim is to get these classes loaded and included in poi-ooxml-lite.jar | |||||
public class TestNecessaryOOXMLClasses { | public class TestNecessaryOOXMLClasses { | ||||
@Test | @Test |
*/ | */ | ||||
package org.apache.poi.xddf.usermodel.chart; | package org.apache.poi.xddf.usermodel.chart; | ||||
import static org.junit.Assert.assertEquals; | |||||
import static org.junit.Assert.assertNotNull; | |||||
import org.apache.poi.ooxml.POIXMLFactory; | import org.apache.poi.ooxml.POIXMLFactory; | ||||
import org.apache.poi.ooxml.POIXMLRelation; | import org.apache.poi.ooxml.POIXMLRelation; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace; | import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace; | ||||
import static org.junit.Assert.assertEquals; | |||||
import static org.junit.Assert.assertNotNull; | |||||
public class TestXDDFChart { | public class TestXDDFChart { | ||||
@Test | @Test | ||||
public void testConstruct() { | public void testConstruct() { | ||||
// minimal test to cause ooxml-lite to include all the classes in poi-ooxml-schemas | |||||
// minimal test to cause ooxml-lite to include all the classes in poi-ooxml-lite | |||||
XDDFChart xddfChart = newXDDFChart(); | XDDFChart xddfChart = newXDDFChart(); | ||||
assertNotNull(xddfChart.getCTChartSpace()); | assertNotNull(xddfChart.getCTChartSpace()); | ||||
xddfChart.setExternalId("rid1"); | xddfChart.setExternalId("rid1"); | ||||
assertEquals("rid1", ctChartSpace.getExternalData().getId()); | assertEquals("rid1", ctChartSpace.getExternalData().getId()); | ||||
xddfChart.setExternalId("rid2"); | xddfChart.setExternalId("rid2"); | ||||
assertEquals("rid2", ctChartSpace.getExternalData().getId()); | assertEquals("rid2", ctChartSpace.getExternalData().getId()); | ||||
} | } |
==================================================================== */ | ==================================================================== */ | ||||
package org.apache.poi.xddf.usermodel.chart; | package org.apache.poi.xddf.usermodel.chart; | ||||
import org.junit.Test; | |||||
import static org.junit.Assert.assertEquals; | |||||
import static org.junit.Assert.assertNotNull; | |||||
import static org.junit.Assert.*; | |||||
import org.junit.Test; | |||||
public class TestXDDFChartExtensionList { | public class TestXDDFChartExtensionList { | ||||
@Test | @Test | ||||
public void getXmlObject() { | public void getXmlObject() { | ||||
// minimal test to include generated classes in poi-ooxml-schemas | |||||
// minimal test to include generated classes in poi-ooxml-lite | |||||
XDDFChartExtensionList list = new XDDFChartExtensionList(); | XDDFChartExtensionList list = new XDDFChartExtensionList(); | ||||
assertNotNull(list.getXmlObject()); | assertNotNull(list.getXmlObject()); | ||||
import org.apache.xmlbeans.XmlObject; | import org.apache.xmlbeans.XmlObject; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
// aim is to get these classes loaded and included in poi-ooxml-schemas.jar | |||||
// aim is to get these classes loaded and included in poi-ooxml-lite.jar | |||||
public class TestNecessaryOOXMLClasses { | public class TestNecessaryOOXMLClasses { | ||||
@Test | @Test |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow; | import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow; | ||||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetData; | import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetData; | ||||
// aim is to get these classes loaded and included in poi-ooxml-schemas.jar | |||||
// aim is to get these classes loaded and included in poi-ooxml-lite.jar | |||||
public class TestNecessaryOOXMLClasses { | public class TestNecessaryOOXMLClasses { | ||||
@Test | @Test |
} | } | ||||
/** | /** | ||||
* ensure that CTPhoneticPr is loaded by the ooxml test suite so that it is included in poi-ooxml-schemas | |||||
* ensure that CTPhoneticPr is loaded by the ooxml test suite so that it is included in poi-ooxml-lite | |||||
*/ | */ | ||||
@Test | @Test | ||||
public void bug49325() throws IOException { | public void bug49325() throws IOException { | ||||
/** | /** | ||||
* CTDefinedNamesImpl should be included in the smaller | * CTDefinedNamesImpl should be included in the smaller | ||||
* poi-ooxml-schemas jar | |||||
* poi-ooxml-lite jar | |||||
*/ | */ | ||||
@Test | @Test | ||||
public void bug57176() throws IOException { | public void bug57176() throws IOException { |
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STEm; | import org.openxmlformats.schemas.wordprocessingml.x2006.main.STEm; | ||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblLayoutType; | import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblLayoutType; | ||||
// aim is to get these classes loaded and included in poi-ooxml-schemas.jar | |||||
// aim is to get these classes loaded and included in poi-ooxml-lite.jar | |||||
public class TestNecessaryOOXMLClasses { | public class TestNecessaryOOXMLClasses { | ||||
@Test | @Test |
package org.apache.poi.xwpf.extractor; | package org.apache.poi.xwpf.extractor; | ||||
import org.apache.poi.util.StringUtil; | |||||
import org.apache.poi.xwpf.XWPFTestDataSamples; | |||||
import org.apache.poi.xwpf.usermodel.XWPFDocument; | |||||
import org.junit.Test; | |||||
import java.io.IOException; | |||||
import java.util.Locale; | |||||
import java.util.regex.Matcher; | |||||
import java.util.regex.Pattern; | |||||
import static org.apache.poi.POITestCase.assertContains; | import static org.apache.poi.POITestCase.assertContains; | ||||
import static org.apache.poi.POITestCase.assertEndsWith; | import static org.apache.poi.POITestCase.assertEndsWith; | ||||
import static org.apache.poi.POITestCase.assertNotContained; | import static org.apache.poi.POITestCase.assertNotContained; | ||||
import static org.junit.Assert.assertFalse; | import static org.junit.Assert.assertFalse; | ||||
import static org.junit.Assert.assertTrue; | import static org.junit.Assert.assertTrue; | ||||
import java.io.IOException; | |||||
import java.util.Locale; | |||||
import java.util.regex.Matcher; | |||||
import java.util.regex.Pattern; | |||||
import org.apache.poi.util.StringUtil; | |||||
import org.apache.poi.xwpf.XWPFTestDataSamples; | |||||
import org.apache.poi.xwpf.usermodel.XWPFDocument; | |||||
import org.junit.Test; | |||||
/** | /** | ||||
* Tests for HXFWordExtractor | * Tests for HXFWordExtractor | ||||
*/ | */ | ||||
@Test | @Test | ||||
public void testCTPictureBase() throws IOException { | public void testCTPictureBase() throws IOException { | ||||
//This forces ctpicturebase to be included in the poi-ooxml-schemas jar | |||||
//This forces ctpicturebase to be included in the poi-ooxml-lite jar | |||||
try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("61991.docx"); | try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("61991.docx"); | ||||
XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { | XWPFWordExtractor extractor = new XWPFWordExtractor(doc)) { | ||||
String txt = extractor.getText(); | String txt = extractor.getText(); |
final XWPFRun run = document.createParagraph().createRun(); | final XWPFRun run = document.createParagraph().createRun(); | ||||
// at least trigger some of the setters to ensure classes are included in | // at least trigger some of the setters to ensure classes are included in | ||||
// the poi-ooxml-schemas | |||||
// the poi-ooxml-lite | |||||
run.setBold(true); | run.setBold(true); | ||||
run.setCapitalized(true); | run.setCapitalized(true); | ||||
run.setCharacterSpacing(2); | run.setCharacterSpacing(2); |
/** | /** | ||||
* YK: tests below don't make much sense, | * YK: tests below don't make much sense, | ||||
* they exist only to copy xml beans to pi-ooxml-schemas.jar | |||||
* they exist only to copy xml beans to pi-ooxml-lite.jar | |||||
*/ | */ | ||||
@SuppressWarnings("resource") | @SuppressWarnings("resource") | ||||
@Test | @Test | ||||
assertEquals(200, styles.getDefaultParagraphStyle().getSpacingAfter()); | assertEquals(200, styles.getDefaultParagraphStyle().getSpacingAfter()); | ||||
} | } | ||||
} | } | ||||
// Bug 60329: style with missing StyleID throws NPE | // Bug 60329: style with missing StyleID throws NPE | ||||
@Test | @Test | ||||
public void testMissingStyleId() throws IOException { | public void testMissingStyleId() throws IOException { | ||||
assertNotNull(styles.getStyle("NoList")); | assertNotNull(styles.getStyle("NoList")); | ||||
assertNull(styles.getStyle("EmptyCellLayoutStyle")); | assertNull(styles.getStyle("EmptyCellLayoutStyle")); | ||||
assertNotNull(styles.getStyle("BalloonText")); | assertNotNull(styles.getStyle("BalloonText")); | ||||
// Bug 64600: styleExist throws NPE | // Bug 64600: styleExist throws NPE | ||||
assertTrue(styles.styleExist("NoList")); | assertTrue(styles.styleExist("NoList")); | ||||
assertFalse(styles.styleExist("EmptyCellLayoutStyle")); | assertFalse(styles.styleExist("EmptyCellLayoutStyle")); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
@Test | @Test | ||||
public void testGetStyleByName() throws IOException { | public void testGetStyleByName() throws IOException { | ||||
try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { | try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx")) { |
==================================================================== */ | ==================================================================== */ | ||||
package org.apache.poi.xwpf.usermodel; | package org.apache.poi.xwpf.usermodel; | ||||
import org.junit.Test; | |||||
import static org.junit.Assert.assertNull; | import static org.junit.Assert.assertNull; | ||||
import org.junit.Test; | |||||
public class XWPFAbstractNumTest { | public class XWPFAbstractNumTest { | ||||
@Test | @Test | ||||
public void getXmlObject() { | public void getXmlObject() { | ||||
// minimal test to include generated classes in poi-ooxml-schemas | |||||
// minimal test to include generated classes in poi-ooxml-lite | |||||
XWPFAbstractNum num = new XWPFAbstractNum(); | XWPFAbstractNum num = new XWPFAbstractNum(); | ||||
assertNull(num.getCTAbstractNum()); | assertNull(num.getCTAbstractNum()); | ||||
} | } |