Using Maven for deployment

前端 未结 5 1518
小蘑菇
小蘑菇 2020-12-01 10:40

I have this task for the project with 4 nested subprojects using Maven:

  1. For each child: jar-up resource directory including project dependencies
  2. Move
5条回答
  •  情话喂你
    2020-12-01 11:30

    Maven is not really designed to deploy jars to a remote location; its main use is compiling and packaging artifacts. The assembly and dependency targets are primarily used to gather dependencies and files to package into an artifact.

    Having said that, maven does have a deploy goal which uses a component called wagon. This is primarily intended to deploy to a maven repository. There is a plugin called Cargo that can be used to deploy artifacts to a remote server, but that doesn't explode the jar contents by itself (it relies on the target app server to do all that). You might be able to extend the Maven Wagon functionality yourself.

    Also, it is possible to package a custom lifecycle, but that is getting into some pretty low level maven mojo (pun intended).

提交回复
热议问题