diff --git a/src/python/pants/jvm/compile.py b/src/python/pants/jvm/compile.py index 7be5771f4aa..0424b8d5c20 100644 --- a/src/python/pants/jvm/compile.py +++ b/src/python/pants/jvm/compile.py @@ -118,7 +118,7 @@ def for_targets( consume_only.append(impl) if len(compatible) == 1: - if not root and impl.root_only: + if not root and compatible[0].root_only: raise ClasspathRootOnlyWasInner( "The following targets had dependees, but can only be used as roots in a " f"build graph:\n{component.bullet_list()}"