Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carlossg/ansible-maven-repo
Access artifacts in maven repo with ansible
https://github.com/carlossg/ansible-maven-repo
Last synced: about 1 month ago
JSON representation
Access artifacts in maven repo with ansible
- Host: GitHub
- URL: https://github.com/carlossg/ansible-maven-repo
- Owner: carlossg
- License: apache-2.0
- Created: 2014-12-20T08:57:47.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-20T09:41:01.000Z (almost 10 years ago)
- Last Synced: 2023-04-15T01:27:14.436Z (over 1 year ago)
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ansible-maven-repo
==================Download artifacts from Maven repositories with [Ansible](http://www.ansible.com/home).
# Prerequisites
Install [JDK and Maven](site.yml) using existing Ansible modules
ansible-galaxy install geerlingguy.java
ansible-galaxy install https://github.com/silpion/ansible-maven.git``` yaml
- hosts: localhostroles:
- { role: ansible-maven }
- { role: geerlingguy.java }vars:
java_packages:
- java-1.7.0-openjdk
```# Example
From [mvn.yml](mvn.yml), download any number of Maven artifacts optionally from different repositories
``` yaml
- hosts: localhostvars:
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`](https://registry.hub.docker.com/u/csanchez/ansible-maven/).# Building Docker image
docker build -t csanchez/ansible-maven .