Index: src/java/org/apache/ivy/ant/IvyArtifactReport.java =================================================================== --- src/java/org/apache/ivy/ant/IvyArtifactReport.java (revision 891872) +++ src/java/org/apache/ivy/ant/IvyArtifactReport.java (working copy) @@ -155,7 +155,7 @@ writeOriginLocationIfPresent(cache, saxHandler, artifact); - writeCacheLocation(cache, saxHandler, artifact); + writeCacheLocationIfPresent(cache, saxHandler, artifact); Set artifactDestPaths = (Set) artifactsToCopy.get(artifact); for (Iterator iterator = artifactDestPaths.iterator(); iterator @@ -243,14 +243,16 @@ } } - private void writeCacheLocation(RepositoryCacheManager cache, TransformerHandler saxHandler, + private void writeCacheLocationIfPresent(RepositoryCacheManager cache, TransformerHandler saxHandler, ArtifactDownloadReport artifact) throws SAXException { File archiveInCache = artifact.getLocalFile(); - saxHandler.startElement(null, "cache-location", "cache-location", new AttributesImpl()); - char[] archiveInCacheAsChars = archiveInCache.getPath().replace('\\', '/').toCharArray(); - saxHandler.characters(archiveInCacheAsChars, 0, archiveInCacheAsChars.length); - saxHandler.endElement(null, "cache-location", "cache-location"); + if ( archiveInCache != null ) { + saxHandler.startElement(null, "cache-location", "cache-location", new AttributesImpl()); + char[] archiveInCacheAsChars = archiveInCache.getPath().replace('\\', '/').toCharArray(); + saxHandler.characters(archiveInCacheAsChars, 0, archiveInCacheAsChars.length); + saxHandler.endElement(null, "cache-location", "cache-location"); + } } private void writeRetrieveLocation(TransformerHandler saxHandler, String artifactDestPath)