Maven: Local Deployment Deployment and Distribution Packages

Bear with me, I am moving from Ant to Maven2: I think I hit one of those little things that were easy in Ant, but not so in Maven ...

How do I handle the difference between a local deployment and creating an archive / package for distribution on another machine?

Suppose my project is an EAR plus some additional configuration files. DeveloperIf you are actively working on a project, you will often need to deploy and redeploy your local application server (say, JBoss), and the Integration Engineer who builds for QA / production will only need to create the final archive assembly (tar / gz).

Ant had two goals for this: "dev-deploy" and "bundle". Both do the full assembly, but differ in the last step: "dev-deploy" copies the EAR and configuration files to the corresponding local folders, and "bundle" simply puts the EAR and configuration files into the tar.gz assembly.

How do you do this in Maven?

I saw that an assembly plugin can create either archives (tar, gz, etc.) or exploded directories (from the same assembly descriptor). I can call either assembly: assembly or assembly: directory, but for the latter, how to copy the final result into local JBoss deployment folders? From a linked post, it seems that ad-hoc copying files is not really what Maven is talking about, so is probably the most suitable copy of antrun?

, , , , ? , "mvn package", "mvn assembly: directory", . , - "mvn package", "mvn assembly: assembly" . , script ?

+3
1

Ant : "dev-deploy" "bundle" . , : "dev-deploy" EAR , "bundle" EAR tar.gz.

, "dev-deploy" , , mvn pacakge, "bundle" maven assembly.

, (tar, gz, ..), ( ). : : , , JBoss? , ad-hoc- , Maven, , , antrun?

, Integration Engineer . , "", ( , JBoss QA/production , ), , / antrun. , /// , maven antrun .

, , , , ? , "mvn package", "mvn assembly: directory", . , - "mvn package", "mvn assembly: assembly" . , script ?

, . ? ... , , . maven , , single directory-single mojos . ( , ).

+4

Source: https://habr.com/ru/post/1726072/


All Articles