Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31877

Maven repository attached to maven group by API is not accessible by group

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 3.37.3
    • Fix Version/s: None
    • Component/s: Maven, REST
    • Labels:
      None
    • Environment:
      Kubernetes Cluster (EKS), deployed by helm Chart: oteemocharts/sonatype-nexus

      Description

      We have a ansible playbook which creates new maven repositories and adds the new repository to the maven group repository. Our developers reported they can not access the repository over the group. Direct access to the repository is working.

       

      Workaround: I removed and added the repository from the group in the Nexus UI.

       

      Ansible Playbook

      ---
      - hosts: localhost
        vars:     nexus_uri: "https://{{nexus_domain}}"
          nexus_api_uri: "{{nexus_uri}}/service/rest/v1"
        tasks:   - name: Get all repositories
          uri:       url: "{{ nexus_api_uri }}/repositories"
            force_basic_auth: yes
            url_username: admin
            url_password: "{{ nexus_admin_password }}"
            method: GET
            status_code:         - 200
          register: repositories
      
        - name: Get all hosted maven repositories
          set_fact: 
            repos_maven: "{{ repositories.json | json_query(query) }}"
          vars:       query: "[? type==`hosted` && format==`maven2`].name"
      
        - name: Update maven repository group
          uri:       url: "{{ nexus_api_uri }}/repositories/maven/group/{{maven_group_repository_name}}"
            force_basic_auth: yes
            url_username: admin
            url_password: "{{ nexus_admin_password }}"
            method: PUT
            body_format: json
            body: |
              {
                "name": "{{maven_group_repository_name}}",
                "online": true,
                "storage": {
                  "blobStoreName": "default",
                  "strictContentTypeValidation": true
                },
                "group": {
                  "memberNames": {{ repos_maven }}
                }
              }
            status_code: 204
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Snakebyte91 Torben Müller
            Last Updated By:
            Joe Tom Joe Tom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title