I followed the guide found here: https://github.com/wordnik/swagger-core/wiki/Java-JAXRS-Quickstart
Here is my POM:
<!-- SWAGGER -->
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jersey-jaxrs_2.10</artifactId>
<version>1.3.0</version>
</dependency>
The Annotations are found fine, so i am assuming the POM is working OK
For WEB.xml, I tried doing multiple things, following the guide:
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>
com.sun.jersey.spi.spring.container.servlet.SpringServlet
</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.thomsonreuters.ips.service;com.wordnik.swagger.jersey.listing</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
<!-- SWAGGER serverlet? -->
<servlet>
<servlet-name>JerseyJaxrsConfig</servlet-name>
<servlet-class>com.wordnik.swagger.jersey.config.JerseyJaxrsConfig</servlet-class>
<init-param>
<param-name>api.version</param-name>
<param-value>1.0.0</param-value>
</init-param>
<init-param>
<param-name>swagger.api.basepath</param-name>
<param-value>http://localhost:8080/{PROJECTNAME}</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
but this throws a wild error when i try to reach:
localhost:8080/{PROJECTNAME}/service/api-docs
HTTP Status 500 - java.lang.NoSuchMethodError: com.wordnik.swagger.annotations.ApiOperation.authorizations()Ljava/lang/String;
next I saw around the googleverse to modify the web.xml to the following:
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>
com.sun.jersey.spi.spring.container.servlet.SpringServlet
</servlet-class>
<init-param>
<param-name>api.version</param-name>
<param-value>2.0</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.thomsonreuters.ips.service;com.wordnik.swagger.jaxrs;</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
note the api.version and the new jaxrs init param.
when that happens, and i go to
http://localhost:8080/ScholarlyItemService/service/api-docs
i get no errors, but i do get useless webpage:
{"apiVersion":"0.0","swaggerVersion":"1.2"}