<commit_before># Nexus3 Cookbook

[![Cookbook Version][cookbook_version]][cookbook]
[![Build Status][build_status]][build_status]

[cookbook]: https://supermarket.chef.io/cookbooks/nexus3
[cookbook_version]: https://img.shields.io/cookbook/v/nexus3.svg
[build_status]: https://api.travis-ci.org/criteo-cookbooks/nexus3.svg?branch=master

This cookbook installs and configures Sonatype Nexus 3 Repository 
Manager OSS according to 
https://books.sonatype.com/nexus-book/reference3/install.html

# Usage

Use the [nexus3](https://github.com/criteo-cookbooks/nexus3#nexus3) resource
to download and install the latest Nexus 3 Repository Manager OSS.

Use the [nexus3_api](https://github.com/criteo-cookbooks/nexus3#nexus3_api)
resource to configure Nexus 3 Repository Manager via its REST API.

Use the [nexus3_repo](https://github.com/criteo-cookbooks/nexus3#nexus3_repo)
resource to configure Nexus 3 repositories.

Use the [nexus3_group](https://github.com/criteo-cookbooks/nexus3#nexus3_group)
resource to configure Nexus 3 repository groups.

Use the [nexus3_user](https://github.com/criteo-cookbooks/nexus3#nexus3_user)
resource to configure Nexus 3 users.

Use the [nexus3_realm](https://github.com/criteo-cookbooks/nexus3#nexus3_realm)
resource to handle realm activation.

## Requirements
* Chef 12.14.34+
* ark cookbook
  * Note: `include_recipe 'ark'` is required for Windows servers, as it is not
    implicit.
* Java 8+ from Oracle or OpenJDK (not installed, pick your own)

### Platforms

- CentOS, RedHat, Fedora
- Debian, Ubuntu
- Windows

# Recipes

## default

Downloads and installs the latest Nexus 3 Repository Manager OSS.

### Attributes

- `node['nexus3']['version']` - The version of Nexus 3 to download. Default
  `3.2.1-01`.
- `node['nexus3']['url']` - The download URL of Nexus 3 Repository Manager.
  This can be a specific version of Nexus Repository Manager OSS or Nexus
  Repository Manager Pro. Default
  `http://download.sonatype.com/nexus/3/nexus-3.2.1-01-unix.tar.gz`.
- `node['nexus3']['checksum']` (optional) - The checksum of Nexus 
  Repository Manager. Default `nil`.
- `node['nexus3']['path']` -  Install directory.
  Default Linux: `/opt` Windows: `#{ENV['SYSTEMDRIVE']}`.
- `node['nexus3']['data']` -  Data directory. 
  Default `#{node['nexus3']['path']}/sonatype-work/nexus3`.
- `node['nexus3']['home']` -  Link to install directory. 
  Default `#{node['nexus3']['path']}/nexus3`.
- `node['nexus3']['properties_variables']` - A Hash of variables that are
  passed into a template file. Default `{ host: '0.0.0.0', port: '8081', args:
  '${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml',
  context_path: '/' }`.
- `node['nexus3']['vmoptions_variables']` - A Hash of variables that are
  passed into a template file. Note that data directory will be injected into
  the hash if it is not defined. Default `{ Xms: '1200M', Xmx: '1200M' }`.
- `node['nexus3']['nofile_limit']` - Limit of open files available for the
  Nexus3 service in systemd. Default 65,536 as suggested by the Sonatype
  documentation on newer releases.
- `node['nexus3']['outbound_proxy']` - Configure outbound HTTP/HTTPS proxy. See example
  'Configure outbound HTTP/HTTPS proxy for all the attributes.'

### Examples

#### Changing the HTTP Port and/or Context Path
The default value for the HTTP port used to access the repository manager user interface and resources is 8081.
To change HTTP Port to 8443, Context Path to /components/ and serve HTTPS directly set the properties_variables hash with the updated settings:

```ruby
include_recipe 'java_se'

node.default['nexus3']['properties_variables'] = { port: '8443', args: '${jetty.etc}/jetty.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-requestlog.xml', context_path: '/components/' }
include_recipe 'nexus3'<commit_msg>Updating the README<commit_after># Nexus3 Cookbook

[![Cookbook Version][cookbook_version]][cookbook]
[![Build Status][build_status]][build_status]

[cookbook]: https://supermarket.chef.io/cookbooks/nexus3
[cookbook_version]: https://img.shields.io/cookbook/v/nexus3.svg
[build_status]: https://api.travis-ci.org/criteo-cookbooks/nexus3.svg?branch=master

This cookbook installs and configures Sonatype Nexus 3 Repository
Manager OSS according to 
https://books.sonatype.com/nexus-book/reference3/install.html

# Usage

Use the [nexus3](https://github.com/criteo-cookbooks/nexus3#nexus3) resource
to download and install the latest Nexus 3 Repository Manager OSS.

Use the [nexus3_api](https://github.com/criteo-cookbooks/nexus3#nexus3_api)
resource to configure Nexus 3 Repository Manager via its REST API.

Use the [nexus3_repo](https://github.com/criteo-cookbooks/nexus3#nexus3_repo)
resource to configure Nexus 3 repositories.

Use the [nexus3_group](https://github.com/criteo-cookbooks/nexus3#nexus3_group)
resource to configure Nexus 3 repository groups.

Use the [nexus3_user](https://github.com/criteo-cookbooks/nexus3#nexus3_user)
resource to configure Nexus 3 users.

Use the [nexus3_realm](https://github.com/criteo-cookbooks/nexus3#nexus3_realm)
resource to handle realm activation.

## Requirements
* Chef 12.14.34+
* ark cookbook
  * Note: `include_recipe 'ark'` is required for Windows servers, as it is not
    implicit.
* Java 8+ from Oracle or OpenJDK (not installed, pick your own)

### Platforms

- CentOS, RedHat, Fedora
- Debian, Ubuntu
- Windows

# Recipes

## default

Downloads and installs the latest Nexus 3 Repository Manager OSS.

### Attributes

- `node['nexus3']['version']` - The version of Nexus 3 to download. Default
  `3.2.1-01`.
- `node['nexus3']['url']` - The download URL of Nexus 3 Repository Manager.
  This can be a specific version of Nexus Repository Manager OSS or Nexus
  Repository Manager Pro. Default
  `http://download.sonatype.com/nexus/3/nexus-3.2.1-01-unix.tar.gz`.
- `node['nexus3']['checksum']` (optional) - The checksum of Nexus 
  Repository Manager. Default `nil`.
- `node['nexus3']['path']` -  Install directory.
  Default Linux: `/opt` Windows: `#{ENV['SYSTEMDRIVE']}`.
- `node['nexus3']['data']` -  Data directory. 
  Default `#{node['nexus3']['path']}/sonatype-work/nexus3`.
- `node['nexus3']['home']` -  Link to install directory. 
  Default `#{node['nexus3']['path']}/nexus3`.
- `node['nexus3']['properties_variables']` - A Hash of variables that are
  passed into a file populated on each line with the following format: 
  'Key'='Value'.
  Default `{ 'application-host': '0.0.0.0', 'application-port': '8081', 'nexus-args':
  '${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml',
  'nexus-context-path': '/' }`.
- `node['nexus3']['vmoptions_variables']` - A Hash of variables that are
  passed into a template file. Note that data directory will be injected into
  the hash if it is not defined. Default `{ Xms: '1200M', Xmx: '1200M' }`.
- `node['nexus3']['nofile_limit']` - Limit of open files available for the
  Nexus3 service in systemd. Default 65,536 as suggested by the Sonatype
  documentation on newer releases.
- `node['nexus3']['outbound_proxy']` - Configure outbound HTTP/HTTPS proxy. See example
  'Configure outbound HTTP/HTTPS proxy for all the attributes.'

### Examples

#### Changing the HTTP Port and/or Context Path
The default value for the HTTP port used to access the repository manager user interface and resources is 8081.
To change HTTP Port to 8443, Context Path to /components/ and serve HTTPS directly set the properties_variables hash with the updated settings:

```ruby
include_recipe 'java_se'

node.default['nexus3']['properties_variables'] = { port: '8443', args: '${jetty.etc}/jetty.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-requestlog.xml', context_path: '/components/' }
include_recipe 'nexus3'
{'fraction_non_alphanumeric': 0.13727003730863244, 'fraction_numerical': 0.025730091341824263, 'mean_word_length': 4.88939393939394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '550851', 'n_tokens_mistral': 2715, 'n_tokens_neox': 2552, 'n_words': 729}