Srijani Ghosh
Srijani Ghosh

Reputation: 4216

How to block selected artifacts in Nexus?

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

Answers (1)

Srijani Ghosh
Srijani Ghosh

Reputation: 4216

  1. Go to nexus url.

  2. login

  3. Go to View/Repositories -> Repositories and check which artifact you want to block (e.g. – Releases -> com -> test -> abc-> TestApp -> 0.0.1).

  4. 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

  5. Go to View/Repositories -> Routing.

  6. Click on Add.

  7. 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)

  8. Save.

  9. 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

Related Questions