Repository: quarkusio/quarkus
Issue: quarkusDev doesn't work in multi module gradle project

**Describe the bug**
If using a multi module gradle project quarkusDev will fail complaining that beans are defined multiple times. This is due to both common/buld/classes and common/buld/lib/common.jar being on the classpath inside of dev-mode-context.dat

Project Structure
```
project-root
... common
... app
```
App depends on common via 
```
compile project(":commons")
```

The error that happens is

```        Suppressed: javax.enterprise.inject.AmbiguousResolutionException: Ambiguous dependencies for type commons.CommonsConfig and qualifiers [@Default]
        - java member: commons.cache.impl.CacheServiceImpl#config
        - declared on CLASS bean [types=[commons.cache.CacheService, commons.cache.impl.CacheServiceImpl, java.lang.Object], qualifiers=[@Default, @Any], target=commons.cache.impl.CacheServiceImpl]
        - available beans:
                - CLASS bean [types=[commons.CommonsConfig, java.lang.Object], qualifiers=[@Default, @Any], target=commons.CommonsConfig]
                - CLASS bean [types=[commons.CommonsConfig, java.lang.Object], qualifiers=[@Default, @Any], target=commons.CommonsConfig]
```

Inside META-INF/dev-mode-context.dat
```
commons/build/classes/java/main
commons/build/libs/commons-v383-1-gf5b4d8a.dirty.jar
```

**Expected behavior**
QuarkusDev should start without issues

**Actual behavior**
QuarkusDev fails due to AmbiguousResolutionException



**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: Darwin Kernel Version 19.0.0
 - Output of `java -version`:  OpenJDK 64-Bit GraalVM CE 19.2.1 (build 25.232-b07-jvmci-19.2-b03, mixed mode)
 - GraalVM version (if different from Java): 
 - Quarkus version or git rev: 1.1.0.FINAL




Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.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 d5984ab07fc..ab99d14206f 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
@@ -52,6 +52,7 @@
 import org.gradle.api.tasks.options.Option;
 
 import io.quarkus.bootstrap.model.AppArtifact;
+import io.quarkus.bootstrap.model.AppArtifactKey;
 import io.quarkus.bootstrap.model.AppDependency;
 import io.quarkus.bootstrap.model.AppModel;
 import io.quarkus.bootstrap.resolver.AppModelResolver;
@@ -241,22 +242,13 @@ public void startDev() {
                 throw new GradleException("Failed to resolve application model " + extension.getAppArtifact() + " dependencies",
                         e);
             }
-            for (AppDependency appDep : appModel.getAllDependencies()) {
-                addToClassPaths(classPathManifest, context, appDep.getArtifact().getPath().toFile());
-            }
 
             args.add("-Djava.util.logging.manager=org.jboss.logmanager.LogManager");
             File wiringClassesDirectory = new File(getBuildDir(), "wiring-classes");
             wiringClassesDirectory.mkdirs();
             addToClassPaths(classPathManifest, context, wiringClassesDirectory);
 
-            //we also want to add the maven plugin jar to the class path
-            //this allows us to just directly use classes, without messing around copying them
-            //to the runner jar
-            addGradlePluginDeps(classPathManifest, context);
-
             //now we need to build a temporary jar to actually run
-
             File tempFile = new File(getBuildDir(), extension.finalName() + "-dev.jar");
             tempFile.delete();
             tempFile.deleteOnExit();
@@ -271,6 +263,7 @@ public void startDev() {
                 res = file.getAbsolutePath();
             }
 
+            final Set<AppArtifactKey> projectDependencies = new HashSet<>();
             final Configuration compileCp = project.getConfigurations()
                     .getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME);
             final DependencySet compileCpDependencies = compileCp.getAllDependencies();
@@ -280,6 +273,11 @@ public void startDev() {
                     continue;
                 }
 
+                // Create the key via AppArtifact to make sure we use same defaults for type and classifier
+                AppArtifactKey key = new AppArtifact(dependency.getGroup(), dependency.getName(), dependency.getVersion())
+                        .getKey();
+                projectDependencies.add(key);
+
                 Project dependencyProject = ((ProjectDependency) dependency).getDependencyProject();
                 Convention convention = dependencyProject.getConvention();
                 JavaPluginConvention javaConvention = convention.findPlugin(JavaPluginConvention.class);
@@ -308,6 +306,17 @@ public void startDev() {
                 context.getModules().add(wsModuleInfo);
             }
 
+            for (AppDependency appDependency : appModel.getAllDependencies()) {
+                if (!projectDependencies.contains(appDependency.getArtifact().getKey())) {
+                    addToClassPaths(classPathManifest, context, appDependency.getArtifact().getPath().toFile());
+                }
+            }
+
+            //we also want to add the maven plugin jar to the class path
+            //this allows us to just directly use classes, without messing around copying them
+            //to the runner jar
+            addGradlePluginDeps(classPathManifest, context);
+
             DevModeContext.ModuleInfo moduleInfo = new DevModeContext.ModuleInfo(
                     project.getName(),
                     project.getProjectDir().getAbsolutePath(),