Thufir
Thufir

Reputation: 8497

How can I deploy a WAR file to Wildfly?

In relation to deploying a WAR file to Wildfly, where should the file be copied to?

I don't see where the file is:

thufir@dur:~/java/wildfly$ 
thufir@dur:~/java/wildfly$ tree wildfly-17.0.0.Beta1  | grep wildflyMaps.war
│       └── wildflyMaps.war
thufir@dur:~/java/wildfly$ 

seems to be exploded for deployment:

  1. Re: Can't see the .war after deploy ehugonnet Apprentice ehugonnet 21-Aug-2017 2:47 AM (in response to Claudio Miranda)

During runtime the enabled war files are exploded by vfs in the tmp directory. Those files will be deleted on stop / restart / disable.

The reference content is in the content data directory for recreating the tmp files.

Upvotes: 2

Views: 26215

Answers (1)

achAmháin
achAmháin

Reputation: 4266


Standalone mode


The standard location for deployments in standalone mode is Wildfly_Home/standalone/deployments so you can copy your war to that folder via Java or any other means. It will deploy then upon starting the server. And actually it will auto-deploy even while Wildfly is running (and if not, just create a file and call it wildflyMaps.war.dodeploy).


Domain mode


With this, you can't just copy a war file to a directory. It can be done via the cli, but easier is to log on to the management console and go to the deployments section.

Once deployed, if you open up the domain.xml, you'll see something like this:

deployments
    deployment name="wildflyMaps.war" runtime-name="wildflyMaps.war"
             content sha1="d991471f79045413a7c63b8c2b5d4dc345be8808"/
        /deployment
/deployments

And using the above example, you'll find the deployed file at:

Wildfly_Home/data/content/d9/91471f79045413a7c63b8c2b5d4dc345be8808

and in there has a file called content. Copy that elsewhere and rename it as anything.war and you can open it and see that it is the war that you deployed.

Upvotes: 8

Related Questions