-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Infinity loop when build root project with multiple sub projects #29770
Labels
Milestone
Comments
cc @aloubyansky |
I made a patch, please review: diff --git a/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java b/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java
index a30aad09d2..9e2587ee65 100644
--- a/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java
+++ b/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/WorkspaceLoader.java
@@ -153,13 +153,11 @@ private LocalProject loadAndCacheProject(Path pomFile) throws BootstrapMavenExce
}
private Model rawModel(Path pomFile) throws BootstrapMavenException {
- final Model rawModel = rawModelCache.getOrDefault(pomFile.getParent(),
+ Model rawModel = rawModelCache.getOrDefault(pomFile.getParent(),
modelProvider == null ? null : modelProvider.apply(pomFile.getParent()));
- return rawModel == null ? loadAndCacheRawModel(pomFile) : rawModel;
- }
-
- private Model loadAndCacheRawModel(Path pomFile) throws BootstrapMavenException {
- final Model rawModel = readModel(pomFile);
+ if (rawModel == null) {
+ rawModel = readModel(pomFile);
+ }
rawModelCache.put(pomFile.getParent(), rawModel);
return rawModel;
} |
@benstonezhang thanks for looking into it. Would you like to open a PR? |
benstonezhang
added a commit
to benstonezhang/quarkus
that referenced
this issue
Dec 11, 2022
PR #29784 created |
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Dec 20, 2022
(cherry picked from commit 86e6600)
PR is merged, can be the issues closed? |
Verified on 2.15.1 and later. |
Thanks |
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Jan 9, 2023
(cherry picked from commit 86e6600)
ebullient
pushed a commit
to maxandersen/quarkus
that referenced
this issue
Jan 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
To build a big project with multiple sub projects, we usually create them as below:
root project - (parent) -> base
root project have sub modules:
base, base-quarkus, quarkus-example
base-quarkus - (parent) -> base
quarkus-example - (parent) -> base-quarkus
Quarkus release after 2.13.0 have this issue. In fact, this issue is introduced by commit
a426f6a372fdfceaaee7d2e3c1342805aa6818df
"Make sure the app model is initialized from the POMs provided by theMaven plugin that could be manipulated by Maven extensions".
I create a example project at https://github.com/benstonezhang/multi-projects-quarkus-example.git for easy reproduce this issue.
Expected behavior
stack overflow should not happen.
Actual behavior
when run
mvn package
at the root of the project, the WorkspaceLoader enter an infinity loop and cause stack overflow finally.but if we run
mvn package -f quarkus-example
, there is no issue.How to Reproduce?
Steps:
Output of
uname -a
orver
Linux localhost 4.18.0-425.3.1.el8.x86_64 #1 SMP Wed Nov 9 20:13:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.17" 2022-10-18 LTS OpenJDK Runtime Environment (Red_Hat-11.0.17.0.8-2.el8_6) (build 11.0.17+8-LTS) OpenJDK 64-Bit Server VM (Red_Hat-11.0.17.0.8-2.el8_6) (build 11.0.17+8-LTS, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.0 and later
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.5.4 (Red Hat 3.5.4-5) Maven home: /usr/share/maven Java version: 17.0.5, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.5.0.8-2.el8_6.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.18.0-425.3.1.el8.x86_64", arch: "amd64", family: "unix"
Additional information
No response
The text was updated successfully, but these errors were encountered: