Ansible - Maven

Card Puncher Data Processing

About

Download a artifact from a Maven - Repository

Example

Download a fat jar

- name: Download the fat jar
  maven_artifact:
	group_id: com.example
	artifact_id: app
	version: latest
	classifier: all
	repository_url: 'http://127.0.0.1:8081/repository/maven-snapshots'
	username: 'admin'
	password: 'password'
	dest: '/opt/app/'
	state: present
	keep_name: yes
	mode: 'u=rw,g=r,o=r'
  register: maven_download

The registered variable would be:

"maven_download": {
	"artifact_id": "app",
	"changed": true,
	"classifier": "all",
	"dest": "/opt/app/com.example.app-0.0.1-SNAPSHOT-all.jar",
	"extension": "jar",
	"failed": false,
	"gid": 1002,
	"group": "group",
	"group_id": "com.example",
	"mode": "0644",
	"owner": "user",
	"repository_url": "http://127.0.0.1:8081/repository/maven-snapshots",
	"size": 17212826,
	"state": "file",
	"uid": 1004,
	"version": "latest"
}

Documentation / Reference





Discover More
Card Puncher Data Processing
Ansible - Http (Get_url, Uri)

Http request in Ansible



Share this page:
Follow us:
Task Runner