5

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

Olivier J.
  • 3,115
  • 11
  • 48
  • 71

3 Answers3

0

You can try as folowing:

mvn glassfish:redeploy
aberes
  • 297
  • 1
  • 6
0

Tried to do this :

<configuration>   
  <force>true</force>
  ...
</configuration>

That would work if you were using version 2.2 of the maven glassfish plugin. But there's some bad news:

  1. Unfortunately, 2.2 has not been released and active development on the plugin seems to have stopped a while ago (it's been over 3 years since the code was updated). So we're unlikely to see a release of version 2.2
  2. The repository hosting the snapshot version doesn't seem to be up either, so you can't even play with the unreleased snapshot version (unless you download the source for version 2.2-SNAPSHOT and try to build it yourself).

how can I deploy both time the same application using deploy goal without removing first application with same name

Using the Maven Glassfish Plugin? You can't.

Instead, you might like to look at something which lets you directly execute asadmin commands instead so you can manually pass in the --force option:

Community
  • 1
  • 1
Ryan Bennetts
  • 1,143
  • 2
  • 16
  • 29
0

I postd a solution here Redeploy remote glassfish with cargo fails using maven glassfish plugin and modifying asadmin.bat

Community
  • 1
  • 1
Juan Pablo G
  • 879
  • 8
  • 8