HUB
Sign inSign up
ansible-maven logo

csanchez/ansible-maven

By csanchez

•Updated about 11 years ago

Image
0

1.3K

csanchez/ansible-maven repository overview

⁠ansible-maven-repo

Download artifacts from Maven repositories with Ansible⁠.

⁠Prerequisites

Install JDK and Maven⁠ using existing Ansible modules

ansible-galaxy install geerlingguy.java
ansible-galaxy install https://github.com/silpion/ansible-maven.git
- hosts: localhost

  roles:
    - { role: ansible-maven }
    - { role: geerlingguy.java }

  vars:
    java_packages:
      - java-1.7.0-openjdk

⁠Example

From mvn.yml⁠, download any number of Maven artifacts optionally from different repositories

- hosts: localhost

  vars:
    mvn_artifacts:
      - id: org.apache.maven:maven-core:2.2.1:jar:sources
        dest: /tmp/test.jar
        # params: -U # update snapshots
        # repos:
          # - http://repo1.maven.apache.org/maven2
      
  tasks:
    - name: copy maven artifacts
      command: mvn {{ item.params | default('') }} org.apache.maven.plugins:maven-dependency-plugin:get -Dartifact={{ item.id }} -Ddest={{ item.dest }} -Dtransitive=false -Pansible-maven -DremoteRepositories={{ item.repos | default(['http://repo1.maven.apache.org/maven2']) | join(",") }}
      with_items: mvn_artifacts

⁠Docker

An image with Ansible, JDK and Maven preinstalled is available at csanchez/ansible-maven⁠.

⁠Building Docker image

docker build -t csanchez/ansible-maven .
Tag summary
Recent tags
Content type
Image
Digest
sha256:2e169900a…
Size
326.9 MB
Last updated
about 11 years ago
docker pull csanchez/ansible-maven:latest