Closed hohwille closed 4 years ago
What I do not get easily is that in the code clearly in every iteration from the model the parent is taken: https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/MavenDependencyCollector.java#L166
Then for that parent model the POM is resolved: https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/MavenDependencyCollector.java#L172
And the maven model for that parent (!) pom is build: https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/MavenDependencyCollector.java#L173
As we recurse with that parentModel
how could this create an infinity look?
IMHO only in a case where a POM points to itself in the parent
declaration. This should never be possible in a POM from maven central and is really odd and unlikely though still possible.
But in my case I believe the error has to be another reason that I can not figure out easily.
Any ideas what I might be missing?
Maybe the effective model does not apply the defaults from super-pom as expected so in this line: https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/MavenDependencyCollector.java#L172
It could be that parent.getRelativePath()
then does not return ../pom.xml
but the empty string if <relativePath>
is omitted. In that case we would stay in modelBasedir
and by default resolve pom.xml
what is the current POM again.
However, I already tuned this to avoid visiting the same POM twice here: https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/MavenDependencyCollector.java#L169
This is porperly filled here: https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/MavenDependencyCollector.java#L162
So even if the first assumtion would apply it still does not explain the infinity look. IMHO I can only figure this out via debugging.
I was able to debug and trace down the problem: The project was using this parent declaration in their root pom:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Therefore still in the effective POM the relativePath was empty. This lead to the effect, I predicted that the parent POM accidentally was resolved as the POM of the current project itself.
For the caching that did not help here, the problem is that GAV is org.springframework.boot:spring-boot-starter-parent:2.1.6.RELEASE
but the POM that is then resolved and loaded is still the projects POM that then we end up in an infinity loop.
Fixed. Will be released with 1.0.0-beta5
.