Is there a way in ant to load properties from inside a zip file?
I have a project ant file which needs to use some properties that are in a file that is inside a zip file. The zip file is stored in a known location on our CI server.
/known location/file.zip
|
+--- properties/details.properties
The following doesn’t work
<project name="test" basedir="." >
<property file="/known location/file.zip/properties/details.properties"/>
....
</project>
Since zip files and jar files are basically the same, you can use the
urlform of thepropertytask, with ajarurl.Note the
jar:file:at the front of the url, and the!/separating the zip file location from the path of the properties file within the zip.See the JarURLConnection docs for more info on the syntax of a
jar:url.