Nexus sets the guest to only access the specified artifact


Guids: http://books.sonatype.com/nexus-book/reference/running.html
0. Download nexus
http://www.sonatype.org/nexus/go/
and extract it directly

1. Start nexus
under windows: Enter the bin directory, then run
> nexus.bat console

2. After the startup is complete, enter http://127.0.0.1:8081/nexus/default
  username and password
  admin
  admin123

Before setting permissions, it is recommended to create a separate repository for your project group. It is convenient to assign permissions to the group.

3. Set the guest to only obtain the specified artifact. After the setting is completed, anonymous users can query according to the groupid and artifactid of the open artifact.
Ideas : Customize privileges and roles for anonymous; privileges can be set according to repository targets.
3.1. Setting repository targets
: Use it to configure which directories of artifacts can be accessed.
     a. Add a new repository targets
        name: it is best to take a meaningful name
        repository type: Custom general selection "Any Content"
        Pattern Expression: Set the path of articfact that can be matched according to wildcards
         .*/com/some/company/.* --Can match "com.some.company" as groupid, The artifactid contains               
         ^/com/some/company/* -- the artifact of the path starting with com/some/company
        For example: I want to match all the artifacts under SNAPSHOT of the company. It can be configured as:
              .*/com/xxx/companyname /xxx/.*SNAPSHOT/.*
      b. Click the "Add" button to add pattern expression to patterns
c. You can add multiple Pattern Expressions to set multiple artifacts

3.2. Set
     the role of routing: configure which directories are through routing Which can be accessed through the repository path, and which ones cannot be accessed through the repository path.
     For example: Do not allow access to com/mycompany directory through repository path
     a. Configure URL pattern: ^/com/mycompany/.*
     b. Select rule type:
        Exclusive, the directory that does not contain the settings
        Inclusive, the directory that contains the settings
     c. Select the repository group, and select your repository group as needed.
     d. Select the repositories that need to use the reference to the configuration.
    After configuration, access com/mycomany through the repository path I get a 404 error when I go to the directory.

3.3. Set Privileges
      name: Privilege name
      description: Privilege description
      repository: Select your repository
      repository target: Select the target you added in 3.1.
      After adding, nexus will create four permissions for it (create, read, update, delete)

3.4. Set roles
     a. Fill in roleid, name, description.
     b. Select the newly added privilege in privilegesges, Nexus Anonymous Role

3.5. Configure users
     a. Added role settings for anonymous user

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326219249&siteId=291194637