Sonatype Nexus Repository (Core)

repository·main·Indexed 25 days ago

https://github.com/sonatype/nexus-public

Documentation for the open-source 'Core' version of Sonatype Nexus Repository, a centralized binary repository manager supporting Maven, Raw, and APT formats. Includes guides on configuring hosted, proxy, and group repositories via UI or OrientDB, deploying Maven projects, and building the Nexus Rapture Baseapp and rapture-theme using Maven and Sencha CMD.

Tokens
6.4K
Snippets
13
Records
38
Agent score
83%

What's inside sonatype-nexus-public

  1. Overview of jetty-modifications

    main

    The jetty-modifications modules provide custom modifications to Eclipse Jetty specifically designed to support features required by Nexus Repository when configured with Sonatype Repository Firewall.

    These modifications are based on the Jetty 12.0.17 release. The build process involves Maven modules that download the original Jetty source code, apply Sonatype's specific modifications, and rebuild the modified Jetty artifacts.

  2. Overview of Sonatype Nexus Repository Core

    main

    Sonatype Nexus Repository acts as a centralized binary repository manager for internal and third-party binaries, components, and packages. It helps optimize build performance and increase visibility across the Software Development Life Cycle (SDLC).

    Nexus Repository Core is the open-source version of the codebase. It includes support for the following repository formats:

    • maven
    • raw
    • APT

    It uses an embedded H2 database, which is suitable for small workloads. For more advanced features like npm, Docker, NuGet, PyPI support, or external PostgreSQL database integration (for Kubernetes deployments), use the Community Edition.

  3. Explore the rapture-theme/sass directory structure

    main

    The rapture-theme/sass directory contains the SASS source files for the Rapture theme, organized into three primary sub-folders:

    • rapture-theme/sass/etc: Contains miscellaneous or utility SASS files.
    • rapture-theme/sass/src: Contains the main source SASS files used for building the theme.
    • rapture-theme/sass/var: Contains SASS variables used for theme configuration and styling.
  4. Understand the Nexus Rapture styling architecture

    main

    Styling in Nexus Rapture is managed in two parts: the rapture-theme and the application styles. Both parts are managed via three major components: etc/all.scss, var/**/*.scss, and src/**/*.scss.

    Inclusion Order

    The order in which styles are included is complex and follows this hierarchy:

    1. theme etc
    2. application etc
    3. application var
    4. theme var
    5. theme src
    6. application src

    Note that theme var and src includes are determined by Javascript class dependency order, while application includes are explicit.

    Theme Styles

    Theme styles are located in src/main/baseapp/packages/rapture-theme/{sass|resources}. They are structured as a Sencha CMD package and are used to augment the ext-theme-neptune extended-style with Rapture-specific customizations.

    Application Styles

    Application styles are located in src/main/baseapp/sass.

    Because much of the application logic resides in other plugins, Sencha CMD cannot automatically detect which styles to include. To resolve this, the baseapp uses a workaround: it includes a single empty Javascript class baseapp.Application and an explicit require line in src/mian/baseapp/app.js to trigger the inclusion of SCSS sources.

  5. Use Build Support modules for dependency management

    main

    The buildsupport modules provide grouped dependencyManagement configurations for the project. Instead of managing individual versions for all dependencies manually, you can use these modules to ensure consistent dependency versions across different parts of the project.

    To apply all available dependency management configurations at once, import the all module in your Maven configuration.

  6. Use shared components from @sonatype/nexus-ui-plugin

    main

    To use shared components in a child project, follow these three steps:

    1. Export the component: Ensure the component is exported from the index.js file of the nexus-ui-plugin package.
    2. Add as a file reference: Add nexus-ui-plugin to your child project's package.json using a local file reference.
    3. Import the component: Use a named ES6 import to bring the component into your project.

    Example package.json entry:

    "nexus-ui-plugin": "file:../nexus-ui-plugin"

    Example import statement:

    import { Button } from '@sonatype/nexus-ui-plugin'
  7. Configure Maven hosted, proxy, and group repositories via UI

    main

    When configuring Maven repositories in the Nexus UI, use the following JSON configurations. Ensure that the repository names used in the group configuration match the names assigned to the hosted and proxy repositories.

    ### Maven Hosted Repository (e.g., `maven2-hosted`)
    ```json
    {
      "maven" : {
        "versionPolicy" : "SNAPSHOT",
        "checksumPolicy" : "WARN",
        "strictContentTypeValidation" : false
      },
      "storage" : {
        "writePolicy" : "ALLOW"
      }
    }

    Maven Proxy Repository (e.g., maven2-proxy)

    {
      "maven" : {
        "versionPolicy" : "MIXED",
        "checksumPolicy" : "WARN",
        "strictContentTypeValidation" : false
      },
      "proxy" : {
        "remoteUrl" : "https://repo1.maven.org/maven2/",
        "contentMaxAge" : 3600
      },
      "httpclient" : {
        "connection" : {
          "timeout" : 1500,
          "retries" : 3
        },
        "authentication" : {
            "type" : "username",
            "username" : "admin",
            "password" : "admin123"
        }
      },
      "storage" : {
        "writePolicy" : "ALLOW"
      }
    }

    Maven Group Repository (e.g., maven2-group)

    Note: Group repositories aggregate content from members and do not use versionPolicy, layoutPolicy, or contentDisposition fields.

    {
      "group" : {
        "memberNames" : ["maven2-hosted", "maven2-proxy"]
      },
      "storage" : {
        "writePolicy" : "ALLOW"
      }
    }
  8. Build Nexus Repository Core from source

    main

    To build a specific tagged release, follow these steps:

    1. Fetch tags and checkout the release branch: Replace 3.89.0-09 with your target version.

      git fetch --tags
      git checkout -b release-3.89.0-09 origin/release-3.89.0-09 --
    2. Initialize Yarn Workspaces: Frontend modules require Yarn workspaces to be initialized before the Maven build. This requires Node.js 16.10+.

      corepack enable
      corepack yarn install
    3. Execute the Maven build: Use the included Maven wrapper script with the public profile.

      ./mvnw clean install -Ppublic
    git fetch --tags
    git checkout -b release-3.89.0-09 origin/release-3.89.0-09 --
    
    corepack enable
    corepack yarn install
    
    ./mvnw clean install -Ppublic