Miquel
Miquel

Reputation: 15675

With the maven assembly plugin, how can I copy an artifact to a directory?

I have an assembly descriptor that copies project modules, dependencies and even files to my release folder, and this is fine. One of the files I'd like to copy, however, is in fact an artifact identifiable with maven coordinates.

The question: Is it possible to specify a file in an assembly fileSet or files stanza by using maven coordinates (groupId:artifactId:version)? And if not, what would be an equivalent way of achieving this?

Finally, the artifact I want to copy is not a dependency of my project, so I cannot use filtered dependencySet. This also distinguishes this question from this one

Upvotes: 4

Views: 1226

Answers (2)

hami
hami

Reputation: 443

You can use the dependecy plugin and the get goal.

http://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html

Upvotes: 2

Henry
Henry

Reputation: 43728

I would use the maven-dependency-plugin (in particular the copy goal) to fetch the external artifact and then use the assembly plugin to package it.

Here is the documentation of the plugin

Upvotes: 1

Related Questions