Reputation: 4216
I am very new to Nexus repositories.
I am trying to configure Nexus is such a way that I can tell Nexus to not use some certain artifacts which are already in the repository.
I know I can block the artifacts by using pom.xml. But, is there any way to do it by using Nexus repository interface?
Thanks!
Upvotes: 4
Views: 3784
Reputation: 4216
Go to nexus url.
login
Go to View/Repositories -> Repositories and check which artifact you want to block (e.g. – Releases -> com -> test -> abc-> TestApp -> 0.0.1).
Go to Artifact tab onthe right hand side. Copy the Repositroy path : /com/mycompany/test/abc/TestApp/0.0.1/TestApp-0.0.1.jar
Go to View/Repositories -> Routing.
Click on Add.
Fill in the URL pattern, Rule type and Repository type
URL Pattern (which is a regular expression fort he URL path): ^/com/mycompany/test/abc/TestApp/0.0.1/TestApp-0.0.1.jar
Rule Type : Blocking
Repository group : All Repository Groups (or you can choose your desired repository group)
Save.
Add the corresposing maven dependency of the blocked artifact in the pom.xml of your project. Then do maven clean install. It should throw error as now it is not able to download the jar /com/wincornixdorf/test/Patrick/TestApp/0.0.1/TestApp-0.0.1.jar
Upvotes: 4