anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: quarkusio/quarkus
Issue: No redirect to index.html in subdirectory when running as uberjar

**Describe the bug**
I have a custom index.html in my /src/main/resources/META-INF/resources/subdirectory/ directory. I get automaticly redirected to this index.html, when I run the quarkus using quarkus:dev, and access localhost:8080/subdirectory.

Running as uberjar, when I try to access the "localhost:8080/subdirectory" page, i get a Not Found Error.

**Expected behavior**
index.html is automaticly used when i just access "localhost:8080/subdirectory", in quarkus:dev and uberjar mode.

quarkus:dev should at least have the same behavior in that regard to running as jar.

**Actual behavior**
index.html does not get used automaticly when running as uberjar.


**To Reproduce**
Steps to reproduce the behavior:
1. Create a new project, with an index.html in /src/main/resources/META-INF/resources/subdirectory/
2. Run usin "compile quarkus:dev"
3. Access localhost:8080/subdirectory
4. You get automaticly redirected to the index
5. Build the project as uberjar.
6. Start the jar
7. Access localhost:8080/subdirectory
8. You do not get automaticly redirected to the index


**Environment (please complete the following information):**
 - MSYS_NT-10.0 NANB7NLNVP2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msys
 - java version "1.8.0_211"
-- Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
-- Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
 - Quarkus 0.18.0


Changed files:
extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowStaticResourcesBuildStep.java

diff --git a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowStaticResourcesBuildStep.java b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowStaticResourcesBuildStep.java
index bdc6a79c615..251fef00654 100644
--- a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowStaticResourcesBuildStep.java
+++ b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowStaticResourcesBuildStep.java
@@ -60,7 +60,7 @@ public void accept(Path path) {
                             return;
                         }
                         Path rel = resource.relativize(path);
