Skip to content

Commit

Permalink
Enhanced extension dependency validation during the extension descrip…
Browse files Browse the repository at this point in the history
…tor generation
  • Loading branch information
aloubyansky committed Feb 25, 2021
1 parent 588e277 commit ca1a66b
Show file tree
Hide file tree
Showing 3 changed files with 386 additions and 96 deletions.
21 changes: 21 additions & 0 deletions independent-projects/bootstrap/maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>2.1.0</version>
<configuration>
<staticMetadataDirectory>${basedir}/target/filtered-resources/META-INF/plexus</staticMetadataDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>generate-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
Expand All @@ -41,6 +56,12 @@
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-core</artifactId>
<exclusions>
<exclusion>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-gradle-resolver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package io.quarkus.maven;

import io.quarkus.bootstrap.resolver.maven.BootstrapMavenException;
import io.quarkus.bootstrap.resolver.maven.workspace.LocalProject;
import io.quarkus.bootstrap.resolver.maven.workspace.LocalWorkspace;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.codehaus.plexus.component.annotations.Component;

@Component(role = BootstrapWorkspaceProvider.class, instantiationStrategy = "singleton")
public class BootstrapWorkspaceProvider {

private final Path base;
private boolean loaded;
private LocalProject origin;

public BootstrapWorkspaceProvider() {
// load the workspace lazily on request, in case the component is injected but the logic using it is skipped
base = Paths.get("").normalize().toAbsolutePath();
}

public LocalProject origin() {
if (!loaded) {
try {
origin = LocalProject.loadWorkspace(base);
} catch (BootstrapMavenException e) {
}
loaded = true;
}
return origin;
}

public LocalWorkspace workspace() {
return origin().getWorkspace();
}
}
Loading

0 comments on commit ca1a66b

Please sign in to comment.