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

Make sure all the project modules are loaded into workspace in case the root pom does not declare any #16138

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

aloubyansky
Copy link
Member

Fixes a bug in the bootstrap Maven workspace discovery when the current project is located deep in the module hierarchy and the root pom doesn't happen to list any modules.

@quarkus-bot quarkus-bot bot added the area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins label Mar 31, 2021
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some small comments.

I confirm I want this in a micro before backporting to 1.11 :).

final Model model = readModel(pomFile);
cachedModels.put(pomFile.getParent(), model);
private LocalProject loadAndCache(Path pomFile) throws BootstrapMavenException {
final LocalProject model = new LocalProject(readModel(pomFile), workspace);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but maybe you should rename the variable for more clarity?

if (workspace.getCurrentProject() == null) {
load(null, currentProjectPom);
private LocalProject loadProjectWithModules(Path projectPom, String skipModule) throws BootstrapMavenException {
final LocalProject project = model(projectPom);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model() method should probably be renamed too?

@@ -138,6 +138,27 @@ public void loadWorkspaceWithDirBreaks() throws Exception {
assertEquals(4, ws.getProjects().size());
}

@Test
//@Disabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed, right?

@aloubyansky
Copy link
Member Author

@gsmet all done

@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Apr 1, 2021
@aloubyansky
Copy link
Member Author

Just in case, this is the failure

2021-04-01T12:27:04.6777756Z [INFO] Running io.quarkus.it.rest.client.BasicTest
2021-04-01T12:27:11.5187537Z 2021-04-01 12:27:11,496 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT on JVM started in 2.413s. Listening on: http://localhost:8081
2021-04-01T12:27:11.5188952Z 2021-04-01 12:27:11,498 INFO  [io.quarkus] (main) Profile test activated. 
2021-04-01T12:27:11.5190695Z 2021-04-01 12:27:11,498 INFO  [io.quarkus] (main) Installed features: [cdi, mutiny, resteasy-reactive-jaxrs-client, smallrye-context-propagation]
2021-04-01T12:27:14.0080542Z [ERROR] WARNING: An illegal reflective access operation has occurred
2021-04-01T12:27:14.0083699Z [ERROR] WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v9.Java9 (file:/home/runner/.m2/repository/org/codehaus/groovy/groovy/3.0.7/groovy-3.0.7.jar) to constructor java.lang.AssertionError(java.lang.String)
2021-04-01T12:27:14.0086730Z [ERROR] WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v9.Java9
2021-04-01T12:27:14.0088773Z [ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2021-04-01T12:27:14.0093749Z [ERROR] WARNING: All illegal access operations will be denied in a future release
2021-04-01T12:27:14.0434706Z [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.354 s <<< FAILURE! - in io.quarkus.it.rest.client.BasicTest
2021-04-01T12:27:14.0443944Z [ERROR] io.quarkus.it.rest.client.BasicTest.shouldWork  Time elapsed: 2.508 s  <<< FAILURE!
2021-04-01T12:27:14.0447985Z java.lang.AssertionError: 
2021-04-01T12:27:14.0450992Z 1 expectation failed.
2021-04-01T12:27:14.0455212Z JSON path [4].cultivar doesn't match.
2021-04-01T12:27:14.0458059Z Expected: cortland2
2021-04-01T12:27:14.0460790Z   Actual: cortland3
2021-04-01T12:27:14.0462121Z 
2021-04-01T12:27:14.0470875Z 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2021-04-01T12:27:14.0482455Z 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2021-04-01T12:27:14.0495134Z 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2021-04-01T12:27:14.0503942Z 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
2021-04-01T12:27:14.0512810Z 	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
2021-04-01T12:27:14.0553784Z 	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:59)
2021-04-01T12:27:14.0566418Z 	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
2021-04-01T12:27:14.0577318Z 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
2021-04-01T12:27:14.0588778Z 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
2021-04-01T12:27:14.0599692Z 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
2021-04-01T12:27:14.0611844Z 	at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:493)
2021-04-01T12:27:14.0622198Z 	at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
2021-04-01T12:27:14.0634227Z 	at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:674)
2021-04-01T12:27:14.0643470Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-04-01T12:27:14.0770202Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-04-01T12:27:14.0786142Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-04-01T12:27:14.0792815Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-04-01T12:27:14.0802629Z 	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
2021-04-01T12:27:14.0815406Z 	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
2021-04-01T12:27:14.0830046Z 	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:61)
2021-04-01T12:27:14.0869181Z 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
2021-04-01T12:27:14.0879161Z 	at io.restassured.internal.ResponseSpecificationImpl.body(ResponseSpecificationImpl.groovy:261)
2021-04-01T12:27:14.0904707Z 	at io.restassured.specification.ResponseSpecification$body$1.callCurrent(Unknown Source)
2021-04-01T12:27:14.0914930Z 	at io.restassured.internal.ResponseSpecificationImpl.body(ResponseSpecificationImpl.groovy:108)
2021-04-01T12:27:14.0926376Z 	at io.restassured.internal.ValidatableResponseOptionsImpl.body(ValidatableResponseOptionsImpl.java:244)
2021-04-01T12:27:14.0936661Z 	at io.restassured.internal.ValidatableResponseImpl.super$2$body(ValidatableResponseImpl.groovy)
2021-04-01T12:27:14.0945511Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-04-01T12:27:14.0955689Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-04-01T12:27:14.0966653Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-04-01T12:27:14.0973894Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-04-01T12:27:14.0981504Z 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
2021-04-01T12:27:14.0988641Z 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
2021-04-01T12:27:14.0996525Z 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
2021-04-01T12:27:14.1007060Z 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
2021-04-01T12:27:14.1017787Z 	at io.restassured.internal.ValidatableResponseImpl.body(ValidatableResponseImpl.groovy:298)
2021-04-01T12:27:14.1027512Z 	at io.restassured.internal.ValidatableResponseImpl.body(ValidatableResponseImpl.groovy)
2021-04-01T12:27:14.1035338Z 	at io.quarkus.it.rest.client.BasicTest.shouldWork(BasicTest.java:29)
2021-04-01T12:27:14.1043671Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-04-01T12:27:14.1053663Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-04-01T12:27:14.1076082Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-04-01T12:27:14.1085072Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-04-01T12:27:14.1113439Z 	at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:939)
2021-04-01T12:27:14.1123753Z 	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:845)

