Open plinto
Docs›Start

Quickstart

Tutorial·10 min read

Make a service, build it, test it and run it. You need a terminal and plinto, which needs Java 23 or newer to run; plinto brings every other toolchain itself. Install and sign in first if you haven't.

  1. Make a workspace 1 min

    A workspace is the folder your projects live in. It builds against one revision of a version group; your organization starts with one called main.

    $ plinto workspace create shop --version-group main
    Created shop/plinto-workspace.conf (acme's version group main at revision 299)
    $ cd shop
    shop/plinto-workspace.conf
    {
      organization = acme
      version-group = main@299
      projects = []
    }

    Yours names your organization, and another revision: your group's newest when you run the command.

  2. Create a service 1 min

    plinto create writes a project that builds at once: its plinto.conf, a little code and a test.

    $ plinto create java-service HelloApp
    Created src/HelloApp/plinto.conf
    Created src/HelloApp/src/helloapp/Main.java
    Created src/HelloApp/tst/helloapp/MainTest.java
    Added HelloApp to the projects of plinto-workspace.conf
    Build it with: plinto build -p src/HelloApp
    src/HelloApp/plinto.conf
    {
      name = HelloApp
      version = 1.0   # a version line: releases are 1.0-1, 1.0-2, ...
      build = JavaBuild
      main = helloapp.Main   # what `plinto run` starts, the jar's Main-Class
      # args = [--port, 8080]   what it starts with, for `plinto run` and the packaged program
    
      build-dependencies: {
        JavaBuild = 1.0
        Java = 25
      }
    
      dependencies: {
        # LibOne = 1.0         a repository package, or the workspace project named LibOne
        # Slf4jApi = 2.0.17    a Maven artifact the version group imported: plinto import maven org.slf4j:slf4j-api:2.0.17
      }
    
      test-dependencies: {
        JUnitJupiter = 6
      }
    }

    JavaBuild is the build system, and Java = 25 the JDK: both are packages, and create asked your group which versions it has, so they always match it. Other languages have their own templates, such as kotlin-service, go-service, rust-service, python-service and node-service: see Languages.

  3. Build and test it 2 min

    The first build downloads the JDK and the build system your group pins. Nothing comes from your machine, so a colleague's laptop and plinto's own build machines build it the same way.

    $ plinto build -p src/HelloApp
    Building HelloApp 1.0 with JavaBuild
    > resolveBuildDependencies
    Version group main at revision 299 from https://repository.plinto.build
    …
    > compileJava
      compiled 1 file(s)
    …
    > test
      └─ JUnit Jupiter ✔
         └─ MainTest ✔
            └─ greets() ✔
    …
    > jar
      build/libs/HelloApp-1.0.jar
    BUILD SUCCESSFUL in 2.1s

    The jar and the test results are in src/HelloApp/build/. Nothing else uses them: that is what plinto release is for.

  4. Run it 1 min

    plinto run builds without tests and starts the service. What follows -- goes to your program.

    $ plinto run -p src/HelloApp -- world
    …
    BUILD SUCCESSFUL in 1.0s
    Running as region my-local-1, environment local, stage local
    Hello, world!

    The region, environment and stage are the ones your machine stands for. Configuration can say something different for each, and plinto run --env beta runs as a deployment there would.

What you just used

Four of the ten words. Point at one to see what it means.

Workspacethe folder shop, on a revision of main
Version groupmain, which chose every version
Projectsrc/HelloApp and its plinto.conf
Packagesthe JDK and the build system the build downloaded

Where to go next