Deploy a spring boot JAR to Azure Web Services with Gradle - spring

I prefer to use gradle with Spring Boot. I have found resources about deploying to Azure with the Maven Plugin for Azure App Service Web Apps. How would one take an approach with gradle as a build system?

Well you need to separate deployment and build.
You can use Azure build pipeline task to build with gradle.
Part of that build you can create artifacts which contains your app
Then create release which will deploy jars to azure app service

Related

External Custom library for Gradle project

I am building a SpringBoot application in which i want to handle some of the cross cutting concerns like logging, caching, persistence in to a project on its own so in future other rest spring boot components can adopt it and use it as a dependency.
I am using Gradle for dependency management. My question is :-
How can i manage this concerns without publishing it to the public artifactory.
If i have to publish then which is the free artifactory i can use for my development practice
If creating jar is an option as a temp solution then how can it be achieved via gradle. Most of the examples over the internet is for creating the executable jar files.
What are the other options i can try.
How can i manage this concerns without publishing it to the public artifactory.
Publishing has to happen regardless where it will be published to. You can use a private solution such as Nexus Repository.
If i have to publish then which is the free artifactory i can use for my development practice
For development, you can simply publish to your local Maven repository. This is typically ~/.m2. Using the Maven Publish plugin, you can easily publish locally by invoking the publishToMavenLocal task.
If creating jar is an option as a temp solution then how can it be achieved via gradle. Most of the examples over the internet is for creating the executable jar files.
Since you're creating a Spring Boot library, use the Java Library plugin to create the JAR artifact and in combination with the Maven Publish plugin to publish.
In the end, there are 2-3 key components that get published when using Gradle:
JAR artifact
pom.xml: https://maven.apache.org/pom.html
Gradle Module Metadata: https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html

Azure Devops pipleline for Maven/Rest Assured project

I am new to azure devops. I have created a Rest Assured project using TestNG and Maven Dependencies. I am able to build it successfully on my local as a Maven Project. Can I create a CI\CD pipeline on Azure DevOps instead of creating on Jenkins. My project specifically requires to create Azure pipelines. I have also successfully created and build the Azure pipeline for a simple Maven project but when I try to create for Rest Assured with Maven something fails. is there any specific settings required for Rest Assured or it should be same as any Maven project-
Build error
I was able to create azure pipeline for Maven Rest Assured project. We need to select the host as Windows host( if we are working on Windows) and then download and setup the respective agent on our local machine. We can then create the build definition for Maven build using classic editor and select the respective pom.xml

how to use command line to deploy a war to gcp

I know we can use the maven plugin to deploy the application to GCP. E.G
mvn appengine:deploy
But for certain reason, I would like to deploy the application not from the source code, but from artifacts repository (like Nexus).
What I want to do is to fetch the war from Nexus and use some command line to deploy the war to GCP. Anyone know how to?
I didn't find a way to do it but if you are interested in such functionality, you can use Cloud Source Repositories, which provides private Git repositories hosted on GCP.
You can use them to deploy in App Engine and even automate the process.
If you need to specifically use Nexus, you could file a feature request for App Engine.

Creating an enterprise maven application using spring-boot

We have a specific requirement that only Enterprise Archive (EAR) should be deployed on our application server (Web Logic).
Can spring-boot be used for such type of Enterprise applications?
As spring-boot provide an inbuilt Jetty/Tomcat server, can I use the jar/war to be deployed on Web Logic application server?
Also we have some external dependencies (not from maven central)
which have to be included in the pom. Does that impact spring-boot
configurations?
Of course it can - as Spring itself. You can read about it here http://www.virtual7.de/blog/2016/07/spring-boot-oracle-weblogic-server-12/
Yes, here is the instruction how to do it: http://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html
It depends what are those dependencies. There could be some conflicts, but any conflict can be resolved somehow :)

How to deploy a SpringBoot Application to Google App Engine?

How to deploy a SpringBoot REST Application to Google App Engine and intelij
I try follow this tutorial:
https://www.youtube.com/watch?v=751iGaVX2Rc
but in some point I got:
Requested Resource is not available
It is described here:
http://nixmash.com/java/deployable-wars-in-spring-boot-intellij-and-gradle/
What is best way to deploy app to:google app engine?
Use App Engine Maven Plugin
add App Engine Maven Plugin and run this comand line:
appengine:deploy
Stages and deploys an application to App Engine.
https://cloud.google.com/appengine/docs/flexible/java/maven-reference
here is tutorial
https://cloud.google.com/tools/intellij/docs/deploy-flex

Resources