poniedziałek, 11 marca 2019

How to build a maven JAX-RS project (to WAR) without web.xml

In the standard way the build process of the JAX-RS maven project will throw an error like:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project rest: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
To run the build properly you simply need to add the following section to the pom.xml: