Reputation: 8420
I have a local installation of JBoss AS 7, which has a standalone.xml file containing my custom set-up. I have a maven project containing an ear package at it's top level. When I do a mvn clean install
of my project (having linked the run goal of jboss-as-maven-plugin to install phase), the first time it is run, the ear installs only once. However the second time it is run, the ear is deployed twice, sometimes breaking the server, other times simply replacing the other ear.
One thing I have noticed is that when I run mvn clean install
, the standalone.xml file in the jboss configuration folder gets this appended to the end of the document:
<deployments>
<deployment name="thenaglecode.ear" runtime-name="thenaglecode.ear">
<content sha1="92674bc0f2845e3e0eb18cead70be20fb52596f8"/>
</deployment>
</deployments>
When I delete it, it goes back to only deploying once and re-generates this section. Afterwards it then deploys twice.
I do not wish to remove this part everytime i wish to redeploy. does anyone know how to ensure that the ear is only deployed once? Is this a bug with the jboss maven plugin?
Please let me know what other information you would like. I would really appreciate any support. Thank you.
Upvotes: 0
Views: 1261
Reputation: 17760
It's because the deploy
goal forks the package
lifecycle. If you want execute this as part of your build cycle I would suggest using the deploy-only
goal. This goal does not fork the lifecycle and should only execute once.
Upvotes: 4
Reputation: 847
Have you tried using the redeploy goal instead?
http://docs.jboss.org/jbossas/7/plugins/maven/latest/redeploy-mojo.html
Upvotes: 1