diff --git a/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java b/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java index f8518c42..af131718 100644 --- a/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java +++ b/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java @@ -1559,7 +1559,7 @@ private File writeMergedSettingsFile( Settings mergedSettings ) throws IOException { File mergedSettingsFile; - mergedSettingsFile = File.createTempFile( "invoker-settings", ".xml" ); + mergedSettingsFile = Files.createTempFile( "invoker-settings", ".xml" ).toFile(); SettingsXpp3Writer settingsWriter = new SettingsXpp3Writer(); diff --git a/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java b/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java index 1694e1d8..a6148ae4 100644 --- a/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java +++ b/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java @@ -20,6 +20,7 @@ */ import java.io.File; +import java.nio.file.Files; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -199,7 +200,7 @@ public void testConfigureRequestProject() throws Exception Properties props = new Properties(); InvokerProperties facade = new InvokerProperties( props ); - File tempPom = File.createTempFile( "maven-invoker-plugin-test", ".pom" ); + File tempPom = Files.createTempFile( "maven-invoker-plugin-test", ".pom" ).toFile(); try { File tempDir = tempPom.getParentFile();