Reputation: 6800
Is it possible to get a Java jar-with-dependencies using ansible
package maven_artifact
?
Now for a bit of a context:
mvn deploy
in a registry (in my case: Nexus)maven_artifact
package (I suppose it manages idempotence better then I would).Very logically, when I do this, I get the simple jar (without all dependencies) and not the jar-with-dependenices.
Upvotes: 2
Views: 3283
Reputation: 6800
Here's my vamp of the answer:
File organisation should be:
roles/fetch-my-awesome-jar/tasks/main.yml
And content:
---
- name: fetch my awesome jar
maven_artifact:
group_id: my.awesome.group.id
artifact_id: my-awesom-artifact-id
version: my.awesome.version.number
classifier: jar-with-dependencies
extension: jar
repository_url: http://my-local-nexus:<port>/repository/my-awesome-repo/
username: my-username
password: my-password
dest: my-awesome-target-directory
The version of maven_artifact
I'm using has removed the jar-with-dependencies
classifier.
Upvotes: 2
Reputation: 54467
You can do this with the following steps:
jar-with-dependencies
is uploaded to Nexus with a specific classifier
, e.g. full
. For more info on the classifier
, please check the Maven documentation.classifier
attribute to point to your full
artifact.Upvotes: 3