Skip to content

Commit

Permalink
Fix vertx failures in the maven plugin (#5685)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaTP authored Dec 9, 2024
1 parent 9db4169 commit f743143
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import io.apicurio.registry.types.ContentTypes;
import io.kiota.http.vertx.VertXRequestAdapter;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.file.FileSystemOptions;
import io.vertx.ext.web.client.WebClient;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
Expand Down Expand Up @@ -43,6 +45,15 @@ public abstract class AbstractRegistryMojo extends AbstractMojo {
@Parameter(property = "password")
String password;

protected Vertx createVertx() {
var options = new VertxOptions();
var fsOpts = new FileSystemOptions();
fsOpts.setFileCachingEnabled(false);
fsOpts.setClassPathResolvingEnabled(false);
options.setFileSystemOptions(fsOpts);
return Vertx.vertx(options);
}

protected RegistryClient createClient(Vertx vertx) {
WebClient provider = null;
if (authServerUrl != null && clientId != null && clientSecret != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected void validate() throws MojoExecutionException {
protected void executeInternal() throws MojoExecutionException, ExecutionException, InterruptedException {
validate();

Vertx vertx = Vertx.vertx();
Vertx vertx = createVertx();
RegistryClient registryClient = createClient(vertx);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected boolean validate() throws MojoExecutionException {
protected void executeInternal() throws MojoExecutionException {
int errorCount = 0;
if (validate()) {
Vertx vertx = Vertx.vertx();
Vertx vertx = createVertx();
RegistryClient registryClient = createClient(vertx);

for (RegisterArtifact artifact : artifacts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected void validate() throws MojoExecutionException {
@Override
protected void executeInternal() throws MojoExecutionException {
validate();
Vertx vertx = Vertx.vertx();
Vertx vertx = createVertx();
RegistryClient registryClient = createClient(vertx);

try {
Expand Down

0 comments on commit f743143

Please sign in to comment.