From b1619f485a7ff2e4da88329cae291acc7df874f9 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Mon, 27 Jul 2020 15:43:51 +1000 Subject: [PATCH] Allow each module to have its own class path Each module now contains a list of dependencies, so individual class paths are respected. Partially Fixes #10833, as this will now work when quarkus:dev is run from the root, but not when it is run from a sub folder. As we currently can't resolve the dependencies of the other project. --- .../deployment/dev/ClassLoaderCompiler.java | 200 ------------------ .../deployment/dev/DevModeCompiler.java | 168 +++++++++++++++ .../deployment/dev/DevModeContext.java | 13 +- .../deployment/dev/IDEDevModeMain.java | 23 +- .../deployment/dev/IsolatedDevModeMain.java | 4 +- .../dev/IsolatedRemoteDevModeMain.java | 5 +- .../dev/RuntimeUpdatesProcessor.java | 4 +- .../io/quarkus/gradle/tasks/QuarkusDev.java | 2 +- .../main/java/io/quarkus/maven/DevMojo.java | 32 ++- .../io/quarkus/test/QuarkusDevModeTest.java | 2 +- 10 files changed, 224 insertions(+), 229 deletions(-) delete mode 100644 core/deployment/src/main/java/io/quarkus/deployment/dev/ClassLoaderCompiler.java create mode 100644 core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCompiler.java diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassLoaderCompiler.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassLoaderCompiler.java deleted file mode 100644 index 7195bf7c3d8fb7..00000000000000 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassLoaderCompiler.java +++ /dev/null @@ -1,200 +0,0 @@ -package io.quarkus.deployment.dev; - -import java.io.Closeable; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.jar.Attributes; -import java.util.jar.JarFile; -import java.util.jar.Manifest; -import java.util.regex.Pattern; - -import org.jboss.logging.Logger; - -import io.quarkus.bootstrap.app.CuratedApplication; -import io.quarkus.bootstrap.model.AppDependency; - -/** - * Class that handles compilation of source files - * - * @author Stuart Douglas - */ -public class ClassLoaderCompiler implements Closeable { - - private static final Logger log = Logger.getLogger(ClassLoaderCompiler.class); - private static final Pattern WHITESPACE_PATTERN = Pattern.compile(" "); - - private final List compilationProviders; - /** - * map of compilation contexts to source directories - */ - private final Map compilationContexts = new HashMap<>(); - private final Set allHandledExtensions; - - public ClassLoaderCompiler(ClassLoader classLoader, - CuratedApplication application, - List compilationProviders, - DevModeContext context) - throws IOException { - this.compilationProviders = compilationProviders; - - Set urls = new HashSet<>(); - for (AppDependency i : application.getAppModel().getUserDependencies()) { - for (Path p : i.getArtifact().getPaths()) { - urls.add(p.toUri().toURL()); - } - } - - Set parsedFiles = new HashSet<>(); - Deque toParse = new ArrayDeque<>(); - for (URL url : urls) { - toParse.add(new File(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8.name())).getAbsolutePath()); - } - Set classPathElements = new HashSet<>(); - for (DevModeContext.ModuleInfo i : context.getAllModules()) { - if (i.getClassesPath() != null) { - classPathElements.add(new File(i.getClassesPath())); - } - } - final String devModeRunnerJarCanonicalPath = context.getDevModeRunnerJarFile() == null - ? null - : context.getDevModeRunnerJarFile().getCanonicalPath(); - while (!toParse.isEmpty()) { - String s = toParse.poll(); - if (!parsedFiles.contains(s)) { - parsedFiles.add(s); - File file = new File(s); - if (!file.exists()) { - continue; - } - if (file.isDirectory()) { - classPathElements.add(file); - } else if (file.getName().endsWith(".jar")) { - // skip adding the dev mode runner jar to the classpath to prevent - // hitting a bug in JDK - https://bugs.openjdk.java.net/browse/JDK-8232170 - // which causes the programmatic java file compilation to fail. - // see details in https://github.com/quarkusio/quarkus/issues/3592. - // we anyway don't need to add that jar to the hot deployment classpath since the - // current running JVM is already launched using that jar, plus it doesn't - // have any application resources/classes. The Class-Path jar(s) contained - // in the MANIFEST.MF of that dev mode runner jar are anyway added explicitly - // in various different ways in this very own ClassLoaderCompiler class, so - // not passing this jar to the JDK's compiler won't prevent its Class-Path - // references from being part of the hot deployment compile classpath. - if (devModeRunnerJarCanonicalPath != null - && file.getCanonicalPath().equals(devModeRunnerJarCanonicalPath)) { - log.debug("Dev mode runner jar " + file + " won't be added to compilation classpath of hot deployment"); - } else { - classPathElements.add(file); - } - if (!file.isDirectory() && file.getName().endsWith(".jar")) { - try (JarFile jar = new JarFile(file)) { - Manifest mf = jar.getManifest(); - if (mf == null || mf.getMainAttributes() == null) { - continue; - } - Object classPath = mf.getMainAttributes().get(Attributes.Name.CLASS_PATH); - if (classPath != null) { - for (String classPathEntry : WHITESPACE_PATTERN.split(classPath.toString())) { - final URI cpEntryURI = new URI(classPathEntry); - File f; - // if it's a "file" scheme URI, then use the path as a file system path - // without the need to resolve it - if (cpEntryURI.isAbsolute() && cpEntryURI.getScheme().equals("file")) { - f = new File(cpEntryURI.getPath()); - } else { - try { - f = Paths.get(new URI("file", null, "/", null).resolve(cpEntryURI)).toFile(); - } catch (URISyntaxException e) { - f = new File(file.getParentFile(), classPathEntry); - } - } - if (f.exists()) { - toParse.add(f.getAbsolutePath()); - } - } - } - } catch (Exception e) { - throw new RuntimeException("Failed to open class path file " + file, e); - } - } - } - } - } - for (DevModeContext.ModuleInfo i : context.getAllModules()) { - if (!i.getSourcePaths().isEmpty()) { - if (i.getClassesPath() == null) { - log.warn("No classes directory found for module '" + i.getName() - + "'. It is advised that this module be compiled before launching dev mode"); - continue; - } - i.getSourcePaths().forEach(sourcePath -> { - this.compilationContexts.put(sourcePath, - new CompilationProvider.Context( - i.getName(), - classPathElements, - new File(i.getProjectDirectory()), - new File(sourcePath), - new File(i.getClassesPath()), - context.getSourceEncoding(), - context.getCompilerOptions(), - context.getSourceJavaVersion(), - context.getTargetJvmVersion(), - context.getCompilerPluginArtifacts(), - context.getCompilerPluginsOptions())); - }); - } - } - this.allHandledExtensions = new HashSet<>(); - for (CompilationProvider compilationProvider : compilationProviders) { - allHandledExtensions.addAll(compilationProvider.handledExtensions()); - } - } - - public Set allHandledExtensions() { - return allHandledExtensions; - } - - public void compile(String sourceDir, Map> extensionToChangedFiles) { - CompilationProvider.Context compilationContext = compilationContexts.get(sourceDir); - for (String extension : extensionToChangedFiles.keySet()) { - for (CompilationProvider compilationProvider : compilationProviders) { - if (compilationProvider.handledExtensions().contains(extension)) { - compilationProvider.compile(extensionToChangedFiles.get(extension), compilationContext); - break; - } - } - } - } - - public Path findSourcePath(Path classFilePath, Set sourcePaths, String classesPath) { - for (CompilationProvider compilationProvider : compilationProviders) { - Path sourcePath = compilationProvider.getSourcePath(classFilePath, sourcePaths, classesPath); - - if (sourcePath != null) { - return sourcePath; - } - } - return null; - } - - @Override - public void close() throws IOException { - for (CompilationProvider i : compilationProviders) { - i.close(); - } - } -} diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCompiler.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCompiler.java new file mode 100644 index 00000000000000..04babb08ce8dc1 --- /dev/null +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCompiler.java @@ -0,0 +1,168 @@ +package io.quarkus.deployment.dev; + +import java.io.Closeable; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.jboss.logging.Logger; + +import io.quarkus.bootstrap.app.CuratedApplication; +import io.quarkus.bootstrap.model.AppArtifact; +import io.quarkus.bootstrap.model.AppDependency; + +/** + * Class that handles compilation of source files + * + * @author Stuart Douglas + */ +public class DevModeCompiler implements Closeable { + + private static final Logger log = Logger.getLogger(DevModeCompiler.class); + private static final Pattern WHITESPACE_PATTERN = Pattern.compile(" "); + + private final List compilationProviders; + /** + * map of compilation contexts to source directories + */ + private final Map compilationContexts = new HashMap<>(); + private final Set allHandledExtensions; + + public DevModeCompiler(CuratedApplication application, + List compilationProviders, + DevModeContext context) + throws IOException { + this.compilationProviders = compilationProviders; + + for (DevModeContext.ModuleInfo i : context.getAllModules()) { + if (!i.getSourcePaths().isEmpty()) { + if (i.getClassesPath() == null) { + log.warn("No classes directory found for module '" + i.getName() + + "'. It is advised that this module be compiled before launching dev mode"); + continue; + } + + Set urls = new HashSet<>(); + List dependencies = i.getDependencies(); + if (dependencies == null) { + dependencies = application.getAppModel().getUserDependencies().stream().map(AppDependency::getArtifact) + .collect(Collectors.toList()); + } + for (AppArtifact ad : dependencies) { + for (Path p : ad.getPaths()) { + urls.add(p.toUri().toURL()); + } + } + + Set parsedFiles = new HashSet<>(); + List toParse = new ArrayList<>(); + for (URL url : urls) { + toParse.add(new File(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8.name())).getAbsolutePath()); + } + Set classPathElements = new HashSet<>(); + if (i.getClassesPath() != null) { + classPathElements.add(new File(i.getClassesPath())); + } + final String devModeRunnerJarCanonicalPath = context.getDevModeRunnerJarFile() == null + ? null + : context.getDevModeRunnerJarFile().getCanonicalPath(); + for (String s : toParse) { + if (!parsedFiles.contains(s)) { + parsedFiles.add(s); + File file = new File(s); + if (!file.exists()) { + continue; + } + if (file.isDirectory()) { + classPathElements.add(file); + } else if (file.getName().endsWith(".jar")) { + // skip adding the dev mode runner jar to the classpath to prevent + // hitting a bug in JDK - https://bugs.openjdk.java.net/browse/JDK-8232170 + // which causes the programmatic java file compilation to fail. + // see details in https://github.com/quarkusio/quarkus/issues/3592. + // we anyway don't need to add that jar to the hot deployment classpath since the + // current running JVM is already launched using that jar, plus it doesn't + // have any application resources/classes. The Class-Path jar(s) contained + // in the MANIFEST.MF of that dev mode runner jar are anyway added explicitly + // in various different ways in this very own ClassLoaderCompiler class, so + // not passing this jar to the JDK's compiler won't prevent its Class-Path + // references from being part of the hot deployment compile classpath. + if (devModeRunnerJarCanonicalPath != null + && file.getCanonicalPath().equals(devModeRunnerJarCanonicalPath)) { + log.debug("Dev mode runner jar " + file + + " won't be added to compilation classpath of hot deployment"); + } else { + classPathElements.add(file); + } + } + } + } + + i.getSourcePaths().forEach(sourcePath -> { + this.compilationContexts.put(sourcePath, + new CompilationProvider.Context( + i.getName(), + classPathElements, + new File(i.getProjectDirectory()), + new File(sourcePath), + new File(i.getClassesPath()), + context.getSourceEncoding(), + context.getCompilerOptions(), + context.getSourceJavaVersion(), + context.getTargetJvmVersion(), + context.getCompilerPluginArtifacts(), + context.getCompilerPluginsOptions())); + }); + } + } + this.allHandledExtensions = new HashSet<>(); + for (CompilationProvider compilationProvider : compilationProviders) { + allHandledExtensions.addAll(compilationProvider.handledExtensions()); + } + } + + public Set allHandledExtensions() { + return allHandledExtensions; + } + + public void compile(String sourceDir, Map> extensionToChangedFiles) { + CompilationProvider.Context compilationContext = compilationContexts.get(sourceDir); + for (String extension : extensionToChangedFiles.keySet()) { + for (CompilationProvider compilationProvider : compilationProviders) { + if (compilationProvider.handledExtensions().contains(extension)) { + compilationProvider.compile(extensionToChangedFiles.get(extension), compilationContext); + break; + } + } + } + } + + public Path findSourcePath(Path classFilePath, Set sourcePaths, String classesPath) { + for (CompilationProvider compilationProvider : compilationProviders) { + Path sourcePath = compilationProvider.getSourcePath(classFilePath, sourcePaths, classesPath); + + if (sourcePath != null) { + return sourcePath; + } + } + return null; + } + + @Override + public void close() throws IOException { + for (CompilationProvider i : compilationProviders) { + i.close(); + } + } +} diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java index 629c75a07be447..a686d0943f27ee 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeContext.java @@ -15,6 +15,7 @@ import java.util.Set; import io.quarkus.bootstrap.app.QuarkusBootstrap; +import io.quarkus.bootstrap.model.AppArtifact; import io.quarkus.bootstrap.model.AppArtifactKey; /** @@ -235,6 +236,7 @@ public static class ModuleInfo implements Serializable { private final String preBuildOutputDir; private final Set sourceParents; private final String targetDir; + private final List dependencies; public ModuleInfo(AppArtifactKey appArtifactKey, String name, @@ -244,10 +246,10 @@ public ModuleInfo(AppArtifactKey appArtifactKey, String resourcePath, String sourceParent, String preBuildOutputDir, - String targetDir) { + String targetDir, List dependencies) { this(appArtifactKey, name, projectDirectory, sourcePaths, classesPath, resourcePath, classesPath, Collections.singleton(sourceParent), - preBuildOutputDir, targetDir); + preBuildOutputDir, targetDir, dependencies); } public ModuleInfo( @@ -259,7 +261,7 @@ public ModuleInfo( String resourceOutputPath, Set sourceParents, String preBuildOutputDir, - String targetDir) { + String targetDir, List dependencies) { this.appArtifactKey = appArtifactKey; this.name = name; this.projectDirectory = projectDirectory; @@ -270,6 +272,7 @@ public ModuleInfo( this.sourceParents = sourceParents; this.preBuildOutputDir = preBuildOutputDir; this.targetDir = targetDir; + this.dependencies = dependencies; } public String getName() { @@ -314,6 +317,10 @@ public String getTargetDir() { return targetDir; } + public List getDependencies() { + return dependencies; + } + public AppArtifactKey getAppArtifactKey() { return appArtifactKey; } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IDEDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IDEDevModeMain.java index 154e76d3cf1bbe..734d24be990732 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IDEDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IDEDevModeMain.java @@ -7,12 +7,14 @@ import java.util.Map; import java.util.Set; import java.util.function.BiConsumer; +import java.util.stream.Collectors; import org.jboss.logging.Logger; import io.quarkus.bootstrap.BootstrapGradleException; import io.quarkus.bootstrap.app.CuratedApplication; import io.quarkus.bootstrap.model.AppArtifactKey; +import io.quarkus.bootstrap.model.AppDependency; import io.quarkus.bootstrap.resolver.AppModelResolverException; import io.quarkus.bootstrap.resolver.QuarkusGradleModelFactory; import io.quarkus.bootstrap.resolver.maven.workspace.LocalProject; @@ -34,13 +36,13 @@ public void accept(CuratedApplication curatedApplication, Map st try { if (BuildToolHelper.isMavenProject(appClasses)) { LocalProject project = LocalProject.loadWorkspace(appClasses); - DevModeContext.ModuleInfo root = toModule(project); + DevModeContext.ModuleInfo root = toModule(project, curatedApplication); devModeContext.setApplicationRoot(root); for (Map.Entry module : project.getWorkspace().getProjects().entrySet()) { if (module.getKey().equals(project.getKey())) { continue; } - devModeContext.getAdditionalModules().add(toModule(module.getValue())); + devModeContext.getAdditionalModules().add(toModule(module.getValue(), curatedApplication)); } } else { // TODO find a way to reuse the previously model instead of building a new one. @@ -48,11 +50,11 @@ public void accept(CuratedApplication curatedApplication, Map st BuildToolHelper.getBuildFile(appClasses, BuildToolHelper.BuildTool.GRADLE).toFile(), QuarkusModelHelper.DEVMODE_REQUIRED_TASKS); final WorkspaceModule launchingModule = quarkusModel.getWorkspace().getMainModule(); - DevModeContext.ModuleInfo root = toModule(quarkusModel.getWorkspace().getMainModule()); + DevModeContext.ModuleInfo root = toModule(quarkusModel.getWorkspace().getMainModule(), curatedApplication); devModeContext.setApplicationRoot(root); for (WorkspaceModule additionalModule : quarkusModel.getWorkspace().getAllModules()) { if (!additionalModule.getArtifactCoords().equals(launchingModule.getArtifactCoords())) { - devModeContext.getAdditionalModules().add(toModule(additionalModule)); + devModeContext.getAdditionalModules().add(toModule(additionalModule, curatedApplication)); } } } @@ -65,7 +67,8 @@ public void accept(CuratedApplication curatedApplication, Map st Collections.singletonMap(DevModeContext.class.getName(), devModeContext)); } - private DevModeContext.ModuleInfo toModule(WorkspaceModule module) throws BootstrapGradleException { + private DevModeContext.ModuleInfo toModule(WorkspaceModule module, CuratedApplication application) + throws BootstrapGradleException { AppArtifactKey key = new AppArtifactKey(module.getArtifactCoords().getGroupId(), module.getArtifactCoords().getArtifactId(), module.getArtifactCoords().getClassifier()); @@ -85,10 +88,12 @@ private DevModeContext.ModuleInfo toModule(WorkspaceModule module) throws Bootst module.getSourceSet().getResourceDirectory().getPath(), sourceParents, module.getBuildDir().toPath().resolve("generated-sources").toAbsolutePath().toString(), - module.getBuildDir().toString()); + module.getBuildDir().toString(), + application.getAppModel().getUserDependencies().stream().map(AppDependency::getArtifact) + .collect(Collectors.toList())); } - private DevModeContext.ModuleInfo toModule(LocalProject project) { + private DevModeContext.ModuleInfo toModule(LocalProject project, CuratedApplication application) { return new DevModeContext.ModuleInfo(project.getKey(), project.getArtifactId(), project.getDir().toAbsolutePath().toString(), Collections.singleton(project.getSourcesSourcesDir().toAbsolutePath().toString()), @@ -96,6 +101,8 @@ private DevModeContext.ModuleInfo toModule(LocalProject project) { project.getResourcesSourcesDir().toAbsolutePath().toString(), project.getSourcesDir().toString(), project.getCodeGenOutputDir().toString(), - project.getOutputDir().toString()); + project.getOutputDir().toString(), + application.getAppModel().getUserDependencies().stream().map(AppDependency::getArtifact) + .collect(Collectors.toList())); //TODO: how can we resolve the per module class path? } } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java index 9cb72286042ad4..635ed60167c20b 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java @@ -192,9 +192,9 @@ private RuntimeUpdatesProcessor setupRuntimeCompilation(DevModeContext context, compilationProviders.add(provider); context.getAllModules().forEach(moduleInfo -> moduleInfo.addSourcePaths(provider.handledSourcePaths())); } - ClassLoaderCompiler compiler; + DevModeCompiler compiler; try { - compiler = new ClassLoaderCompiler(Thread.currentThread().getContextClassLoader(), curatedApplication, + compiler = new DevModeCompiler(curatedApplication, compilationProviders, context); } catch (Exception e) { log.error("Failed to create compiler, runtime compilation will be unavailable", e); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java index bd598701aa60e0..c9c3032a513db7 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedRemoteDevModeMain.java @@ -113,10 +113,9 @@ private RuntimeUpdatesProcessor setupRuntimeCompilation(DevModeContext context, compilationProviders.add(provider); context.getAllModules().forEach(moduleInfo -> moduleInfo.addSourcePaths(provider.handledSourcePaths())); } - ClassLoaderCompiler compiler; + DevModeCompiler compiler; try { - compiler = new ClassLoaderCompiler(Thread.currentThread().getContextClassLoader(), curatedApplication, - compilationProviders, context); + compiler = new DevModeCompiler(curatedApplication, compilationProviders, context); } catch (Exception e) { log.error("Failed to create compiler, runtime compilation will be unavailable", e); return null; diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java index e7b1e393417d63..c297c0bfb03456 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java @@ -45,7 +45,7 @@ public class RuntimeUpdatesProcessor implements HotReplacementContext, Closeable private final Path applicationRoot; private final DevModeContext context; - private final ClassLoaderCompiler compiler; + private final DevModeCompiler compiler; volatile Throwable compileProblem; // file path -> isRestartNeeded @@ -77,7 +77,7 @@ public class RuntimeUpdatesProcessor implements HotReplacementContext, Closeable private final Consumer> restartCallback; private final BiConsumer copyResourceNotification; - public RuntimeUpdatesProcessor(Path applicationRoot, DevModeContext context, ClassLoaderCompiler compiler, + public RuntimeUpdatesProcessor(Path applicationRoot, DevModeContext context, DevModeCompiler compiler, Consumer> restartCallback, BiConsumer copyResourceNotification) { this.applicationRoot = applicationRoot; this.context = context; 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 a878eb3d765199..942dee3faac96f 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 @@ -460,7 +460,7 @@ private void addLocalProject(Project project, DevModeContext context, Set() { + @Override + public AppArtifact apply(Artifact artifact) { + AppArtifact appArtifact = new AppArtifact(artifact.getGroupId(), artifact.getArtifactId(), + artifact.getClassifier(), artifact.getType(), artifact.getVersion()); + appArtifact.setPath(artifact.getFile().toPath()); + return appArtifact; + } + }).collect(Collectors.toList())); if (root) { devModeContext.setApplicationRoot(moduleInfo); } else { diff --git a/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusDevModeTest.java b/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusDevModeTest.java index dbf057bcb06921..b5bd2abf416e86 100644 --- a/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusDevModeTest.java +++ b/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusDevModeTest.java @@ -284,7 +284,7 @@ private DevModeContext exportArchive(Path deploymentDir, Path testSourceDir, Pat classes.toAbsolutePath().toString(), deploymentResourcePath.toAbsolutePath().toString(), deploymentSourceParentPath.toAbsolutePath().toString(), targetDir.resolve("generated-sources").toAbsolutePath().toString(), - targetDir.toAbsolutePath().toString())); + targetDir.toAbsolutePath().toString(), null)); setDevModeRunnerJarFile(context); return context;