Maven Plugin

Maven Plugin

Maven plugin by Jelastic PaaS is a tool that can be used for building and managing Java projects. It complements the native Maven features of standardizing and simplifying the build process through implementation of the best deployment and development practices to deploy local projects directly into the cloud.

Tip: Alternatively, you can manage your project remotely (i.e. from anywhere over the Internet) by creating Maven build node at Jelastic PaaS and storing project at any preferable GIT version control system.

Follow the next steps to deploy your Java applications into Jelastic PaaS with the help of the Maven plugin:

  1. Ensure you have a running Java environment to deploy your project into. If needed, create a new one by following the linked guide.
  2. Prepare Java project using the Maven build tool (manually or using any IDE).
  3. Adjust your project’s pom.xml configuration file by adding/extending the and sections. Herewith, you need to pass the correct values to placeholders (see the comments in the code below):
    <apiToken>${token}</apiToken> <!--an access token is used instead of a login/password, see note below-->
    <artifact>{artifact}</artifact> <!--artifact to be deployed-->
    <context>{context}</context> <!--preferable context name (ROOT if skipped)-->
    <environment>{envName}</environment> <!--name of a target Jelastic environment-->
    <comment>{comment}</comment> <!--custom comment, if needed-->
   <api_hoster>{hosterDomain}</api_hoster> <!--domain name of your platform-->

Note: You can generate access token for Maven Plugin via the dashboard.

maven plugin access token

Don’t forget to save the changes.

  1. Open the command line on your local machine and navigate to the folder with your maven project. Here, you can perform the following commands:
mvn jelastic:deploy -Djelastic.password={password}

Initiates your application deployment, substitute the {password} placeholder with your actual Jelastic account password (token).

mvn jelastic:publish

Builds and uploads .war file to your account deployment manager without actually deploying project.

mvn clean install jelastic:deploy

Redeploys your project, use it after applying some changes to the code.

5. After successful deployment, you can navigate to your Jelastic dashboard to ensure its addition to the target environment.
java project deployed with maven
To access the deployed application, click the Open in Browser button. In our case it is Hello World application.

As you can see, the project is successfully built and deployed via Maven.