Merge remote-tracking branch 'origin/master' into issues/SLING-8630
diff --git a/README.md b/README.md
index 2dd6c3f..c43db11 100644
--- a/README.md
+++ b/README.md
@@ -404,3 +404,17 @@
 ```
 $ ./bin/cp2sf @arfile
 ````
+
+## Local Maven Repo as Cache
+
+The converter will create a Maven Dependency folder structure and create a POM file
+for any converted Content Package file. This will allow subsequent Feature tools
+to find and process them.
+The **group and artifact id** of the converted Content Package and Bundles is
+taken from the file itself (Content Package's Vault Properties file, Bundle's
+Headers). Because these sources might not correspond with the CPs or Bundles
+regular Maven place the Converter will place them accordingly to the found
+data hence in a new place.
+This does not bother the Sling Feature Maven Plugin nor the Feature Launcher
+as they are still able to find the dependencies if placed in the Local
+Maven Repo.
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/feature/cpconverter/artifacts/DefaultArtifactsDeployer.java b/src/main/java/org/apache/sling/feature/cpconverter/artifacts/DefaultArtifactsDeployer.java
index 31b519b..c1dda4c 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/artifacts/DefaultArtifactsDeployer.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/artifacts/DefaultArtifactsDeployer.java
@@ -89,8 +89,12 @@
 
         targetFile = new File(targetDir, String.format("%s-%s.pom", id.getArtifactId(), id.getVersion()));
 
-        try (FileOutputStream targetStream = new FileOutputStream(targetFile)) {
-            new MavenPomSupplierWriter(id).write(targetStream);
+        // If a POM already exists then there is not need to overwrite it as either the entire POM is lost
+        // or if its the a file previously generated here it must be the same
+        if(!targetFile.exists()) {
+            try (FileOutputStream targetStream = new FileOutputStream(targetFile)) {
+                new MavenPomSupplierWriter(id).write(targetStream);
+            }
         }
     }