Use a PlantUML Server
Steps
Make a PlantUML server generate the diagrams of the wiki instead of XWiki itself. To decide whether you need one, read PlantUML.
- Install a PlantUML server that XWiki can reach, for example with Docker:
docker run -d -p 8081:8080 plantuml/plantuml-server:jetty - Add the domain of the server to the trusted domains in xwiki.properties, and restart XWiki:
url.trustedDomains=plantuml.example.com - Open the wiki administration, go to the "PlantUML" section, added by the PlantUML Administration extension, enter the URL of the server in "PlantUML Server" and click "Save".

- View a page holding a PlantUML diagram. The diagram is generated by the server.

FAQ
Can I set the server in xwiki.properties instead?
Yes, with the plantuml.server property, described in Configuration Properties.
Why does the macro display "is not in the list of trusted domains"?
The domain of the server is missing from url.trustedDomains (step 2). The domains of the wiki itself are always trusted.
Why is the server I configured not used?
The configuration was last saved by a user who is not a wiki administrator, so it is ignored, as explained in PlantUML, and the "PlantUML" section is no longer displayed. As a wiki administrator, edit the hidden page PlantUML.PlantUMLConfig with the object editor and save it.
Why does the macro display "Unexpected response status"?
The server answered with an error. Check that its URL opens the PlantUML server page in a browser.
How do I go back to generating diagrams in XWiki?
Empty the "PlantUML Server" field and click "Save".