Skip to content

Commit

Permalink
Incubating Maven resolver: do not load the workspace when the origina…
Browse files Browse the repository at this point in the history
…l resolver isn't aware of it
  • Loading branch information
Alexey Loubyansky committed Nov 23, 2024
1 parent 5e9bef3 commit 9e5dc13
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import io.quarkus.maven.dependency.DependencyFlags;
import io.quarkus.maven.dependency.ResolvedDependencyBuilder;
import io.quarkus.paths.PathTree;
import io.quarkus.paths.PathVisit;

public class ApplicationDependencyTreeResolver {

Expand Down Expand Up @@ -583,23 +584,30 @@ private ExtensionInfo getExtensionInfoOrNull(Artifact artifact, List<RemoteRepos

artifact = resolve(artifact, repos);
final Path path = artifact.getFile().toPath();
final Properties descriptor = PathTree.ofDirectoryOrArchive(path).apply(BootstrapConstants.DESCRIPTOR_PATH, visit -> {
if (visit == null) {
return null;
}
try {
return readDescriptor(visit.getPath());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
});
final Properties descriptor = PathTree.ofDirectoryOrArchive(path).apply(BootstrapConstants.DESCRIPTOR_PATH,
ApplicationDependencyTreeResolver::readExtensionProperties);
if (descriptor != null) {
ext = new ExtensionInfo(artifact, descriptor, devMode);
allExtensions.put(extKey, ext);
}
return ext;
}

private static Properties readExtensionProperties(PathVisit visit) {
if (visit == null) {
return null;
}
try {
final Properties rtProps = new Properties();
try (BufferedReader reader = Files.newBufferedReader(visit.getPath())) {
rtProps.load(reader);
}
return rtProps;
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}

private void injectDeploymentDependencies(ExtensionDependency extDep)
throws BootstrapDependencyProcessingException {
log.debugf("Injecting deployment dependency %s", extDep.info.deploymentArtifact);
Expand Down Expand Up @@ -719,14 +727,6 @@ private void clearWalkingFlag(byte flag) {
}
}

private static Properties readDescriptor(Path path) throws IOException {
final Properties rtProps = new Properties();
try (BufferedReader reader = Files.newBufferedReader(path)) {
rtProps.load(reader);
}
return rtProps;
}

private static class ExtensionDependency {

static ExtensionDependency get(DependencyNode node) {
Expand Down
Loading

0 comments on commit 9e5dc13

Please sign in to comment.