quarkus: Error during the Maven build process with Quarkus: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for null

I’m trying to use Quarkus in a project of the company that I’m working on.

That’s my scenario:

The company that I’m working on has an on-premises environment with a CI server and an Artifactory that provides the all required artifacts. The CI has no grant access to reach out to the internet then the Artifactory server is responsible for bringing all external artifacts. We’ve got a lot of spring-boot applications that are built with the same CI… so I’m assuming that both, our CI and Artifactory, they’re configured properly.

Here’s my issue:

Our CI server has executed “mvn package” command and it’s showing this following error, but this error is happening during the test phase:

[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Running myproject.resources.HelloResourceTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 127.996 s <<< FAILURE! - in myproject.resources.HelloResourceTest
[ERROR] myproject.resources.HelloResourceTest.testHelloEndpoint  Time elapsed: 0.016 s  <<< ERROR!
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   HelloResourceTest.testHelloEndpoint » Runtime io.quarkus.bootstrap.BootstrapEx...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myproject.............. ............................ FAILURE [02:29 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:41 min
[INFO] Finished at: 2020-08-17T18:38:56Z
[INFO] ------------------------------------------------------------------------

But there’s no special thing happening the target class of the test:

package myproject.resources;

import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
public class HelloResourceTest {

    @Test
    public void testHelloEndpoint() {
        given()
          .when().get("/hello")
          .then()
             .statusCode(200)
             .body(is("Ops!"));
    }

}

Here’s the implementation of the target Resource:

package myproject.resources;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class HelloResource {

    private static final Logger LOG = Logger.getLogger(HelloResource.class);

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
       return "Ops!";
    }
}

Then I’ve executed ‘mvn package -e -X’ and I caught this exception message:

    java.lang.RuntimeException
    java.lang.RuntimeException: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for null
    Cased by: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for null
    Caused by: java.lang.RuntimeException: Failed to create application model resolver for /home/dearrudam/myproject
    Caused by: io.quarkus.bootstrap.resolver.maven.BootstrapMavenException: Failed to read artifact descriptor for myproject:myproject:pom:1.0-SNAPSHOT
    Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for myproject:myproject:pom:1.0-SNAPSHOT
    Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.7.0.Final from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
    Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.7.0.Final from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
    Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.7.0.Final from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
    Caused by: org.apache.maven.wagon.TransferFailedException: Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
    Caused by: org.apache.http.conn.HttpHostConnectException: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.232.64.215] failed: Connection timed out (Connection timed out)
    Caused by: java.net.ConnectException: Connection timed out (Connection timed out)

Why it’s trying to reach out to the repo.maven.apache.org instead of my local Artifactory?

Thanks!

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 41 (23 by maintainers)

Most upvoted comments

@famod we need to add <maven.settings>${session.request.userSettingsFile.path}</maven.settings> to our surefire properties. Clearly the settings file isn’t found. And as in the other issue, I think we should add <maven.repo.local>${session.request.localRepositoryPath.path}</maven.repo.local> and probably others. Do you want to add them or shall I?

This still looks like something we should support OOTB.

@dearrudam

The CI provides the settings.xml passing by argument “-s” in the maven command:

mvn -s /somedir/settings.xml clean package

Just to make sure, since I found a problem while debugging: You are passing an absolute path via -s? Not something like -s ~/settings.xml ?

Can you try adding <maven.settings>${session.request.userSettingsFile.path}</maven.settings> to surefire system properties? But be warned that this might cause problems in IntelliJ IDEA.

@famod, I’ve just followed your instruction:

<maven.settings>${session.request.userSettingsFile.path}</maven.settings>

And it worked properly!

Thank you very much, everyone!

PS: I’d like to learn more about Quarkus and contribute to this awesome project also!

Best regards!

I wish you all the best!

Max

IMHO I think that it’s a problem if the code is trying to download something directly from the internet instead of to use the maven settings

Yeah, sure, it’s definitely a bug if it tries to download things and bypasses the proxy.