Getting started with Jeka
            Install Intellij Plugin
            Hello World !
            Import 3rd Party libraries
            Build a Java Project
            Build a Springboot Project

Getting started with Jeka

Here, you will :

Install Intellij Plugin

As this plugin embbeds its own version of Jeka, that's all you need to install on your machine.

Hello World !

The below example showcases how to write tasks executable both from IDE and command line.

plot

plot

You get the following... plot

The Jeka folder structure will be generated with an empty Jeka class.

On the right side of the IDE, nodes can be expanded to navigate on Jeka commands. These commands either come from the Commands class or plugins present in classpath.

Now, you can now add your own commands (like printHello in above example) just by declaring a public no-arg method returning void. Your new method should appear instantaneously in Jeka window tool on the right.

You can write as many commands as you want, of any complexity. Also, your project can contain several Jeka classes. The first Jeka class found is the default Jeka class (sorted by name/package).

To run doSomething method on a specific class named here.is.MyJekaCommands, execute ./jekaw -JKC=MyJekaCommands doSomething.

Learn more about Jeka command line

Import 3rd Party libraries

Your Jeka classes can also use any third party libraries available on your file system or in a bynary repository.

Let's add guava to our Commands class : just add the @JkDefClasspath annotation and refresh ide module to make it available on IDE classpath.

plot


Now you can use guava to improve your commands using *guava* inside.

plot


Build a Java Project

Jeka bundles Java project build capabilities. Of course, you can use your favorite build tool (Maven, Gradle, ...) beside Jeka in your project and let Jeka delegate builds to these tools, but you might prefer to let Jeka build your project by itself. Let's see how to do it.

The box 'delegate Jeka Wrapper to' means that the module tutorial-2 will reuse the same Jeka wrapper (and therefore the same Jeka version) than tutorial-1. That way, we can force all Java modules from a same Intellij project, to use the same Jeka Version, defined in one place.

plot

This generates a Build template class in jeka/def along source folders.

You can launch directly any method declared on this class or navigate in Jeka right tool to discover methods available on this class or available plugin.

plot



After modifying your dependencies, do not forget to refresh module in order intellij take it in account. Invoke cleanPack to build project from scratch.

plot

Now your project is ready to code. You will find many project examples at https://github.com/jerkar/working-examples

Learn more about Java project builds

Learn more about dependency management

Build a Springboot Project

Jeka offers a plugin mechanism to let 3rd parties extend the product. An external plugin for Springboot exists and is tightly integrated in Intellij Plugin.

This generates a sample project along its build class based on the last Springboot version.

You can invoke regular commands as clean,pack, ... The plugin offers additional commands to run the application from the built jar.

plot

The plugin proposes popular Spring modules as constant to help pickup dependencies.

You can also switch Springboot version easily by changing #springbootVersion argument.

Do not forget to trigger 'Jeka Synchronize Module' available in context menues, each time you modify dependencies or change springboot version. It let Intellij synchronize its iml file with dependencies declared in Jeka.

plot