-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhanced extension dependency validation during the extension descrip…
…tor generation
- Loading branch information
1 parent
588e277
commit ca1a66b
Showing
3 changed files
with
386 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...cts/bootstrap/maven-plugin/src/main/java/io/quarkus/maven/BootstrapWorkspaceProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
Oops, something went wrong.