Upgrade App Engine servlet-api-2.5 to servlet-api-3.1?

Chris Fremgen :

With the recent announcement of support for Servlet 3.1, I cannot figure out how to modify the App Engine Standard environment to use 3.1 instead of 2.5 in a non-Maven build.

It seems there is no way to upgrade to 3.1?

https://cloudplatform.googleblog.com/2017/06/Google-App-Engine-standard-now-supports-Java-8.html

SkyWalker :

Here is a full example given here: https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/appengine-standard-java8/helloworld

Running procedure is also attached.

For Gradle Users:

For non-maven users, you can use gradle.

In gradle build file, line number 39 denotes: https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/appengine-standard-java8/helloworld/build.gradle#L39

providedCompile 'javax.servlet:javax.servlet-api:3.1.0'

Running locally:

gradle appengineRun

If you do not have gradle installed, you can run using ./gradlew appengineRun.

To use visit: http://localhost:8080/

For Maven Users

In pom.xml, line number 62 to 70 denotes that it is using servlet version 3.1.0: https://github.com/GoogleCloudPlatform/getting-started-java/blob/master/appengine-standard-java8/helloworld/pom.xml#L66

<!-- [START servlet] -->
<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
  <type>jar</type>
  <scope>provided</scope>
</dependency>
<!-- [END servlet] -->

Hope it will clarify you.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=442339&siteId=1