diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index c4b5272e89f..b8cdd8f1332 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -1,5 +1,4 @@ - + 4.0.0 @@ -14,6 +13,9 @@ HAPI FHIR - Deployable Artifact Parent POM + + + @@ -53,7 +55,6 @@ org.apache.maven.plugins maven-project-info-reports-plugin - ${maven_project_info_plugin_version} true @@ -61,7 +62,6 @@ org.apache.maven.plugins maven-javadoc-plugin - ${maven_javadoc_plugin_version} default @@ -110,7 +110,6 @@ org.apache.maven.plugins maven-source-plugin - ${maven_source_plugin_version} package @@ -123,7 +122,6 @@ org.codehaus.mojo license-maven-plugin - ${maven_license_plugin_version} first diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 9321d752cd0..42d61e7fd2d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -80,6 +80,12 @@ import ca.uhn.fhir.util.VersionUtil; public class RestfulServer extends HttpServlet implements IRestfulServer { + /** + * Requests will have an HttpServletRequest attribute set with this name, containing the servlet + * context, in order to avoid a dependency on Servlet-API 3.0+ + */ + public static final String SERVLET_CONTEXT_ATTRIBUTE = "ca.uhn.fhir.rest.server.RestfulServer.servlet_context"; + /** * Default setting for {@link #setETagSupport(ETagSupportEnum) ETag Support}: {@link ETagSupportEnum#ENABLED} */ @@ -517,6 +523,8 @@ public class RestfulServer extends HttpServlet implements IRestfulServer1.4-SNAPSHOT + javax.servlet - javax.servlet-api + servlet-api + 2.5 provided diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java index 0d509c2c204..ccf5d71bc52 100644 --- a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java @@ -36,7 +36,6 @@ import org.hl7.fhir.instance.model.api.IBaseResource; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.context.RuntimeSearchParam; -import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.resource.Conformance; import ca.uhn.fhir.model.dstu.resource.Conformance.Rest; import ca.uhn.fhir.model.dstu.resource.Conformance.RestQuery; @@ -156,7 +155,7 @@ public class ServerConformanceProvider implements IServerConformanceProvider1.4-SNAPSHOT test + + javax.servlet - javax.servlet-api + servlet-api + 2.5 provided diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu21/hapi/rest/server/ServerConformanceProvider.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu21/hapi/rest/server/ServerConformanceProvider.java index 31955d8e6ee..0fd2b658f59 100644 --- a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu21/hapi/rest/server/ServerConformanceProvider.java +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu21/hapi/rest/server/ServerConformanceProvider.java @@ -85,8 +85,10 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; * Server FHIR Provider which serves the conformance statement for a RESTful server implementation * *

- * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is always returned unless {@link #setCache(boolean)} is called with a value of - * false. This means that if you are adding anything to the returned conformance instance on each call you should call setCache(false) in your provider constructor. + * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is + * always returned unless {@link #setCache(boolean)} is called with a value of false. This means that if + * you are adding anything to the returned conformance instance on each call you should call + * setCache(false) in your provider constructor. *

*/ public class ServerConformanceProvider implements IServerConformanceProvider { @@ -101,22 +103,20 @@ public class ServerConformanceProvider implements IServerConformanceProvider includes = new TreeSet(); @@ -441,7 +443,7 @@ public class ServerConformanceProvider implements IServerConformanceProvidertest + javax.servlet - javax.servlet-api + servlet-api + 2.5 provided diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/ServerConformanceProvider.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/ServerConformanceProvider.java index 88293628b53..6262181a546 100644 --- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/ServerConformanceProvider.java +++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/ServerConformanceProvider.java @@ -206,7 +206,7 @@ public class ServerConformanceProvider implements IServerConformanceProvider1.4-SNAPSHOT test + + javax.servlet - javax.servlet-api + servlet-api + 2.5 provided - diff --git a/src/changes/changes.xml b/src/changes/changes.xml index b401982b527..adde6698c15 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -139,6 +139,12 @@ implementations and wasn't compatible with coming changes to that API. + + Remove dependency on Servlet-API 3.0+ by using methods available in 2.5 where possible. + Note that we continue to use Servlet-API 3.0+ features in some parts of the JPA API, so + running in an old serlvet container should be tested well before use. Thanks to Bill Denton + for reporting! +