Maven: how to copy artifact to specific directory?

前端 未结 4 883
北海茫月
北海茫月 2021-01-01 11:33

The \"install\" goal copies the artifact to the target directory and to the local repository.

How can I tell Maven to copy it also to a given directory

4条回答
  •  温柔的废话
    2021-01-01 11:45

    The goal copy of maven-dependency-plugin does what you want, see the example.

    It is however not a good idea to copy anything outside your target directory (or ${project.build.directory} to be precise) - especially if such action is attached to a build phase, because it introduces unexpected side-effects of the build, and sometimes even loss of reproducibility.

    As @Andreas_D notes, there is a better alternative for JBoss deployment purpose; similarly for deploying to other appservers.

提交回复
热议问题