diff --git a/src/python/pants/jvm/goals/lockfile.py b/src/python/pants/jvm/goals/lockfile.py index 4dbf8f0218a4..1811eecd5323 100644 --- a/src/python/pants/jvm/goals/lockfile.py +++ b/src/python/pants/jvm/goals/lockfile.py @@ -176,12 +176,12 @@ async def setup_user_lockfile_requests( # validate the proposed set of artifact requirements for each resolve. gets = [] for resolve in requested: - if resolve in resolve_to_artifacts: + if resolve in resolve_to_artifacts or resolve not in tools: gets.append( Get( GenerateJvmLockfile, _ValidateJvmArtifactsRequest( - artifacts=ArtifactRequirements(resolve_to_artifacts.get(resolve, ())), + artifacts=ArtifactRequirements(resolve_to_artifacts[resolve]), resolve_name=resolve, ), ) @@ -197,6 +197,16 @@ async def setup_user_lockfile_requests( GenerateJvmLockfileFromTool.create(tool), ) ) + else: + gets.append( + Get( + GenerateJvmLockfile, + _ValidateJvmArtifactsRequest( + artifacts=ArtifactRequirements(()), + resolve_name=resolve, + ), + ) + ) jvm_lockfile_requests = await MultiGet(*gets)