Manage installation for multiple Java versions via jenv. Also provides a set of lightweight resources and providers.
If you've used rbenv or pyenv, this is a port of that concept for Java.
apt
git
Key | Type | Description | Default |
---|---|---|---|
['jenv']['user'] | String | Default user | jenv |
['jenv']['user_home'] | String | User home | /home/jenv |
['jenv']['manage_home'] | Boolean | Manage home | true |
['jenv']['group'] | String | Group to used | jenv |
['jenv']['group_users'] | Array | User in the group | [] |
['jenv']['root_path'] | String | Path to install jenv | /opt/jenv |
['jenv']['create_profiled'] | Boolean | Create file in profile.d | true |
['jenv']['git_force_update'] | Boolean | Force update jenv git repository | true |
['jenv']['git_repository'] | String | Git repository for jenv | https://github.com/CHH/jenv.git |
['jenv']['git_reference'] | String | Git reference for the git repository | master |
This resource installs a specified version of Java.
Action | Description | Default |
---|---|---|
:install | Build and install a Java version. | Yes |
Attribute | Description | Default Value |
---|---|---|
version | Name attribute: the name of a Java version (e.g. `6`) | nil |
user |
A users's isolated jenv installation on which to apply an action. The default value of nil denotes a system-wide jenv installation is being targeted. Note: if specified, the user must already exist.
|
nil |
root_path |
The path prefix to jenv installation, for example:
/opt/jenv .
|
nil |
environment | A hash of environment variables to set before running this command. | nil |
jenv_install '6' do
action :install
end
jenv_install '6'
Note: the install action is default, so the second example is a more common usage.
This resource is a wrapper for the script
resource which wraps the code block in an jenv
-aware environment.
See the Opscode script resource documentation for more details.
Action | Description | Default |
---|---|---|
run | Run the script | Yes |
Attribute | Description | Default Value |
---|---|---|
name | Name attribute: Name of the command to execute. | name |
jenv_version | A version of Java being managed by jenv. | nil |
root_path |
The path prefix to jenv installation, for example:
/opt/jenv .
|
nil |
code | Quoted script of code to execute or simply a path to a file to execute in jenv context. | nil |
creates | A file this command creates - if the file exists, the command will not be run. | nil |
cwd | Current working directory to run the command from. | nil |
environment | A hash of environment variables to set before running this command. | nil |
group | A group or group ID that we should change to before running this command. | nil |
path | An array of paths to use when searching for the command. | nil , uses system path |
returns | The return value of the command (may be an array of accepted values) this resource raises an exception if the return value(s) do not match. | 0 |
timeout | How many seconds to let the command run before timing out. | nil |
user |
A users's isolated jenv installation on which to apply an action. The default value of nil denotes a system-wide jenv installation is being targeted. Note: if specified, the user must already exist.
|
nil |
umask | Umask for files created by the command. | nil |
jenv_script 'HelloWorld' do
jenv_version '6'
user 'deploy'
group 'deploy'
cwd '/opt/shared'
code 'HelloWorld'
end
This resource sets the global version of Java to be used in all shells.
Action | Description | Default |
---|---|---|
create | Sets the global version of Java to be used in all shells. | Yes |
Attribute | Description | Default Value |
---|---|---|
jenv_version | Name attribute: a version of Java being managed by jenv. Note: the version of Java must already be installed but not installed it automatically. | nil |
user |
A users's isolated jenv installation on which to apply an action. The default value of nil denotes a system-wide jenv installation is being targeted.
Note: if specified, the user must already exist.
|
nil |
root_path |
The path prefix to jenv installation, for example:
/opt/jenv .
|
nil |
jenv_global "6"
jenv_global 'system'
jenv_global '7' do
user 'bamboo'
end
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Authors:
- Pierre Rambaud ([email protected])