Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup in the bootstrap code around maven resolver and workspace discovery #7162

Merged

Conversation

aloubyansky
Copy link
Member

@aloubyansky aloubyansky commented Feb 12, 2020

  • a fallback to resolving an application model from the classpath was removed, if the execution flow reaches that point something is definitely wrong and most probably will end up failing later;
  • resolved workspace discovery in BootstrapAppModelFactory is cached now to avoid loading it multiple times for the same factory (helps optimize launching apps in dev mode);
  • unless explicitly enabled or disabled, local workspace discovery is enabled by default for the test and dev modes and disabled otherwise.

@aloubyansky aloubyansky changed the title A bit of a cleanup in the bootstrap code around maven resolver and wo… Cleanup in the bootstrap code around maven resolver and workspace discovery Feb 12, 2020
@aloubyansky aloubyansky added this to the 1.3.0 milestone Feb 12, 2020
@geoand
Copy link
Contributor

geoand commented Feb 12, 2020

The CI failure seems related:

2020-02-12T13:48:19.3724062Z [INFO] Running io.quarkus.arc.test.noargsconstructor.AddMissingNoargsConstructorTest
2020-02-12T13:48:21.8583278Z [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.481 s <<< FAILURE! - in io.quarkus.arc.test.noargsconstructor.AddMissingNoargsConstructorTest
2020-02-12T13:48:21.8601878Z [ERROR] io.quarkus.arc.test.noargsconstructor.AddMissingNoargsConstructorTest  Time elapsed: 2.48 s  <<< ERROR!
2020-02-12T13:48:21.8614353Z java.lang.RuntimeException: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for io.quarkus:quarkus-arc-deployment::jar:999-SNAPSHOT
2020-02-12T13:48:21.8614787Z 	at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:415)
2020-02-12T13:48:21.8614934Z 	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$7(ClassBasedTestDescriptor.java:359)
2020-02-12T13:48:21.8622533Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8623199Z 	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:359)
2020-02-12T13:48:21.8623523Z 	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:189)
2020-02-12T13:48:21.8631041Z 	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
2020-02-12T13:48:21.8632010Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:132)
2020-02-12T13:48:21.8632421Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8636361Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-02-12T13:48:21.8636932Z 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-02-12T13:48:21.8652946Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-02-12T13:48:21.8653543Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8654003Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-02-12T13:48:21.8654369Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-02-12T13:48:21.8654744Z 	at java.util.ArrayList.forEach(ArrayList.java:1257)
2020-02-12T13:48:21.8655249Z 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
2020-02-12T13:48:21.8655766Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
2020-02-12T13:48:21.8656130Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8656600Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-02-12T13:48:21.8660057Z 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-02-12T13:48:21.8660562Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-02-12T13:48:21.8661092Z 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8744702Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-02-12T13:48:21.8745872Z 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-02-12T13:48:21.8746573Z 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
2020-02-12T13:48:21.8747033Z 	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
2020-02-12T13:48:21.8747963Z 	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
2020-02-12T13:48:21.8748582Z 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
2020-02-12T13:48:21.8749068Z 	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
2020-02-12T13:48:21.8752257Z 	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
2020-02-12T13:48:21.8752870Z 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
2020-02-12T13:48:21.8753751Z 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
2020-02-12T13:48:21.8756724Z 	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:142)
2020-02-12T13:48:21.8757283Z 	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:117)
2020-02-12T13:48:21.8757992Z 	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
2020-02-12T13:48:21.8760934Z 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
2020-02-12T13:48:21.8761875Z 	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
2020-02-12T13:48:21.8762371Z 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
2020-02-12T13:48:21.8765070Z 	Suppressed: java.lang.NullPointerException
2020-02-12T13:48:21.8765676Z 		at io.quarkus.test.QuarkusUnitTest.afterAll(QuarkusUnitTest.java:442)
2020-02-12T13:48:21.8767219Z 		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$13(ClassBasedTestDescriptor.java:425)
2020-02-12T13:48:21.8770377Z 		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8770986Z 		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$14(ClassBasedTestDescriptor.java:425)
2020-02-12T13:48:21.8773815Z 		at java.util.ArrayList.forEach(ArrayList.java:1257)
2020-02-12T13:48:21.8774410Z 		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeAfterAllCallbacks(ClassBasedTestDescriptor.java:425)
2020-02-12T13:48:21.8777023Z 		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:213)
2020-02-12T13:48:21.8777668Z 		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:78)
2020-02-12T13:48:21.8780235Z 		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:145)
2020-02-12T13:48:21.8782966Z 		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-02-12T13:48:21.8783575Z 		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:145)
2020-02-12T13:48:21.8786583Z 		... 29 more
2020-02-12T13:48:21.8793580Z Caused by: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for io.quarkus:quarkus-arc-deployment::jar:999-SNAPSHOT
2020-02-12T13:48:21.8796642Z 	at io.quarkus.bootstrap.BootstrapAppModelFactory.resolveAppModel(BootstrapAppModelFactory.java:290)
2020-02-12T13:48:21.8797158Z 	at io.quarkus.bootstrap.app.QuarkusBootstrap.bootstrap(QuarkusBootstrap.java:134)
2020-02-12T13:48:21.8797425Z 	at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:371)
2020-02-12T13:48:21.8797691Z 	... 37 more
2020-02-12T13:48:21.8858424Z Caused by: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to read descriptor of io.quarkus:quarkus-arc-deployment:jar:999-SNAPSHOT
2020-02-12T13:48:21.8859235Z 	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.resolveDescriptor(MavenArtifactResolver.java:226)
2020-02-12T13:48:21.8862255Z 	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.newCollectManagedRequest(MavenArtifactResolver.java:310)
2020-02-12T13:48:21.8863051Z 	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.resolveManagedDependencies(MavenArtifactResolver.java:274)
2020-02-12T13:48:21.8865543Z 	at io.quarkus.bootstrap.resolver.BootstrapAppModelResolver.doResolveModel(BootstrapAppModelResolver.java:169)
2020-02-12T13:48:21.8868845Z 	at io.quarkus.bootstrap.resolver.BootstrapAppModelResolver.resolveManagedModel(BootstrapAppModelResolver.java:144)
2020-02-12T13:48:21.8869475Z 	at io.quarkus.bootstrap.BootstrapAppModelFactory.resolveAppModel(BootstrapAppModelFactory.java:276)
2020-02-12T13:48:21.8869938Z 	... 39 more
2020-02-12T13:48:21.8873431Z Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for io.quarkus:quarkus-arc-deployment:jar:999-SNAPSHOT
2020-02-12T13:48:21.8876227Z 	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:276)
2020-02-12T13:48:21.8876836Z 	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
2020-02-12T13:48:21.8879663Z 	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:253)
2020-02-12T13:48:21.8880274Z 	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.resolveDescriptor(MavenArtifactResolver.java:221)
2020-02-12T13:48:21.8883062Z 	... 44 more
2020-02-12T13:48:21.8888980Z Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact io.quarkus:quarkus-arc-deployment:pom:999-SNAPSHOT from/to gradle-official-repository (https://repo.gradle.org/gradle/libs-releases-local/): Failed to transfer file: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-arc-deployment/999-SNAPSHOT/quarkus-arc-deployment-999-SNAPSHOT.pom. Return code is: 409 , ReasonPhrase:Conflict.
2020-02-12T13:48:21.8892670Z 	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
2020-02-12T13:48:21.8896906Z 	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
2020-02-12T13:48:21.8899292Z 	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
2020-02-12T13:48:21.8899603Z 	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:261)
2020-02-12T13:48:21.8902455Z 	... 47 more

@aloubyansky
Copy link
Member Author

Yes, I'm looking into this.

@aloubyansky aloubyansky force-pushed the bootstrap-maven-resolver-cleanup branch 2 times, most recently from cc514e2 to 5001bd6 Compare February 12, 2020 23:14
@aloubyansky aloubyansky force-pushed the bootstrap-maven-resolver-cleanup branch from 5001bd6 to 5e29088 Compare February 13, 2020 05:25
…orkspace discovery:

    * a fallback to resolving an application model from the classpath was removed, if the execution flow reaches that point something is definitely wrong and most probably will end up failing later;
    * resolved workspace discovery in BootstrapAppModelFactory is cached now to avoid loading it multiple times for the same factory (helps optimize launching apps in dev mode).
@aloubyansky
Copy link
Member Author

aloubyansky commented Feb 13, 2020

@gsmet I'd like to get this in 1.3.0.Alpha2. It's better to catch issues related to this stuff as early as possible. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants