db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tilma...@apache.org
Subject [db-jdo] 01/01: Fix failing `mvn clean install` failing due to `datanucleaus.txt` and other log files' deletion failing while being locked.
Date Wed, 30 Dec 2020 16:54:30 GMT
This is an automated email from the ASF dual-hosted git repository.

tilmannz pushed a commit to branch fix-maven-clean-windows
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit 95b7487699cba47b5587082e06a721312cc57ba8
Author: Tilmann <zoodb@gmx.de>
AuthorDate: Wed Dec 30 17:53:47 2020 +0100

    Fix failing `mvn clean install` failing due to `datanucleaus.txt` and other log files'
deletion failing while being locked.
---
 exectck/src/main/java/org/apache/jdo/exectck/Enhance.java | 3 ++-
 exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java  | 4 ++--
 pom.xml                                                   | 1 +
 tck/pom.xml                                               | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java b/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
index 0c08469..ae5df1e 100644
--- a/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
+++ b/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
@@ -242,7 +242,8 @@ public class Enhance extends AbstractTCKMojo {
             try {
                 File logFile = new File(implLogFile);
                 File testLogFile = new File(testLogFilename);
-                FileUtils.moveFile(logFile, testLogFile);
+                FileUtils.copyFile(logFile, testLogFile);
+                FileUtils.forceDeleteOnExit(logFile);
             } catch (Exception e) {
                 System.out.println(">> Error moving implementation log file: " +
                     e.getMessage());
diff --git a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
index fff1cfc..b909a6e 100644
--- a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
+++ b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
@@ -467,12 +467,12 @@ public class RunTCK extends AbstractTCKMojo {
         }
         // Remove log file
         try {
-            FileUtils.forceDelete(new File(implLogFile));
+            FileUtils.forceDeleteOnExit(new File(implLogFile));
         } catch (Exception e) {
             System.out.println(">> Error deleting log file: " + e.getMessage());
         }
         try {
-            FileUtils.forceDelete(new File(TCK_LOG_FILE));
+            FileUtils.forceDeleteOnExit(new File(TCK_LOG_FILE));
         } catch (Exception e) {
             System.out.println(">> Error deleting log file: " + e.getMessage());
         }
diff --git a/pom.xml b/pom.xml
index a922cde..97c94d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,7 @@
                           </includes>
                       </fileset>
                   </filesets>
+                  <failOnError>false</failOnError>
               </configuration>
             </plugin>
             <plugin>
diff --git a/tck/pom.xml b/tck/pom.xml
index 0aa1ace..4ed44c1 100644
--- a/tck/pom.xml
+++ b/tck/pom.xml
@@ -126,6 +126,7 @@
                             </includes>
                         </fileset>
                     </filesets>
+                    <failOnError>false</failOnError>
                 </configuration>
             </plugin>
         </plugins>


Mime
View raw message