This is a copy of the web.xml needed to run Jetty successfully both as
jetty embedded and as a maven plugin. mvn jetty:run
The most important setting is
metadata-complete="false"
Please look into the effects of metadata-complete="false" or metadata-complete="true"
With this setting metadata-complete="false" one can use web.xml
set the welcome file to any name
the annotations will be turned on.
The original FAULTY archetype is this one. found here in eclipse documentation
https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest3x/getting-started.html#deploy-it-on-heroku
mvn archetype:generate -DarchetypeArtifactId=jersey-heroku-webapp \
-DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=
false
\
-DgroupId=com.example -DartifactId=simple-heroku-webapp -Dpackage=com.example \
-DarchetypeVersion=3.0.1
<!--web.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.example</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
</welcome-file-list>
</web-app>
https://lit-taiga-52898.herokuapp.com/