How to deploy gradle spring boot java war application into app engine standard (not flex env) - spring-boot

I have a project and I don't want to use AppEngine flex as they are expensive. So I converted my project to standard by converting spring boot application from jar to war
When I try to deploy the project to the app engine it is picking app.yaml rather appening-web.xml and deploying as a flex project rather standard.
Did anyone face the same?

Make sure your appengine-web.xml file is under the src/main/webapp/WEB-INF directory. Your structure should look lke this:
For more detailed information about the App Engine Standard configuration files for Java please check this documentation. You can also check the steps in this GitHub page on how to deploy a Spring Boot simple Hello World app in App Engine Standard.

Related

Deploy spring boot applications

I know spring boot applications can be deployed to production environments as war files. But what is the typical way of deploying spring boot applications? Does it only require a jvm, not a container?
The Spring Boot Project Page states that Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
Means by default, the Spring Boot maven or gradle plugin builds self-contained executable jars, that contain all dependencies and an embedded webserver, e.g. tomcat or jetty. The Spring Boot Getting Started doc gives you an introduction to that. Using this approach you just need a JVM to run your application. But you can also configure it to create war files if this is a better fit to your production environment.
Does it only require a jvm, not a container?
It can run anywhere Java is setup.
Spring Boot's use of embedded containers and why Spring chose to go the container-less route. Many of their main driving forces were ease of use while testing and debugging, and being able to deploy Spring-based Java applications to the cloud, or any other environment.
Rest can be found out in attached image.
Spring boot applications if they are serving web requests do require a container. You can either deploy them as a war inside a container such as tomcat/jetty. Or you can deploy them with embedded container, tomcat.

Spring Boot Gradle - avoid lib-provided folder in war file

I have a Spring Boot based application and I'm trying to switch over from Maven to Gradle. The application is supposed to build a war file, which is deployed to a web server (WildFly in our case).
Now, I have some libraries provided by the web server and thus using a "providedCompile" scope (For hibernate search and infinispan). Now, when used with Spring Boot plugin, the plugin is creating the war file with all the "providedCompile" libraries moved to a folder named "lib-provided".
How do I avoid this? On the same context, it is also adding the Spring Boot loader classes on to the war file. If possible, I need to avoid this too.
Please help! Thanks!
If you're only ever going to deploy your application as a WAR file to an app server, then you don't need it to be turned into an executable archive. You can disable this repackaging in your build.gradle file:
bootRepackage {
enabled = false
}

Spring Boot 1.2.4.RELEASE cannot generate a simple Startup Project

I am using Spring Boot version 1.2.4.RELEASE to generate a simple web project. The full Url for creating this project is:
http://start.spring.io/starter.zip?name=demo3&groupId=org.test&artifactId=demo3&version=0.0.1-SNAPSHOT&description=Demo+project+for+Spring+Boot&packageName=demo3&type=maven-project&packaging=jar&javaVersion=1.7&language=java&bootVersion=1.2.4.RELEASE&dependencies=web
The download starter project opened in the STS 3.6.4.RELEASE with tons of errors: Missing artifact, ArtifactDescriptorException from the pom.xml file.
However, if I use version 1.1.12.RELEASE of the Spring Boot, I have no problem to create the startup project.
Is this a bug in the 1.2.4.RELEASE of the Spring Boot? I doubt it.
The project is OK.
Please to check your local env, specially connexion, maven configuration (setting.xml), ...etc
Good luck

Can Spring Boot + Gradle generate a war file compatible with Servlet 2.4?

I've been reading about using Spring Boot and Gradle to quickly build RESTful services: https://spring.io/guides/gs/rest-service/. I'd like to give it a try but I need to build a war that's compatible with servlet 2.4 (I know.. life in the 1970's).
The error I get when attempting to deploy the war generated by following the guide above to Sun App Server 8.1 is:
Unknown deployable object type specified: "Cannot determine the J2EE
component type"
The generated war has no web.xml and there may be other expected artifacts.
Configuring a spring-boot application using web.xml seems to suggest that a web.xml can be packaged with a Spring Boot application but doesn't explain how.
Is Spring Boot compatible with older servlet specs? How can Spring Boot and Gradle be used to generate a war that works on older web containers?
Thanks.
The answer to the question you linked to didn't actually go as far as saying that you could easily create a fully-leaded Boot application with Servlet 2.4. I consider that quite a hard, but probably achievable, target if you are prepared to do some legwork, and accept some compromises. You might find this stuff useful: https://github.com/scratches/spring-boot-legacy (I managed to use it to push an app to GAE). But there are some limits to what can be supported for such old technology, and we aren't officially supporting anything other than Servlet 3.0.1 right now.

deploy web app in jar

I have a problem: I need to create a jar from a web application (I'm using freemarker) and then refer this jar from within a different war.
In practice I need to follow the spring batch admin approach.
How can I do it?
I'm using spring for the first web app.
Many thanks

Resources