buluma.maven

Ansible Role Maven

This role helps you install and set up Apache Maven on your systems.

GitHub Version Issues Pull Requests Downloads
github Version Issues PullRequests Ansible Role

Example Playbook

This example shows how to use the role, taken from molecule/default/converge.yml, and it is tested after every update.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  pre_tasks:
    - name: Update apt cache
      ansible.builtin.apt:
        update_cache: true
      changed_when: false
      when: ansible_pkg_mgr in ('apt')

    - name: Install jdk 8 (apt)
      become: true
      ansible.builtin.apt:
        name: openjdk-8-jdk
        state: present
      when: ansible_pkg_mgr in ('apt')

  roles:
    - role: buluma.maven
      maven_version: '3.9.6'
      maven_install_dir: /opt/maven

    - role: buluma.maven
      maven_version: '3.3.9'
      maven_is_default_installation: false
      maven_fact_group_name: maven_3_3

The machine must be prepared in advance. In CI, this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  gather_facts: false
  become: true
  vars:
    - java_type: jdk
    - java_version: "8"

  roles:
    - role: buluma.bootstrap
    - role: buluma.core_dependencies
    - role: buluma.buildtools
    - role: buluma.java
      java_vendor: openjdk
      java_version: "11"

You can also find a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are defined in defaults/main.yml:

---
maven_version: '3.9.6'
maven_mirror: "http://archive.apache.org/dist/maven/maven-{{ maven_version | regex_replace('\\..*', '') }}/{{ maven_version }}/binaries"
maven_install_dir: /opt/maven
maven_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}"
maven_download_timeout: 10
maven_use_proxy: true
maven_validate_certs: true
maven_is_default_installation: true
maven_fact_group_name: maven

Requirements

State of Used Roles

These roles are used to prepare your system, but you can choose a different way to prepare your system.

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version
buluma.buildtools Ansible Molecule Version
buluma.core_dependencies Ansible Molecule Version
buluma.java Ansible Molecule Version

Context

This role is part of a set of compatible roles. You can check the documentation of these roles for more information.

dependencies

Compatibility

This role has been tested with these container images:

container tags
EL 8, 9
Fedora 39, 38
opensuse all
Ubuntu bionic, focal, jammy

The minimum required Ansible version is 2.12. Tests have been conducted on:

  • The previous version.
  • The current version.
  • The development version.

If you encounter any issues, please report them on GitHub.

Changelog

You can find the history of changes.

License

This role is licensed under Apache-2.0.

Author Information

The author is Shadow Walker.

Informazioni sul progetto

Install and configure Apache Maven on your systems.

Installa
ansible-galaxy install buluma.maven
Licenza
apache-2.0
Download
4.2k
Proprietario
DevOps Engineer