FORGE-1824: Prevent leaking of transitive dependencies