I have built some POM file to deploy an EAR to Glassfish V3.
It's work well for first deployment but the next deployment, it's crashed :
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:/Documents and
Settings/Olivier/Local Settings/Temp/mgfp8179073735921963426.tmp --interactive=false --echo=true --terse=true d
eploy --name sim --force=false --precompilejsp=false --verify=false --generatermistubs=false --availabilityenabled=false --asyncreplication=true --keepreposdir=false --keepfailedstubs=false --isredepl
oy=false --logreportederrors=true --upload=false "E:\\workspaces\\java\\sim_final\\ear\\target\\ear-0.0.1-SNAPSHOT.ear"
[ERROR] remote failure: Erreur lors du dÚploiementá: L'application portant le nom sim est dÚjÓ inscrite. SpÚcifiez que le redÚploiement doit Ûtre forcÚ ou redÚployez l'application. Sinon, s'il s'agit
d'un nouveau dÚploiement, choisissez un nom diffÚrent. Pour plus d'informations, consultez le fichier server.log.
To summarize, I can deploy once but not both times.
This is because as you can see, the force parameter is set to false (--force=false) so an application already exists with this name and it's not deployed another time.
Probably, if I did an undeploy goal followed by an deploy goal this would work but I'm quite sure that I can configure deploy goal (to make a hot deploy on Glassfish) to set force parameter to true but I can't find the way to do it.
Tried to do this :
<configuration>
<force>true</force>
...
</configuration>
but the generated script contains --force=false again.
So my question is : how can I deploy both time the same application using deploy goal without removing first application with same name ?
Thank you
Olivier