Skip to content

Commit

Permalink
Merge pull request #17142 from aloubyansky/extension-deps-metadata-fix
Browse files Browse the repository at this point in the history
Extension metadata: support local dependencies assembled with plugins instead of built from sources
  • Loading branch information
aloubyansky authored May 11, 2021
2 parents 8ee03f2 + 531cfa8 commit d0bc76a
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext;
import io.quarkus.bootstrap.resolver.maven.BootstrapMavenException;
import io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver;
import io.quarkus.bootstrap.resolver.maven.workspace.LocalWorkspace;
import io.quarkus.bootstrap.util.DependencyNodeUtils;
import io.quarkus.maven.capabilities.CapabilityConfig;
import java.io.BufferedReader;
Expand Down Expand Up @@ -503,11 +504,21 @@ private void addExtensionDependencies(ObjectNode extObject) throws MojoExecution
public boolean visitEnter(DependencyNode node) {
final org.eclipse.aether.artifact.Artifact a = node.getArtifact();
if (a != null && a.getFile() != null && a.getExtension().equals("jar")) {
final Path p = a.getFile().toPath();
Path p = a.getFile().toPath();
boolean isExtension = false;
if (Files.isDirectory(p)) {
isExtension = getExtensionDescriptorOrNull(p) != null;
} else {
// in some cases a local dependency might not producing the classes directory
// but assembling the JAR directly using maven plugins
if (!Files.exists(p)) {
final Path workspaceJar = p.getParent().resolve(LocalWorkspace.getFileName(a));
if (!Files.exists(workspaceJar)) {
getLog().warn("Failed to resolve " + a + ", " + p + " does not exist");
return true;
}
p = workspaceJar;
}
try (FileSystem fs = FileSystems.newFileSystem(p, (ClassLoader) null)) {
isExtension = getExtensionDescriptorOrNull(fs.getPath("")) != null;
} catch (IOException e) {
Expand Down

0 comments on commit d0bc76a

Please sign in to comment.