openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1836256 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Date Thu, 19 Jul 2018 08:36:33 GMT
Author: rmannibucau
Date: Thu Jul 19 08:36:33 2018
New Revision: 1836256

URL: http://svn.apache.org/viewvc?rev=1836256&view=rev
Log:
MEECROWAVE-128 avoid to delete base when not desired

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java?rev=1836256&r1=1836255&r2=1836256&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Thu Jul 19 08:36:33 2018
@@ -149,6 +149,7 @@ public class Meecrowave implements AutoC
     private final Map<String, Runnable> contexts = new HashMap<>();
     private Runnable postTask;
     private boolean clearCatalinaSystemProperties;
+    private boolean deleteBase;
 
     public Meecrowave() {
         this(new Builder());
@@ -967,7 +968,7 @@ public class Meecrowave implements AutoC
                 ofNullable(postTask).ifPresent(Runnable::run);
                 postTask = null;
                 try {
-                    if (base != null) {
+                    if (deleteBase && base != null) {
                         IO.delete(base);
                     }
 
@@ -1071,6 +1072,7 @@ public class Meecrowave implements AutoC
     }
 
     private String newBaseDir() {
+        deleteBase = false;
         String dir = configuration.dir;
         if (dir != null) {
             final File dirFile = new File(dir);
@@ -1089,6 +1091,7 @@ public class Meecrowave implements AutoC
             return new File(base).getAbsolutePath();
         }
 
+        deleteBase = true;
         final List<String> lookupPaths = new ArrayList<>();
         lookupPaths.add("target");
         lookupPaths.add("build");



Mime
View raw message