Giter Site home page Giter Site logo

ssh-maven-plugin's Introduction

SSH Maven Plugin Documentation

The plugin provides 2 goals to help deploy and execute system and Java programs on remote servers.

Goals available

Goal Description
ssh:deploy A goal for execution script on remote server
ssh:template Create template Deploy file

Usage

In order to deploy project using SSH you must first specify the use of an SSH server. For this you need add configuration in your settings.xml

<servers>
    ...
    <server>
        <id>hdp2.4</id>
        <username>root</username>
        <password>hadoop</password>
        <privateKey>${user.home}/.ssh/id_rsa</privateKey>
        <configuration>
            <host>localhost</host>
            <port>2222</port>
        </configuration>
    </server>
    ...
</servers>

Now you should specify the artifact version in your project's plugin configuration

<build>
    <plugins>
        ...
        <plugin>
            <groupId>com.epam.maven</groupId>
            <artifactId>ssh-maven-plugin</artifactId>
            <version>1.7.3</version>
            <configuration>
                <ssh.server>hdp2.4</ssh.server>
            </configuration>
        </plugin>
        ...
    </plugins>
</build>

When you use the deploy goal, you might want to change the deploy file of the plugin execution. This can be achieved using the ssh.deployfile.path configuration element. By default deploy file location in root folder of the project. For select your executable script you need use configuration element ssh.deploy.script, for example:

<configuration>
    ...
    <ssh.deployfile.path>deployment/Blueprint.json</ssh.deployfile.path>
    <ssh.deploy.script>spark-streaming</ssh.deploy.script>
    ...
</configuration>

or, on the command line:

mvn package ssh:deploy -Dssh.deploy.script=spark-streaming

Configure deploy file

You can create template deploy file use the template goal, after execution will be created following file template:

{
  "version" : "1.7.3",
  "scripts" : [ {
    "name" : "demo",
    "properties" : {
      "jdk.version" : "1.7"
    },
    "actions" : [ {
      "type" : "scp",
      "items" : [ {
        "source" : "target/${project.build.package}",
        "target" : "."
      } ]
    }, {
      "type" : "bash",
      "items" : [ "java -cp ${project.build.package}" ]
    } ]
  } ]
}

Deploy file should contains version and list of scripts. Now supported 1.7.[1-3] version of deploy file. Script object should contains name and list of actions, optional list of properties, description and author. Any action should contains field type and other fields typical for specific implementation. Now available following actions:

Action Description
scp Implementation Secure Copy. Contains list of object (source and optional target)
bash Command line on remote server, each string of list will be executed remote

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.