Repository: quarkusio/quarkus
Issue: Using "mvn install" a second time throws "FileAlreadyExistsException: .../target/lib/../providers/.keep"

### Describe the bug

When I run `mvn install` a second time on my project ([keycloak](https://github.com/keycloak/keycloak)), complains that the `.keep` file exists. 





### Expected behavior

Run should continue.

### Actual behavior

Exception being thrown. 

```
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:2.7.6.Final:build (default) on project keycloak-quarkus-server-app: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.JarResultBuildStep#buildRunnerJar threw an exception: java.lang.IllegalStateException: java.nio.file.FileAlreadyExistsException: /***/keycloak/quarkus/server/target/lib/../providers/.keep
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:891)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.nio.file.FileAlreadyExistsException: /home/aschwart/redhat/workspace/keycloak-pr-2/quarkus/server/target/lib/../providers/.keep
[ERROR]         at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
[ERROR]         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
[ERROR]         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
[ERROR]         at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
[ERROR]         at java.base/java.nio.file.Files.newByteChannel(Files.java:371)
[ERROR]         at java.base/java.nio.file.Files.createFile(Files.java:648)
[ERROR]         at io.quarkus.deployment.pkg.steps.JarResultBuildStep.buildThinJar(JarResultBuildStep.java:571)
[ERROR]         at io.quarkus.deployment.pkg.steps.JarResultBuildStep.buildRunnerJar(JarResultBuildStep.java:218)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
[ERROR]         ... 6 more
```


### How to Reproduce?

1. checkout project
2. run `mvn install`
3. run `mvn install` again

-> Exception appears

### Output of `uname -a` or `ver`

Linux fedora 5.18.7-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Jun 25 20:05:19 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

### Output of `java -version`

openjdk 11.0.13 2021-10-19 LTS
OpenJDK Runtime Environment Corretto-11.0.13.8.1 (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.13.8.1 (build 11.0.13+8-LTS, mixed mode)

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.7.6.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /home/aschwart/apache-maven-3.8.4
Java version: 11.0.13, vendor: Amazon.com Inc., runtime: /home/aschwart/.jdks/corretto-11.0.13
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.18.7-100.fc35.x86_64", arch: "amd64", family: "unix"

### Additional information

PR available as a fix #26477

Changed files:
core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java
index 9486104637b..a1c9d0dbeb2 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/JarResultBuildStep.java
@@ -567,7 +567,11 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
                 Files.createDirectories(userProviders);
                 //we add this dir so that it can be copied into container images if required
                 //and will still be copied even if empty
-                Files.createFile(userProviders.resolve(".keep"));
+                Path keepFile = userProviders.resolve(".keep");
+                if (!keepFile.toFile().exists()) {
+                    // check if the file exists to avoid a FileAlreadyExistsException
+                    Files.createFile(keepFile);
+                }
             }
         } else {
             IoUtils.createOrEmptyDir(quarkus);