Request A Demo
Back to All Blog Articles

Spring into FlexDeploy 3.0 with Git & Maven

Maven makes distributing software easy with automated dependency injection. With FlexDeploy 3.0, the Maven plugin, and a Spring project, you are only minutes from deploying a sustainable app to your Tomcat server. Let’s take a look at how we can set up the workflow and project to build the Spring Pet-Clinic sample, from https://github.com/karlhenselin/spring-petclinic. This tutorial assumes that you already know the basics of FlexDeploy, and focuses on the new features: the Maven plugin and Git SCM integration.

First, create a new Git SCM instance for the Pet Clinic App.

  1. Create a name for the SCM Instance.
  2. Enter the data for the Git repository (If you don’t have a Github account, any email and any password will work for a clone from this repository)
  3. Click Test to verify that the data was entered properly.

Spring Maven - Git Instance  

 

If you don’t already have a build Instance configured with Git, you need to do that. Make sure to install version 1.7.6 or newer. Additional features of FlexDeploy also unlock if Git is also installed on the FlexDeploy server machine, but they are not needed for this tutorial.

Next, setup a build workflow.

This workflow will be very reusable. It should work for any Git + Maven build that you create in the future, so choose a name like Git Maven.

  1. Drag in the operation cloneProjectSources  from the Git Plugin. There is nothing to configure on the plugin.
  2. Drag in the operation runMaven from the Maven Plugin.
  3. For FDMVN_PROJECT_LOCATION choose Groovy Script and enter FD_PROJECT_NAME.
  4. For FDMVN_RUN_PHASES enter install package.

Spring Maven - Invoke Maven Step

Next, drag in the file plugin operation saveArtifacts.

To make the code reusable, I suggest the following inputs:

For FDFILE_INP_SOURCE_SUBFOLDER, choose Groovy Script and enter FD_PROJECT_NAME + “/target”

For FDFILE_INP_FILE_FILTER, enter *.war##*.ear to select whatever compiled web packages are present.

Spring Maven - Invoke save Aritfacts

Activate the WorkFlow.

Next, let’s setup the project.

Create a project with this configuration:

SCM TypeGit

GIT Instance – The Instance that you created for the PetClinic Application on GitHub.

Stream Namemaster (Don’t capitalize it or it won’t work)

Spring Maven - Project Configuration

Finally, run the Build

A shiny new War should be created. You can deploy it to Tomcat and test it out.

Spring Maven - Execution Summary of steps

Related Resources

Revolutionize Your Oracle, Salesforce, or SAP Environment with Flexagon’s DevOps Assessment

In the fast-paced world of Enterprise IT, staying ahead means constantly evolving. For organizations utilizing Oracle, Salesforce, or SAP, the ...

New In FlexDeploy 9.0 – Credential Support For SSH Keys

Incorporating SSH keys are an easy way to add a layer of security to your development and delivery processes. Once ...

DevOps for Azure Power BI

Power BI is a unified self-service and enterprise analytics solution that allows you to visualize your data, and share insights ...

Join DevOps leaders across the globe who receive analysis, tips, and trends in their inbox