Java VCS Deployment with Maven
Maven is a software comprehension and build automation tool mostly used for Java programming. Any public or private project can be added to the platform straight from your version control system (VCS) repository by using the relevant link type (git, http, https, or ftp for Git, and http, https, or svn for SVN). Once added, the Maven build node can be used to deploy Java projects to the relevant application servers.
Let’s now examine how to add and deploy a private or public Java application to your environment directly from a remote VCS repository to the Maven node.
Add Project to Maven
A Java project can be added straight to the Maven build node.
1. Next to the Maven layer, node, or Projects line below, click the Add project button:
2. In the dialog box that opens, fill in the required fields:
- Name: Enter a project name here (spaces and special characters not allowed).
- Repository: From the Deployment Manager, choose the Git/SVN project or add a new one.
- Branch: Indicates the branch of the repository to use (master is the default).
- Working Directory (optional): Gives the relative path to the subfolder of the repository containing the source code for the application.
- Deploy: Select whether the project should be built and deployed right away (checked) or just built on the Maven node (unchecked). If deploying, complete the following two fields:
- Environment: If installed from the application server, this option automatically selects the target environment with the application server.
- Context: Configures the project’s preferred custom context (ROOT by default).
- Hooks: Uses the supplied scripts either in front of or following the deployment/build procedures.
- Check and auto-deploy updates: This feature allows you to configure a frequency for periodically checking your repository for code changes. If changes are detected, automatic deployment is started.
- Auto-resolve conflicts: Updates conflicting files to the repository version (locally generated modifications are removed) to prevent merging conflicts.
At the bottom of the window, select Add or Add + Build (Add + Deploy) to complete the action. Without taking any further action, the first choice will save the data as a project template, making it simple to construct and deploy in the future.
3. The Maven node Projects list will now display your project. You can accomplish the following tasks by dragging your cursor over the project and selecting the relevant button:
- Build: This step gets the project ready for deployment by downloading it to the Maven node from the repository (only if modifications have occurred since the last build).
- Build and Deploy: Inspects the project for modifications and launches it into the intended environment. When deploying to a scaled server, you have the choice of using either sequential deployment or simultaneous deployment with delay settings.
- Modify project: This initiates a form for modifying the data that was entered when the project was added.
- Config: Use the configuration file manager to open the build project folder.
- Log: This initiates the troubleshooting and analysis section of the log.
- Delete: Gets rid of the Maven project.
The Maven build node can be managed using these GUI settings. Consult the Maven Configuration guide for additional customization options.