gradle-license-plugin
gradle-license-plugin copied to clipboard
Fix recursion stack overflows
Addresses issue #283.
I applied an (arbitrary!) upper limit of 5 to recursion when finding licenses, but this is obviously subject to change if you reckon so.
Also applied the same patch to the findVersion
method, since the same issues was possible there too.
Can you add tests for this?
That's strange. I am the guy who originally implemented recursive scanning of POMs in https://github.com/jaredsburrows/gradle-license-plugin/pull/27 and I've never seen this behavior. Well, we haven't updated the plugin in a while, so maybe there is a bug that has been introduced recently...
Anyway, I think applying an arbitrary recursion depth seems wrong. This issue can only happen if there are circular references between POMs and I've never seen that in the wild. But even if this actually happens, I think this should be handled by keeping a queue of encountered POMs so that we can show a proper error message (visualizing the circular dependencies by printing the queue) as soon as we encounter the same POM twice.
@ChristianCiach That and this should not be a problem if the POMs are configured correctly.
See https://github.com/jaredsburrows/gradle-license-plugin/issues/283.