Question

I have a doubt about these 2 plugins, specifically with <outputDirectory/> (maven-war-plugin) and <copy file="origin" todir="destination"/> (maven-antrun-plugin)

I want to generate the war for the project and then copy that file to a hot deploy directory. Strictly in this sequence, So the question is:

  • outputDirectory, indicates where the generation happens? or the war is generated in project.build.directory and then copied to the indicated directory.

Basically I want to determine which of the 2, suits best my requirements.

Était-ce utile?

La solution

I would suggest using the 'deploy' phase to invoke this copying.

As to what actually does the copying, there are plugins that cater to this use case, such as the cargo maven plugin which can deploy artifacts to running containers. This abstracts out the physical directory structure.

The war plugin is more intended to create the war in the first place, and you might not guarantee what state it is in when it is picked up by a container.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top