This is follow up based on this answer.
I have a structure that looks like
$ ls service/target/
classes lib maven-status
You can use maven-assembly-plugin
to do that task.
Create an assembly definition file in src/assembly/distribution.xml
distribution
tar
${project.build.directory}/lib
lib
In pom.xml
file, add plugin declare, execution phase and goal for it.
maven-assembly-plugin
2.5.5
${project.basedir}/src/assembly/distribution.xml
make-assembly
package
single
More format file or customize of maven-assembly-plugin
can be found here: https://maven.apache.org/plugins/maven-assembly-plugin/