Easiest way to version the API is including version number as part of the URI during the development.
/commonPath/v1.0
/commonPath/v1.1
Your code would then become like this
@GET
@Path("/commonPath/v1.0")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response getMethoV1(RequestDto1 reqDto) {
//logic
}
@GET
@Path("/commonPath/v1.1")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response getMethoV2(RequestDto2 reqDto) {
//logic
}