So I have a parent maven project with a few child modules. All child projects generate jars and have dependencies. As part of the package phase, following are done
- Compiled jars are copied to a
libdirectory - Dependencies are copied to a
extlibdirectory - A
tar.gzpackage is created in the end (I am worried about the order as assembly is done in parent while copy is done in child project poms)
Once packaging is complete, I want to install the package on a remote server, so I have then antrun plugin which takes care of it, inside install phase.
The problem is that I cannot control the order in which things are done. I would like to keep the responsibilities separate but if I run the command: mvn clean package install, it will run the install phase first which I think is because it is part of parent pom deployment which is done first. I have to run it in two commands i.e. mvn clean package and then mvn install to make sure latest is deployed.
Is there anyway to run this install phase at the end when packaging is done?
.tar.gzyou have to add a supplemental child module which has the dependencies to the parts you would like to add. Apart from that usingmvn clean package installduplicates several steps... usingmvn clean installinstead... And usinginstallto make a deployment to a remote server is a wrong way using Maven. install is intended to install artifacts into local cache and deploy is intended to transfer to remote repo...