@gsmet
Copy link
Member

gsmet commented Apr 1, 2021

@michalszynkiewicz could you have a look at the failure above?

@gsmet gsmet merged commit 00ae3e2 into quarkusio:main Apr 1, 2021
@quarkus-bot quarkus-bot bot added this to the 1.14 - main milestone Apr 1, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Apr 1, 2021
@michalszynkiewicz
Copy link
Member

@geoand do you have time to take a look at the failure? It's the test you modified.

@geoand
Copy link
Contributor

geoand commented Apr 1, 2021

I'll take a look

geoand added a commit to geoand/quarkus that referenced this pull request Apr 1, 2021
@geoand
Copy link
Contributor

geoand commented Apr 1, 2021

Here it is #16187

@gsmet gsmet modified the milestones: 1.14 - main, 1.13.1.Final Apr 3, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this pull request Apr 3, 2021
Relates to: quarkusio#16138 (comment)

(cherry picked from commit eef926f)
@geoand
Copy link
Contributor

geoand commented Apr 7, 2021

@aloubyansky it looks like this needs to be backported to 1.13, right?

@aloubyansky
Copy link
Member Author

Right

@geoand
Copy link
Contributor

geoand commented Apr 7, 2021

@gsmet I am re-adding the backport label

@aloubyansky
Copy link
Member Author

It looks like the milestone has already been set to 1.13.1.Final

@aloubyansky
Copy link
Member Author

It's actually been backported already to 1.13.

@geoand
Copy link
Contributor

geoand commented Apr 7, 2021

Ah, OK

@gsmet gsmet modified the milestones: 1.13.1.Final, 1.11.7.Final Apr 29, 2021
juazugas pushed a commit to juazugas/quarkus that referenced this pull request Sep 30, 2021
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this pull request Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants