Repository Management with Nexus I
Total Page:16
File Type:pdf, Size:1020Kb
Repository Management with Nexus i Repository Management with Nexus Ed. 4.0 Repository Management with Nexus ii Contents 1 Introducing Nexus Repository Manager1 2 Concepts 7 3 Installing and Running Nexus Repository Manager 17 4 Configuring Maven and Other Build Tools 52 5 Using the User Interface 66 6 Configuring Nexus Repository Manager 104 7 Smart Proxy 167 8 LDAP Integration 177 9 Atlassian Crowd Support 201 Repository Management with Nexus iii 10 Procurement Suite 217 11 Improved Releases with Staging 235 12 Repository Health Check 288 13 Managing Maven Settings 296 14 OSGi Bundle Repositories 306 15 P2 Repositories 312 16 .NET Package Repositories with NuGet 316 17 Node Packaged Modules and npm Registries 327 18 Ruby, RubyGems and Gem Repositories 336 19 RPM Packages and YUM Repositories 345 20 Site Repositories 354 21 Repository Management Best Practises 363 22 Nexus Repository Manager Plugins 366 23 Migrating to Nexus Repository Manager 372 Repository Management with Nexus iv 24 Configuring Secure Socket Layer SSL 385 25 Evaluating Step by Step 394 26 Community 426 A Contributing to the Nexus Documentation 431 B Copyright 433 C Creative Commons License 435 Repository Management with Nexus v Preface This book covers the concepts of repository management, software supply chain management and com- ponent management in general and specifically the usage of Nexus Repository Manager OSS and Nexus Repository Manager. It details all aspects of set-up and running a repository manager with the features of the latest release version 2.12.1. This book was last updated and published on 2016-03-16. Repository Management with Nexus 1 / 440 Chapter 1 Introducing Nexus Repository Manager 1.1 Introduction Nexus Repository Manager and Nexus Repository Manager OSS manage software components required for development, deployment, and provisioning. If you develop software, the repository manager can help you share those components with other developers and end users. It greatly simplifies the maintenance of your own internal repositories and access to external repositories. With Nexus Repository Manager and Nexus Repository Manager OSS you can completely control access to, and deployment of, every component in your organization from a single location. The repository manager is available in two editions: • Nexus Repository Manager OSS • Nexus Repository Manager The basis of all versions is formed by Nexus Repository Manager OSS. It is licensed under the Eclipse Public License version 1.0 and can be used to get started with component and repository management. It provides a plugin infrastructure for all its features and supports numerous repository formats out of the box. Nexus Repository Manager builds on top of the numerous features of Nexus Repository Manager OSS Repository Management with Nexus 2 / 440 and adds component information integration, improvements for the release process, improved LDAP integration and other features typically required by enterprises and advanced users. Integration of Nexus Repository Manager with the Nexus IQ Server makes your component manage- ment policies and rules configurable and actionable and provides further automation and integration with numerous tools to advanced users. Upgrades from Nexus Repository Manager OSS can be easily performed. This makes Nexus Repository Manager OSS an easy, yet powerful solution to get started with component and repository management. Nexus Repository Manager adds further features as well as full support by Sonatype. TIP Check out Chapter2 for more background on repository management in your software development life cycle. 1.2 Nexus Repository Manager OSS Nexus Repository Manager OSS provides you with an essential level of control over the external repos- itories you use and the internal repositories you create. It provides infrastructure and services for orga- nizations that use repository managers to obtain and deliver software. If you create software libraries or applications for your end users, you can use Nexus Repository Manager OSS to distribute your software. If your software depends on open source software components, you can cache software components from remote repositories. 1.2.1 Features Hosting Repositories When you host a repository with Nexus Repository Manager OSS, you can upload components using the interface, or you can deploy components to hosted repositories using a build tool. The repository manager also creates the standard index for all of your hosted repositories, which will allow tools to rapidly locate software components for your developers. Proxy Remote Repositories When you proxy a remote repository with Nexus Repository Manager OSS, you can control all aspects of the connection to a remote repository, including security parameters, and HTTP proxy settings. You can configure how long the repository managers stores components, and how it will expire components which are no longer referenced by your build. Repository Management with Nexus 3 / 440 Repository Groups Grouping repositories allows you to consolidate multiple repositories into a single URL. This makes configuring your development environment very easy. All of your developers can point to a single repository group URL, and if anyone ever needs a custom remote repository added to the group, you can do this in a central location without having to modify every developer’s workstation. Numerous Repository Formats The concepts of hosted repositories, proxy repositories and repository groups are supported for a number of repository formats such as Maven 2, NuGet, NPM, RubyGems or YUM. This allows you to facilitate one repository manager to bring the same advantages to all developers in a team relying on different technologies and build tools including Apache Maven, Apache Ant with Apache Ivy or Eclipse Aether, Gradle, SBT, .Net, Node.js, Ruby and many others. Hosting Project Web Sites The repository manager is a publishing destination for project web sites. While you very easily generate a project web site with Maven, without Nexus Repository Manager OSS or Nexus Repos- itory Manager, you will need to set up a WebDAV server and configure both your web server and build with the appropriate security credentials. With the repository manager, you can deploy your project’s web site to the same infrastructure that hosts the project’s build output. This single des- tination for binaries and documentation helps to minimize the number of moving parts in your development environment. Fine-grained Security Model Nexus Repository Manager OSS ships with a very capable and customizable security framework that can be used to configure user interface as well as component access. Every operation is as- sociated with a privilege, and privileges can be combined into standard roles. Users can then be assigned both individual privileges and roles that can be applied globally or at a fine-grained level. You can create custom administrative roles that limit certain repository actions, such as deployment to specific groups of developers, and you can use these security roles to model the structure of your organization. Flexible LDAP Integration If your organization uses an LDAP server, Nexus Repository Manager and Nexus Repository Man- ager OSS can integrate with an external authentication and access control system. The repository manager is smart enough to be able to automatically map LDAP groups to the appropriate roles, and it also provides a very flexible facility for mapping existing users and existing roles to roles. Component Search Nexus Repository Manager OSS provides an intuitive search feature which allows you to search for software components by identifiers, such as groupId, artifactId, version, classifier, and packaging, names of classes contained in Java archives, keywords, and component sha1 checksums. In addition the repository manager can automatically download the index from remote repositories. This allows discovery of components available in these remote repositories without prior downloads. Scheduled Tasks Nexus Repository Manager OSS has the concept of scheduled tasks: periodic jobs which take care of various repository management tasks, such as deleting old snapshots, evicting unused items, and publishing repository indexes. Repository Management with Nexus 4 / 440 REST Services Nexus Repository Manager OSS is based on a series of REST services, and when you are using the web front-end UI, you are really just interacting with a set of REST services. Because of this open architecture, you can leverage the REST service to create custom interactions or to automate repository management with your own scripts. Integration with m2eclipse When you use Nexus Repository Manager or Nexus Repository Manager OSS as a repository man- ager it creates indexes that support the Maven integration for the Eclipse IDE -M2Eclipse. They are immediately available to the project creation wizards and are included in search results in the IDE and other operations with dependencies and plugins. 1.3 Nexus Repository Manager Nexus Repository Manager is designed to meet the needs of the enterprise and builds upon solid foun- dation and features provided by Nexus Repository Manager OSS. It acts as a central point of access to external repositories and a central distribution point with the intelligence required to support the decision that go into making quality software. 1.3.1 Features Rich Component Information The Nexus IQ Data Services provide up-to-date and accurate information about known component security vulnerabilities as