Reputation: 21
My team is working on a Java application that runs on Jboss WildFly, using Maven to resolve dependencies and Primefaces.
We're using Eclipse to build, deploy and run the server. Eclipse does most of the work, building the WAR file, deploying it to server and running it.
Now we need to create an script that performs all those steps because it has to run on remote server.
.
The steps would be something like this...
1 Run Maven: $M2_HOME/bin/mvn clean install
2 Build project to a war file
3 Deploy war file into the WildFly deployment folder $WILDFLY_HOME/bin/jboss-cli.sh --connect --command="deploy --force [PATH_TO_WAR]"
4 Start server $WILDFLY_HOME/bin/standalone.sh
.
I can perform every step but once the server is running it don't seem to be any changes in the application. I think this is because the WAR file has to be built optimizing it for JBoss. Eclipse has a way to do this when exporting the project. I need to know how to do that from command.
EDIT:
The real problem is that Jboss is not updating the published project when i run it from bash script. I thought it was because i had to build it on a specific way. I was wrong. The build is fine, just running Maven the deploy is done. The thing is that even if i rebuild project and redeploy it, server doesn't seem to notice at all.
I've tried deleting tmp, lib and data folders from standalone folder, and nothing happens. I also deleted standalone/deployed sub files and folders and got the same result.
The only way i achieve the result i'm expecting is getting into Eclipse, go to Servers tab, right click on JBoss Wildfly and click on 'Clean...'. This options seems to clean cache, rebuild and re publish the application in a right way that i don't know. I didn't find any answers on google.
Upvotes: 2
Views: 2503
Reputation: 4959
Give a look on Eclipse war export: optimize for a specific server runtime.
Quoting from @Konstantin Komissarchik's answer :
Eclipse itself doesn't do anything with that option. What happens is dependent on a particular server adapter. Many of the adapters don't do anything with this option either, but they might in the future.
If a server adapter does support export optimization, it has the option of displaying custom options beneath that pop-up list of runtimes, so that's a good cue to use to see if something will actually happen.
So taking in consideration that in your provided image there is no custom options below Wildfly 9 selection, I am pretty sure that this option does not perform any optimization at your exported war so you can totally omit it in your new build-deploy process.
How can i build the war file from command, knowing it will have to run on Wildfly?
We are also deploying applications for a long time on several versions of Widlfy with the same approach as you are planning to, without the optimization thing. I can ensure you that we have not faced any performance issue.
Upvotes: 2