Bug 54008

Summary: [PATCH] Ant build fails if code is located in a directory with blanks
Product: POI Reporter: Dominik Stadler <dominik.stadler>
Component: POI OverallAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.9-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Dominik Stadler 2012-10-15 18:19:47 UTC
When using a directory with blanks in the name, building Apache POI fails:

compile-ooxml-lite:
     [java] Collecting unit tests from /opt/jenkins/workspace/Apache
     [java] Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
     [java] 	at java.lang.String.substring(String.java:1937)
     [java] 	at java.lang.String.substring(String.java:1904)
     [java] 	at org.apache.poi.util.OOXMLLite.collectTests(OOXMLLite.java:155)
     [java] 	at org.apache.poi.util.OOXMLLite.build(OOXMLLite.java:86)
     [java] 	at org.apache.poi.util.OOXMLLite.main(OOXMLLite.java:78)
     [java] Java Result: 1

The step for "compile-ooxml-lite" is currently written in a way that does not support blanks, the following patch fixes this:

Index: build.xml
===================================================================
--- build.xml   (Revision 1397790)
+++ build.xml   (Arbeitskopie)
@@ -735,7 +735,12 @@
             <classpath refid="test.ooxml.classpath"/>
             <syspropertyset refid="junit.properties"/>
             <jvmarg value="${poi.test.locale}"/>
-            <arg line="-ooxml ${ooxml.xsds.jar} -test ${ooxml.output.test.dir} -dest ${ooxml.lite.output.dir}"/>
+            <arg value="-ooxml"/>
+            <arg value="${ooxml.xsds.jar}"/>
+            <arg value="-test"/>
+            <arg value="${ooxml.output.test.dir}"/>
+            <arg value="-dest"/>
+            <arg value="${ooxml.lite.output.dir}"/>
         </java>
     </target>
Comment 1 Yegor Kozlov 2012-10-26 11:51:33 UTC
Good catch, thanks! Fixed in r1402473.

Yegor