-                        if (Files.isDirectory(rel)) {
+                        if (Files.isDirectory(path)) {
                             knownDirectories.add(rel.toString());
                         } else {
                             knownFiles.add(rel.toString());
Repository: quarkusio/quarkus
Issue: [Jaeger] Metrics are wrongly added to base metrics

**Describe the bug**
The Jaeger metrics are displayed as **base** metrics, but they should be **vendor** metrics as **base** metrics should only be the one listed on the [MP metrics specification](https://github.com/eclipse/microprofile-metrics/blob/master/spec/src/main/asciidoc/required-metrics.adoc)

**Expected behavior**
Jaeger metrics are displayed under **vendor** metrics.

**Actual behavior**
Jaeger metrics are displayed under **base** metrics.

**To Reproduce**
Steps to reproduce the behavior:
1. Add `quarkus-smallrye-metrics` extension.
2. Add `quarkus-smallrye-opentracing` extension.
3. Navigate to the `/metrics/base` endpoint you will see Jaeger metrics.

**Environment (please complete the following information):**
 - Quarkus version or git rev: 0.21.1

**Additional context**
This has been discuss with @jmartisk that agreed it's a bug. If I have some time this week I will works on a PR for this as it should be very simple to fix :)


Changed files:
extensions/jaeger/runtime/src/main/java/io/quarkus/jaeger/runtime/QuarkusJaegerMetricsFactory.java

diff --git a/extensions/jaeger/runtime/src/main/java/io/quarkus/jaeger/runtime/QuarkusJaegerMetricsFactory.java b/extensions/jaeger/runtime/src/main/java/io/quarkus/jaeger/runtime/QuarkusJaegerMetricsFactory.java
index 03897450fe3..d28a1f02326 100644
--- a/extensions/jaeger/runtime/src/main/java/io/quarkus/jaeger/runtime/QuarkusJaegerMetricsFactory.java
+++ b/extensions/jaeger/runtime/src/main/java/io/quarkus/jaeger/runtime/QuarkusJaegerMetricsFactory.java
@@ -17,7 +17,7 @@
 
 public class QuarkusJaegerMetricsFactory implements MetricsFactory {
 
-    MetricRegistry registry = MetricRegistries.get(MetricRegistry.Type.BASE);
+    MetricRegistry registry = MetricRegistries.get(MetricRegistry.Type.VENDOR);
 
     @Override
     public Counter createCounter(final String name, final Map<String, String> tags) {
Repository: quarkusio/quarkus
Issue: Cleanup on live reload also removes generated classes

**Describe the bug**
Generated classes are removed during live reload.

**Expected behavior**
Generated classes are not deleted.

**To Reproduce**
Steps to reproduce the behavior:
1. `git clone https://github.com/antoniomacri/quarkus-rocker-class-cleanup.git`
2. `mvn install`
3. `ll target/classes/views` ->  `HostingPage.class`
4. `mvn quarkus:dev` (+ `mvn install` + F5 on `http://localhost:8080/`)
5. `ll target/classes/views` ->  `HostingPage.class` deleted

**Environment:**
 - Output of `java -version`: 1.8
 - Quarkus version or git rev: 0.20.0


Changed files:
core/devmode/src/main/java/io/quarkus/dev/RuntimeUpdatesProcessor.java

diff --git a/core/devmode/src/main/java/io/quarkus/dev/RuntimeUpdatesProcessor.java b/core/devmode/src/main/java/io/quarkus/dev/RuntimeUpdatesProcessor.java
index 064b89633b2..65280e047e2 100644
--- a/core/devmode/src/main/java/io/quarkus/dev/RuntimeUpdatesProcessor.java
+++ b/core/devmode/src/main/java/io/quarkus/dev/RuntimeUpdatesProcessor.java
@@ -202,12 +202,8 @@ private boolean checkForClassFilesChangesInModule(DevModeContext.ModuleInfo modu
                 for (Path classFilePath : classFilePaths) {
                     final Path sourceFilePath = retrieveSourceFilePathForClassFile(classFilePath, moduleChangedSourceFiles,
                             module);
-                    if (sourceFilePath == null) {
-                        Files.deleteIfExists(classFilePath);
-                        classFilePathToSourceFilePath.remove(classFilePath);
-                        hasChanges = true;
-                    } else {
-                        final long classFileModificationTime = Files.getLastModifiedTime(classFilePath).toMillis();
+                    final long classFileModificationTime = Files.getLastModifiedTime(classFilePath).toMillis();
+                    if (sourceFilePath != null) {
                         if (Files.notExists(sourceFilePath)) {
                             // Source file has been deleted. Delete class and restart
                             Files.deleteIfExists(classFilePath);
@@ -226,6 +222,8 @@ private boolean checkForClassFilesChangesInModule(DevModeContext.ModuleInfo modu
                                 hasChanges = true;
                             }
                         }
+                    } else if (classFileModificationTime > lastChange) {
+                        hasChanges = true;
                     }
                 }
             }
Repository: quarkusio/quarkus
Issue: QuarkusNative now depends on Docker while building from Gradle?

This is kinda of a question more than a bug report or something.
I was able to successfully try to use quarkus `0.13.1` to build a sample application, but what I found strange is that even though I have set (as I did in `0.12.0`) the `GRAALVM_HOME` variable, now it is using docker to build the application.

Is there an option to disable the need of using docker to build the native binary?

Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java

diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java
index 8ec05064312..b8d0ade47a1 100644
--- a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java
+++ b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java
@@ -56,7 +56,7 @@ public class QuarkusNative extends QuarkusTask {
 
     private String nativeImageXmx;
 
-    private String containerRuntime = "docker";
+    private String containerRuntime;
 
     private String containerRuntimeOptions;
Repository: quarkusio/quarkus
Issue: Add META-INF/io.netty.versions.properties to the uberJar ignore list

> [WARNING] [io.quarkus.creator.phase.runnerjar.RunnerJarPhase] Duplicate entry META-INF/io.netty.versions.properties entry from io.netty:netty-handler::jar:4.1.34.Final(compile) will be ignored. Existing file was provided by io.netty:netty-codec::jar:4.1.34.Final(compile)
> [WARNING] [io.quarkus.creator.phase.runnerjar.RunnerJarPhase] Duplicate entry META-INF/io.netty.versions.properties entry from io.netty:netty-common::jar:4.1.34.Final(compile) will be ignored. Existing file was provided by io.netty:netty-codec::jar:4.1.34.Final(compile)
> [WARNING] [io.quarkus.creator.phase.runnerjar.RunnerJarPhase] Duplicate entry META-INF/io.netty.versions.properties entry from io.netty:netty-transport::jar:4.1.34.Final(compile) will be ignored. Existing file was provided by io.netty:netty-codec::jar:4.1.34.Final(compile)

Changed files:
core/creator/src/main/java/io/quarkus/creator/phase/runnerjar/RunnerJarPhase.java

diff --git a/core/creator/src/main/java/io/quarkus/creator/phase/runnerjar/RunnerJarPhase.java b/core/creator/src/main/java/io/quarkus/creator/phase/runnerjar/RunnerJarPhase.java
index ebb7980c50b..0e0eb4d3683 100644
--- a/core/creator/src/main/java/io/quarkus/creator/phase/runnerjar/RunnerJarPhase.java
+++ b/core/creator/src/main/java/io/quarkus/creator/phase/runnerjar/RunnerJarPhase.java
@@ -77,6 +77,7 @@ public class RunnerJarPhase implements AppCreationPhase<RunnerJarPhase>, RunnerJ
             "META-INF/README.md",
             "META-INF/DEPENDENCIES",
             "META-INF/beans.xml",
+            "META-INF/io.netty.versions.properties",
             "META-INF/quarkus-config-roots.list",
             "META-INF/quarkus-javadoc.properties",
             "META-INF/quarkus-extension.properties",
Repository: quarkusio/quarkus
Issue: NPE when trying to build a maven module that has no src folder

```
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:0.19.1:build (default) on project behavior-definition: Failed to build a runnable JAR: Failed to build a runner jar: NullPointerException -> [Help 1]
```

Error handling should be improved here.

Cause: the module had no src folder structure defined

Changed files:
core/creator/src/main/java/io/quarkus/creator/phase/augment/AugmentPhase.java

diff --git a/core/creator/src/main/java/io/quarkus/creator/phase/augment/AugmentPhase.java b/core/creator/src/main/java/io/quarkus/creator/phase/augment/AugmentPhase.java
index ebef51df795..13531a254fb 100644
--- a/core/creator/src/main/java/io/quarkus/creator/phase/augment/AugmentPhase.java
+++ b/core/creator/src/main/java/io/quarkus/creator/phase/augment/AugmentPhase.java
@@ -208,10 +208,19 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
         }
         if (!Files.exists(appClassesDir)) {
             final Path appJar = appState.getAppArtifact().getPath();
-            try {
-                ZipUtils.unzip(appJar, appClassesDir);
-            } catch (IOException e) {
-                throw new AppCreatorException("Failed to unzip " + appJar, e);
+            //manage project without src directory
+            if (appJar == null) {
+                try {
+                    Files.createDirectory(appClassesDir);
+                } catch (IOException e) {
+                    throw new AppCreatorException("Failed to create classes directory " + appClassesDir, e);
+                }
+            } else {
+                try {
+                    ZipUtils.unzip(appJar, appClassesDir);
+                } catch (IOException e) {
+                    throw new AppCreatorException("Failed to unzip " + appJar, e);
+                }
             }
             final Path metaInf = appClassesDir.resolve(META_INF);
             IoUtils.recursiveDelete(metaInf.resolve("maven"));
Repository: quarkusio/quarkus
Issue: --docker-build flag seems to have no effect with Gradle plugin

Since 0.15.0 version, when buildNative gradle task is invoked it asks for GRAALVM_HOME environment variable regardless of whether it is being run with --docker-build=true or --docker-build=false

**Expected behavior**
I would expect the build to not require GRAALVM_HOME set when using docker image as a build environment


**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: **Linux localhost.localdomain 5.1.7-300.fc30.x86_64 #1 SMP Wed Jun 5 12:32:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux**
 - Output of `java -version`: **openjdk version "1.8.0_212"**
 - GraalVM version (if different from Java): **graalvm-ce-1.0.0-rc16**
 - Quarkus version or git rev: **0.16.1**


Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java

diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java
index 40fe7119d11..8ec05064312 100644
--- a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java
+++ b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusNative.java
@@ -217,9 +217,6 @@ public void setEnableCodeSizeReporting(boolean enableCodeSizeReporting) {
     @Optional
     @Input
     public String getGraalvmHome() {
-        if (graalvmHome == null || graalvmHome.length() < 1)
-            throw new GradleException(
-                    "The GRAALVM_HOME environment variable need to be set to your GraalVM root directory to use native mode");
         return graalvmHome;
     }
Repository: quarkusio/quarkus
Issue: OAuth2IdentityManager.verify(String id, Credential credential) - infinite loop

OAuth2IdentityManager.verify(String id, Credential credential) has infinite loop / recursive call.

link to code: https://github.com/quarkusio/quarkus/blob/master/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/auth/OAuth2IdentityManager.java#L31

@loicmathieu should be current `return verify(null, credential);` changed to `return verify(credential);` ?

Changed files:
extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/auth/OAuth2IdentityManager.java

diff --git a/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/auth/OAuth2IdentityManager.java b/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/auth/OAuth2IdentityManager.java
index d80f485dbc0..b876f10f978 100644
--- a/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/auth/OAuth2IdentityManager.java
+++ b/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/auth/OAuth2IdentityManager.java
@@ -29,7 +29,7 @@ public Account verify(Account account) {
 
     @Override
     public Account verify(String id, Credential credential) {
-        return verify(null, credential);
+        return null;
     }
 
     @Override
Repository: quarkusio/quarkus
Issue: Fix mvn (and others?) project create which asks a misleading question

```
$ mvn io.quarkus:quarkus-maven-plugin:0.12.0:create

Set the project groupId [org.acme.quarkus.sample]:
Set the project artifactId [my-quarkus-project]:
Set the Quarkus version [1.0-SNAPSHOT]:
```

I suppose it should be `Set the project version`


Changed files:
devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java

diff --git a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java
index 647935fd141..c34fa06ed7a 100644
--- a/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java
+++ b/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java
@@ -237,7 +237,7 @@ private void askTheUserForMissingValues() throws MojoExecutionException {
             }
 
             if (StringUtils.isBlank(projectVersion)) {
-                projectVersion = prompter.promptWithDefaultValue("Set the Quarkus version",
+                projectVersion = prompter.promptWithDefaultValue("Set the project version",
                         "1.0-SNAPSHOT");
             }
Repository: quarkusio/quarkus
Issue: Hibernate missing reflection JoinedSubclassEntityPersister definition

The hibernate-orm extension does not define a constructor reflection for the JoinedSubclassEntityPersister class.  This is required when using generic tables and class extension of entities.

Changed files:
extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmReflections.java

diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmReflections.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmReflections.java
index 753bebcd5dc..0c1e7ae669c 100644
--- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmReflections.java
+++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmReflections.java
@@ -40,6 +40,8 @@ public void registerCoreReflections(BuildProducer<ReflectiveClassBuildItem> refl
         allConstructors(reflectiveClass, org.hibernate.persister.collection.OneToManyPersister.class);
         allConstructors(reflectiveClass, org.hibernate.persister.collection.BasicCollectionPersister.class);
         simpleConstructor(reflectiveClass, org.hibernate.persister.entity.SingleTableEntityPersister.class);
+        allConstructors(reflectiveClass, org.hibernate.persister.entity.JoinedSubclassEntityPersister.class);
+        allConstructors(reflectiveClass, org.hibernate.persister.entity.UnionSubclassEntityPersister.class);
         simpleConstructor(reflectiveClass,
                 org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl.class);
         simpleConstructor(reflectiveClass, org.hibernate.id.enhanced.SequenceStyleGenerator.class);
Repository: quarkusio/quarkus
Issue: @ApplicationScoped does not work in combination with @ServerEndpoint (quick start using-websockets)

I've tried the quick start "using-websockets" and it looks like a new instance of ChatSocket class is created for every new session even though it has the @ApplicationScoped annotation. The problem is combination of the @ServerEndpoint and @ApplicationScoped annotations. When they are combined a new instance is created because of the @ServerEndpoint even though there is the @ApplicationScoped annotation.




Changed files:
extensions/undertow-websockets/deployment/src/main/java/io/quarkus/undertow/websockets/UndertowWebsocketProcessor.java

diff --git a/extensions/undertow-websockets/deployment/src/main/java/io/quarkus/undertow/websockets/UndertowWebsocketProcessor.java b/extensions/undertow-websockets/deployment/src/main/java/io/quarkus/undertow/websockets/UndertowWebsocketProcessor.java
index d10d1e7ef95..31c37879fbe 100644
--- a/extensions/undertow-websockets/deployment/src/main/java/io/quarkus/undertow/websockets/UndertowWebsocketProcessor.java
+++ b/extensions/undertow-websockets/deployment/src/main/java/io/quarkus/undertow/websockets/UndertowWebsocketProcessor.java
@@ -31,6 +31,7 @@
 import org.jboss.jandex.DotName;
 import org.jboss.jandex.IndexView;
 
+import io.quarkus.arc.deployment.BeanDefiningAnnotationBuildItem;
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.annotations.ExecutionTime;
@@ -120,4 +121,11 @@ ServiceStartBuildItem setupWorker(UndertowWebsocketTemplate template, UndertowBu
         template.setupWorker(undertow.getUndertow());
         return new ServiceStartBuildItem("Websockets");
     }
+
+    @BuildStep
+    void beanDefiningAnnotations(BuildProducer<BeanDefiningAnnotationBuildItem> annotations) {
+        annotations.produce(new BeanDefiningAnnotationBuildItem(SERVER_ENDPOINT));
+        annotations.produce(new BeanDefiningAnnotationBuildItem(ENDPOINT));
+        annotations.produce(new BeanDefiningAnnotationBuildItem(CLIENT_ENDPOINT));
+    }
 }
Repository: quarkusio/quarkus
Issue: ClassNotFoundException with Arc and generated application class

When working on the Agroal config patch, if I change the generated `DataSourceProducer` class to be a generated **application** class, I get the following error. Stuart is on it.

```
Caused by: java.lang.RuntimeException: Failed to start shamrock
    at org.jboss.shamrock.runner.ApplicationImpl1.<clinit>(Unknown Source)
    ... 34 more
Caused by: java.lang.NoClassDefFoundError: org/jboss/shamrock/agroal/runtime/DataSourceProducer
    at org.jboss.shamrock.agroal.runtime.DataSourceProducer_Bean.<init>(Unknown Source)
    at org.jboss.protean.arc.setup.Default_ComponentsProvider.getComponents(Unknown Source)
    at org.jboss.protean.arc.ArcContainerImpl.<init>(ArcContainerImpl.java:86)
    at org.jboss.protean.arc.Arc.initialize(Arc.java:34)
    at org.jboss.shamrock.arc.runtime.ArcDeploymentTemplate.getContainer(ArcDeploymentTemplate.java:41)
    at org.jboss.shamrock.deployment.steps.ArcAnnotationProcessor$build6.deploy(Unknown Source)
    ... 35 more
Caused by: java.lang.ClassNotFoundException: org.jboss.shamrock.agroal.runtime.DataSourceProducer
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
```

Changed files:
extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java

diff --git a/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java b/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java
index c95722decbb..394eb6e9300 100644
--- a/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java
+++ b/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java
@@ -138,7 +138,7 @@ public BeanContainerBuildItem build(ArcDeploymentTemplate arcTemplate, List<Bean
         for (GeneratedBeanBuildItem beanClass : generatedBeans) {
             IndexingUtil.indexClass(beanClass.getName(), indexer, beanArchiveIndex.getIndex(), additionalIndex, 
                                     ArcAnnotationProcessor.class.getClassLoader(), beanClass.getData());
-            generatedClassNames.add(DotName.createSimple(beanClass.getName()));
+            generatedClassNames.add(DotName.createSimple(beanClass.getName().replace('/', '.')));
         }
 
         CompositeIndex index = CompositeIndex.create(indexer.complete(), beanArchiveIndex.getIndex());
Repository: quarkusio/quarkus
Issue: A CDI Vertx message consumer forces eager init of Vertx and native image generation fails

`org.jboss.shamrock.vertx.VertxProcessor.build()` should be probably annotated with `@Record(ExecutionTime.RUNTIME_INIT)`.

Changed files:
extensions/vertx/deployment/src/main/java/org/jboss/shamrock/vertx/VertxProcessor.java

diff --git a/extensions/vertx/deployment/src/main/java/org/jboss/shamrock/vertx/VertxProcessor.java b/extensions/vertx/deployment/src/main/java/org/jboss/shamrock/vertx/VertxProcessor.java
index 5b6963a69be..79befd883e0 100644
--- a/extensions/vertx/deployment/src/main/java/org/jboss/shamrock/vertx/VertxProcessor.java
+++ b/extensions/vertx/deployment/src/main/java/org/jboss/shamrock/vertx/VertxProcessor.java
@@ -115,7 +115,7 @@ AdditionalBeanBuildItem registerBean() {
     }
 
     @BuildStep
-    @Record(ExecutionTime.STATIC_INIT)
+    @Record(ExecutionTime.RUNTIME_INIT)
     void build(VertxTemplate template, BeanContainerBuildItem beanContainer, BuildProducer<FeatureBuildItem> feature,
             List<EventConsumerBusinessMethodItem> messageConsumerBusinessMethods, BuildProducer<GeneratedClassBuildItem> generatedClass) {
         feature.produce(new FeatureBuildItem(FeatureBuildItem.VERTX));
Repository: quarkusio/quarkus
Issue: mvn install fails if it has already been run

After the recent changes if you run 'mvn install' twice in a row the shamrock-maven-plugin will fail with Caused by: java.nio.file.FileAlreadyExistsException: META-INF/MANIFEST.MF

Changed files:
core/creator/src/main/java/org/jboss/shamrock/creator/phase/runnerjar/RunnerJarPhase.java

diff --git a/core/creator/src/main/java/org/jboss/shamrock/creator/phase/runnerjar/RunnerJarPhase.java b/core/creator/src/main/java/org/jboss/shamrock/creator/phase/runnerjar/RunnerJarPhase.java
index 16a2bcb83c7..1715f696024 100644
--- a/core/creator/src/main/java/org/jboss/shamrock/creator/phase/runnerjar/RunnerJarPhase.java
+++ b/core/creator/src/main/java/org/jboss/shamrock/creator/phase/runnerjar/RunnerJarPhase.java
@@ -171,7 +171,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
         }
 
         runnerJar = outputDir.resolve(finalName + "-runner.jar");
-
+        IoUtils.recursiveDelete(runnerJar);
         try (FileSystem zipFs = ZipUtils.newZip(runnerJar)) {
             buildRunner(zipFs, appState, ctx.resolveOutcome(AugmentOutcome.class));
         } catch (Exception e) {
Repository: quarkusio/quarkus
Issue: shamrock:dev allows debug port 0 to be used

As the debug port can now be specified, the 0 value is allowed leading to wrong configuration as the allocated port is not retrieved

Changed files:
maven/src/main/java/org/jboss/shamrock/maven/DevMojo.java

diff --git a/maven/src/main/java/org/jboss/shamrock/maven/DevMojo.java b/maven/src/main/java/org/jboss/shamrock/maven/DevMojo.java
index cede5f0c17b..c5acb361086 100644
--- a/maven/src/main/java/org/jboss/shamrock/maven/DevMojo.java
+++ b/maven/src/main/java/org/jboss/shamrock/maven/DevMojo.java
@@ -136,6 +136,9 @@ public void execute() throws MojoFailureException {
             } else if (!debug.toLowerCase().equals("false")) {
                 try {
                     int port = Integer.parseInt(debug);
+                    if (port <= 0) {
+                        throw new MojoFailureException("The specified debug port must be greater than 0");
+                    }
                     args.add("-Xdebug");
                     args.add("-Xrunjdwp:transport=dt_socket,address=" + port + ",server=y,suspend=y");
                 } catch (NumberFormatException e) {
Repository: quarkusio/quarkus
Issue: High thread contention in org.jboss.protean.arc.RequestContext

org.jboss.protean.arc.RequestContext.activate()[1] and org.jboss.protean.arc.RequestContext.deactivate()[2] both use coarse grained locking via method synchronization.

These methods are on a hot code path, and cause a lot of thread contention under load.  For a 1min 39s sample, I have observed a total of 1hr 7min 54s of thread time blocked waiting for the sync lock. 

I am not sure of the intention of the synchronization as the currentContext is accessed in methods other than activate() and deactivate(), so is not not consistently protected. The property is also a threadLocal, so each thread should have it's own copy of the object.  

I am not sure that the synchronization is necessary, but if it is required, we need to implement a more lightweight, finer grained, locking implementation.

[1] https://github.com/protean-project/shamrock/blob/master/ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java#L95
[2] https://github.com/protean-project/shamrock/blob/master/ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java#L109

Changed files:
ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java

diff --git a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java
index 5ef92500ca6..9ae045c31c0 100644
--- a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java
+++ b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/RequestContext.java
@@ -92,7 +92,7 @@ public void destroy(Contextual<?> contextual) {
     }
 
     @Override
-    public synchronized void activate(Collection<InstanceHandle<?>> initialState) {
+    public void activate(Collection<InstanceHandle<?>> initialState) {
         Map<Contextual<?>, InstanceHandle<?>> state = new HashMap<>();
         if (initialState != null) {
             for (InstanceHandle<?> instanceHandle : initialState) {
@@ -106,7 +106,7 @@ public synchronized void activate(Collection<InstanceHandle<?>> initialState) {
     }
 
     @Override
-    public synchronized void deactivate() {
+    public void deactivate() {
         currentContext.remove();
     }
Repository: quarkusio/quarkus
Issue: Improve error message of quarkus:dev if project is empty

Creates an empty project, without any sources or resources and run:

```
mvn compile quarkus:dev
...
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:0.13.1:dev (default-cli) on project async-demo: The project has no output yet, run `mvn compile quarkus:dev`. -> [Help 1]
```

Either the error messages must be updated to mention that the project must at least contain 1 file, or it should run and waits until we have content.

Changed files:
devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java

diff --git a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
index 1ca9e72125c..3924ec3867f 100644
--- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
+++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
@@ -186,7 +186,8 @@ public void execute() throws MojoFailureException, MojoExecutionException {
         }
 
         if (!buildDir.isDirectory() || !new File(buildDir, "classes").isDirectory()) {
-            throw new MojoFailureException("The project has no output yet, run `mvn compile quarkus:dev`.");
+            throw new MojoFailureException("The project " + project.getName()
+                    + " has no output yet. Make sure it contains at least one source or resource file and then run `mvn compile quarkus:dev`.");
         }
 
         try {
Repository: quarkusio/quarkus
Issue: Dev mode compilation fails if the .m2 path has special characters

DevModeMain is not handling the encoding correctly after reading it from the the text file

Changed files:
core/devmode/src/main/java/io/quarkus/dev/ClassLoaderCompiler.java

diff --git a/core/devmode/src/main/java/io/quarkus/dev/ClassLoaderCompiler.java b/core/devmode/src/main/java/io/quarkus/dev/ClassLoaderCompiler.java
index c34b0f8642e..1160aeada2b 100644
--- a/core/devmode/src/main/java/io/quarkus/dev/ClassLoaderCompiler.java
+++ b/core/devmode/src/main/java/io/quarkus/dev/ClassLoaderCompiler.java
@@ -26,6 +26,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -77,7 +78,7 @@ public ClassLoaderCompiler(ClassLoader classLoader, File outputDirectory, List<C
         Set<String> parsedFiles = new HashSet<>();
         Deque<String> toParse = new ArrayDeque<>();
         for (URL url : urls) {
-            toParse.add(new File(url.getPath()).getAbsolutePath());
+            toParse.add(new File(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8.name())).getAbsolutePath());
         }
         Set<File> classPathElements = new HashSet<>();
         classPathElements.add(outputDirectory);
Repository: quarkusio/quarkus
Issue: Dev mode: several Vert.x worker threads detecting the change

Still with a very simple getting-started application.

I start in dev mode. I don't load anything. I go to the `src/main/java/org/acme/quickstart/GreetingResource.java` resource and remove a semi-colon to have a compilation error.

When I load the `http://localhost:8080/hello` page, I end up with several Vert.x worker threads signaling the change:
```
2019-09-04 11:13:58,811 INFO  [io.qua.dev] (vert.x-worker-thread-0) Changed source files detected, recompiling [/tmp/getting-started/src/main/java/org/acme/quickstart/GreetingResource.java]
2019-09-04 11:13:58,818 INFO  [io.qua.dev] (vert.x-worker-thread-1) Changed source files detected, recompiling [/tmp/getting-started/src/main/java/org/acme/quickstart/GreetingResource.java]
2019-09-04 11:14:04,274 INFO  [io.qua.dev] (vert.x-worker-thread-2) Changed source files detected, recompiling [/tmp/getting-started/src/main/java/org/acme/quickstart/GreetingResource.java]
2019-09-04 11:14:25,273 INFO  [io.qua.dev] (vert.x-worker-thread-3) Changed source files detected, recompiling [/tmp/getting-started/src/main/java/org/acme/quickstart/GreetingResource.java]
```

It's variable, sometimes I have 1, sometimes 2, and sometimes like in this case 4.

Changed files:
extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/devmode/VertxHotReplacementSetup.java

diff --git a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/devmode/VertxHotReplacementSetup.java b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/devmode/VertxHotReplacementSetup.java
index 9f49c32b810..416f5cd166a 100644
--- a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/devmode/VertxHotReplacementSetup.java
+++ b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/devmode/VertxHotReplacementSetup.java
@@ -47,13 +47,13 @@ public void handle(Promise<Boolean> event) {
                 boolean restart = false;
                 synchronized (this) {
                     if (nextUpdate < System.currentTimeMillis() || hotReplacementContext.isTest()) {
+                        nextUpdate = System.currentTimeMillis() + HOT_REPLACEMENT_INTERVAL;
                         try {
                             restart = hotReplacementContext.doScan(true);
                         } catch (Exception e) {
                             event.fail(new IllegalStateException("Unable to perform hot replacement scanning", e));
                             return;
                         }
-                        nextUpdate = System.currentTimeMillis() + HOT_REPLACEMENT_INTERVAL;
                     }
                 }
                 if (hotReplacementContext.getDeploymentProblem() != null) {
Repository: quarkusio/quarkus
Issue: New "Launching JVM" log line appearing in quarkus:dev

Just launched a project with `quarkus:dev` and got that one:
```
[INFO] Launching JVM with command line: /data/opt/jdk1.8.0_221/jre/bin/java -XX:TieredStopAtLevel=1 -Xverify:none -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.util.logging.manager=org.jboss.logmanager.LogManager -jar /tmp/jpa-example/target/jpa-example-dev.jar
```

I don't think it's something we want at the info level.

@gastaldi is this the one you tweaked the other day? Do you know when it was introduced and why?

Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java, devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java

diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java
index 2c58b65a06a..c4314b90dcd 100644
--- a/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java
+++ b/devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java
@@ -351,7 +351,9 @@ public void startDev() {
                     .redirectErrorStream(true)
                     .redirectInput(ProcessBuilder.Redirect.INHERIT)
                     .directory(getWorkingDir());
-            System.out.printf("Launching JVM with command line: %s%n", pb.command().stream().collect(joining(" ")));
+            if (getLogger().isDebugEnabled()) {
+                getLogger().debug("Launching JVM with command line: {}", pb.command().stream().collect(joining(" ")));
+            }
             Process p = pb.start();
             Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
                 @Override
diff --git a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
index f40b1b722d2..4243d6c1e73 100644
--- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
+++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
@@ -691,7 +691,9 @@ public Set<Path> getPomFiles() {
 
         public void run() throws Exception {
             // Display the launch command line in dev mode
-            getLog().info("Launching JVM with command line: " + args.stream().collect(joining(" ")));
+            if (getLog().isDebugEnabled()) {
+                getLog().debug("Launching JVM with command line: " + args.stream().collect(joining(" ")));
+            }
             process = new ProcessBuilder(args)
                     .inheritIO()
                     .directory(workingDir)
Repository: quarkusio/quarkus
Issue: PanacheQueryImpl.firstResult() retrieves more than one item from the database

**Describe the bug**
Reading the code of `PanacheQueryImpl.firstResult() ` it seems to retrieves more than one item from the database.

```
@Override
    public <T extends Entity> T firstResult() {
        List<T> list = list();
        jpaQuery.setMaxResults(1);
        return list.isEmpty() ? null : list.get(0);
    }
```

As the `setMaxQueryResult` is called after listing the results, it is useless and the query will be sent to the database with the previously set max result (Integer.MAX_VALUE by default)

**Expected behavior**
`firstResult()` retrieve one or zero item from the database.



**Environment (please complete the following information):**
 - Quarkus version or git rev: 1.0.0.CR1 and current master

**Additional context**
If the bug is aknowledge, I can propose a PR to fix it.


Changed files:
extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/PanacheQueryImpl.java

diff --git a/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/PanacheQueryImpl.java b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/PanacheQueryImpl.java
index 8b8cd9ce9ac..404514c3fc6 100644
--- a/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/PanacheQueryImpl.java
+++ b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/PanacheQueryImpl.java
@@ -127,8 +127,8 @@ public <T extends Entity> Stream<T> stream() {
 
     @Override
     public <T extends Entity> T firstResult() {
-        List<T> list = list();
         jpaQuery.setMaxResults(1);
+        List<T> list = jpaQuery.getResultList();
         return list.isEmpty() ? null : list.get(0);
     }
Repository: quarkusio/quarkus
Issue: Database connections are leaked in AWS Lambda

**Describe the bug**
While testing JPA with Lambda I've encountered situation when Lambda runs JPA query, which connects to database, but doesn't close connection.

**Expected behavior**
If running in Lambda it's reasonable (if possible) to close connection on lambda exit. If there is some way to use connection pool, it would be ideal.

**Actual behavior**
If I keep using Lambda, it looks like, it's reusing the same connection (same IP / connection), however, if Lambda gets "cold" AWS spawns a new one on different IP address and it get a new connection. As a result, I am observing growing number of connections on database, which will eventually lead to an issue.


**To Reproduce**
Steps to reproduce the behavior:
1. Created AWS Lambda using Maven Archetype
2. Added Entity and CrudRepository classes
3. Created class with injected repository object and `@Transactional` method
4. Used repository object to access database

**Environment (please complete the following information):**
 - Output of `java -version`: 1.8
 - Quarkus version or git rev: 1.0.1


Changed files:
extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/QuarkusStreamHandler.java

diff --git a/extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/QuarkusStreamHandler.java b/extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/QuarkusStreamHandler.java
index d9fe96653c0..1edbb680e66 100644
--- a/extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/QuarkusStreamHandler.java
+++ b/extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/QuarkusStreamHandler.java
@@ -30,7 +30,7 @@ public class QuarkusStreamHandler implements RequestStreamHandler {
                 Class appClass = Class.forName("io.quarkus.runner.ApplicationImpl");
                 String[] args = {};
                 Application app = (Application) appClass.newInstance();
-                app.start(args);
+                app.run(args);
                 errorWriter.println("Quarkus bootstrapped successfully.");
                 started = true;
             } catch (Exception ex) {
Repository: quarkusio/quarkus
Issue: with quarkus.http.root-path set to abc the swagger-ui is not available

**Describe the bug**

with quarkus.http.root-path set to abc the swagger-ui is not available

**Expected behavior**
showing the sawgger-ui by http://localhost:8080/abc/swagger-ui 

**Actual behavior**
failing with JavaScript asset not loaded exception in the browser.


**To Reproduce**
Steps to reproduce the behavior:
1. in application.propertes - set quarkus.http.root-path to abc
2. go by http://localhost:8080/abc/swagger-ui  in the browser
3. see the exception in the browser console



Changed files:
extensions/swagger-ui/deployment/src/main/java/io/quarkus/swaggerui/deployment/SwaggerUiProcessor.java

diff --git a/extensions/swagger-ui/deployment/src/main/java/io/quarkus/swaggerui/deployment/SwaggerUiProcessor.java b/extensions/swagger-ui/deployment/src/main/java/io/quarkus/swaggerui/deployment/SwaggerUiProcessor.java
index 405ad1a3f46..a0669206085 100644
--- a/extensions/swagger-ui/deployment/src/main/java/io/quarkus/swaggerui/deployment/SwaggerUiProcessor.java
+++ b/extensions/swagger-ui/deployment/src/main/java/io/quarkus/swaggerui/deployment/SwaggerUiProcessor.java
@@ -118,7 +118,8 @@ public void registerSwaggerUiServletExtension(SwaggerUiRecorder recorder,
                     throw new RuntimeException(e);
                 }
             }
-            Handler<RoutingContext> handler = recorder.handler(cached.cachedDirectory, swaggerUiConfig.path);
+            Handler<RoutingContext> handler = recorder.handler(cached.cachedDirectory,
+                    httpRootPathBuildItem.adjustPath(swaggerUiConfig.path));
             routes.produce(new RouteBuildItem(swaggerUiConfig.path, handler));
             routes.produce(new RouteBuildItem(swaggerUiConfig.path + "/*", handler));
             displayableEndpoints.produce(new NotFoundPageDisplayableEndpointBuildItem(swaggerUiConfig.path + "/"));
Repository: quarkusio/quarkus
Issue: How to set correctly ssl certificate oauth2

Hi folks,

I'm trying to use oauth2 following this guide : https://quarkus.io/guides/security-oauth2 and also https://quarkus.io/guides/native-and-ssl

In application.properties, i use for the `quarkus.oauth2.introspection-url` an **https** adress ([auth0](https://auth0.com/)).

When i execute these commands separatly : 

```
./mvnw compile quarkus:dev
./mvnw clean install -Pnative 
```

I getting this error : 
> Caused by: java.lang.IllegalArgumentException: Parameter 'sslContext' may not be null

The complete stacktrace : [error-log.txt](https://github.com/quarkusio/quarkus/files/3884061/error-log.txt)

I use graalVM, the `GRAALVM_HOME` is set and the certificate of auth0 is added to the truststore of graalVM, follwing these commands :

```
echo | openssl s_client -servername NAME -connect HOST:PORT |\\
  sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certificate.crt

/home/xerxes/graalvm-ce-19.2.1/bin/keytool -import -alias auth0 -storepass 'changeit' -keystore /home/xerxes/graalvm-ce-19.2.1/jre/lib/security/cacerts -file certificate.crt
```
I check with this command `keytool -list -v -keystore /home/xerxes/graalvm-ce-19.2.1/jre/lib/security/cacerts`, i have my certificate in there.

Could you explain me what i missed in my steps ?

I saw this option `quarkus.oauth2.ca-cert-file` but i don't know very well how to use it.

Thank you so much guys for your help !

Changed files:
extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/OAuth2Recorder.java

diff --git a/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/OAuth2Recorder.java b/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/OAuth2Recorder.java
index 6e4101c0053..023f96b3f2b 100644
--- a/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/OAuth2Recorder.java
+++ b/extensions/elytron-security-oauth2/runtime/src/main/java/io/quarkus/elytron/security/oauth2/runtime/OAuth2Recorder.java
@@ -39,6 +39,8 @@ public RuntimeValue<SecurityRealm> createRealm(OAuth2Config config)
 
         if (config.caCertFile.isPresent()) {
             validatorBuilder.useSslContext(createSSLContext(config));
+        } else {
+            validatorBuilder.useSslContext(SSLContext.getDefault());
         }
 
         OAuth2IntrospectValidator validator = validatorBuilder.build();