We have a corporate/private maven registry ("artifactory") in place, which is used by our projects to resolve the project's dependencies.
This private maven registry also proxies Maven Central for common dependencies, meaning dependencies that were not resolved by the internal registry in the first place.
We want to avoid supply-chain attacks, namely someone overloading a custom dependency we use in our private/corporate maven registry with the same identifiers in Maven Central.
Say, i.e. publishing a malicious dependency artifact in Maven Central with the same groupId and artifactId as the internal one, but with a higher version - that one would then take precedence and wreak havoc in our systems.
In npm, there is a mechanism that allows "tagging" a dependency to a certain private registry (via scope).
Is there a similar mechanism in Maven that allows certain dependencies to only resolve from the internal artifactory, and prevent it from being resolved from Maven Central?
I am thinking of something like artifactory:
<dependency>
<groupId>org.acme</groupId>
<artifactId>supersecret</artifactId>
<version>3.141</version>
<artifactory>internal_corporate_artifactory_name</artifactory> <!-- as described in settings.xml or Super-Pom -->
</dependency>