Bug 54008 - [PATCH] Ant build fails if code is located in a directory with blanks
Summary: [PATCH] Ant build fails if code is located in a directory with blanks
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.9-dev
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2012-10-15 18:19 UTC by Dominik Stadler
Modified: 2012-10-26 11:51 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Stadler 2012-10-15 18:19:47 UTC
When using a directory with blanks in the name, building Apache POI fails:

     [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}"/>
Comment 1 Yegor Kozlov 2012-10-26 11:51:33 UTC
Good catch, thanks! Fixed in r1402473.