InHash – Visual Studio Code E...

InHash – Visual Studio Code Extension to compute hash and checksum I just developed the visual studio code version of the InHash plugin already dev...

InHash – Eclipse plugin to comput...

InHash – Eclipse plugin to compute hash and checksum I just developed the eclipse version of the InHash plugin already developed for IntelliJ. T...

InHash – Intellij plugin to compu...

InHash – Intellij plugin to compute hash and checksum I just developed a plugin for IntelliJ. The plugin computes hash and checksum for files an...

kotlin

Embedding Kotlin Playground

Jetbrains is providing plugins and tools to embed Kotlin in any website - you can update and run the code clicking the play! Just try it! [kot...

InHash – Visual Studio Code Extension to Compute Hashs and Checksum

InHash – Visual Studio Code Extension to compute hash and checksum

I just developed the visual studio code version of the InHash plugin already developed for IntelliJ and Eclipse.

This plugin computes hash and checksum for files and selected text.

It started to be a necessity for a project where I was involved and “why not to create a plugin from it?”

Find it here: Visual Studio Code Extension to compute Hashs and Checksum

InHash – Eclipse plugin to compute hash and checksum

InHash – Eclipse plugin to compute hash and checksum

I just developed the eclipse version of the InHash plugin already developed for IntelliJ.

This plugin computes hash and checksum for files and selected text.

It started to be a necessity for a project where I was involved and “why not to create a plugin from it?”

Find it here: InHash – Eclipse plugin to compute hash and checksum

InHash – Intellij plugin to compute hash and checksum

InHash – Intellij plugin to compute hash and checksum

I just developed a plugin for IntelliJ.

The plugin computes hash and checksum for files and selected text.

It started to be a necessity for a project I was involved and “why not to create a plugin from it?”

Find it here: InHash – Intellij plugin to compute hash and checksum

Embedding Kotlin Playground

Jetbrains is providing plugins and tools to embed Kotlin in any website
– you can update and run the code clicking the play!

Just try it!

How to add a list in a markdown table cell

This question arises frequently.
There is no only markdown way to do it. We add a little html in the markdown.

Error: java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonInclude$Value

java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonInclude$Value

If this error occurs try addind the following dependencies to your pom.xml
Usually jackson needs these 3 dependencies:

  • databind
  • core
  • annotations

    com.fasterxml.jackson.core
    jackson-databind
    2.9.0

		

    com.fasterxml.jackson.core
    jackson-core
    2.9.0



    com.fasterxml.jackson.core
    jackson-annotations
    2.9.0

junit 5, maven dependencies

JUnit 5 and Maven Dependencies

Straight to the point:

You need at least these dependencies:


    org.junit.jupiter
    junit-jupiter-api
    5.1.0
    test



    org.junit.jupiter
    junit-jupiter-engine
    5.1.0
    test

There are other dependencies for IDEs and older versions of jUnit if you need them:


    org.junit.vintage
    junit-vintage-engine
    5.1.0
    test
    

    org.junit.platform
    junit-platform-launcher
    1.1.0
    test


    org.junit.platform
    junit-platform-runner
    1.1.0
    test

Jenkins Pipelines and the Blue Ocean plugin

With the big wave of DevOps, Pipelines are one of the most used words. Why? Because continuous integration and continuous delivery are about pipelines.

Jenkins is one of the most used components in a Continuous Integration environment, and its community decided to take into this wave too. How?

Well, redefining how the pipelines are configured and developed in Jenkins.

The new pipelines are developed using Groovy Language, which opens a very wide spectrum of possibilities of configurations to the integration process. (so… who said Groovy lang was dying?)

There are 2 ways of developing pipelines in Jenkins, the Declarative and the Scripted way

In the Scripted approach you use the full power of Groovy language, however, the blue ocean plugin will not be used as expected and you cant visualize the pipeline. More on this later.

node {
    stage('chekout from git') {
        
        checkout([$class: 'GitSCM', 
                branches: [[name: '*/master']], 
                doGenerateSubmoduleConfigurations: false, 
                extensions: [], 
                submoduleCfg: [], 
                userRemoteConfigs: [[]]
        ])
        try {
            sh 'mvn test'
        } catch (e) {
            currentBuild.result = 'FAILURE'
            throw e
        } finally {
            cleanWs cleanWhenFailure: false
        }
    }

    stage('build the project') {
        steps {
            sh 'mvn -B -DskipTests clean package'
        }
    }
}

But it’s the declarative way that draws the pipeline flow as we expected.

This approach brings first an elegant structure of the code and the use of the Blue Ocean plugin where we will visualize the pipeline flow, literally!

An example of a declarative pipeline can be something like this:

pipeline {
    agent none 
    stages {
        stage('chekout from git') {
            steps {
                checkout([$class: 'GitSCM', 
                    branches: [[name: '*/master']], 
                    doGenerateSubmoduleConfigurations: false, 
                    extensions: [], 
                    submoduleCfg: [], 
                    userRemoteConfigs: [[]]
                ])
              }
        }
        stage('build the project') {
            steps {
                sh 'mvn -B -DskipTests clean package'
            }
        }
    }
}

If you install the Blue Ocean plugin and run a declarative pipeline you will see something like this:
(this example was taken from Jenkins website)

Jenkins Pipeline Blue Ocean Plugin

So, should I use Declarative or Scripted Pipelines?
– Scripted Pipelines use the full Groovy language, but you will not have the enhanced visualization.
– Well, declarative is a little more restricted in the structure of the code, but you can always use the step “script { }” to extended the use of Groovy. But you will use the Blue Ocean plugin, something that has its value in a workspace for instance.

The Jenkins website as a good tutorial to follow, please visit it to move forward in this technology.

Hope this post was enough to capture your attention about how Jenkins can have a really beautiful and useful visualization of a pipeline.

Fun – Obsolete Technology

Obsolete Technology
From xkcd.com

Tip: Java 8 Streams flatmap map lists

A little example, I had to develop as a teaching use case, of how to take a map with Integer keys and values with a List as value and find a specific value in any List in the whole map using Java Streams.

boolean b1 returns true because the element exists
boolean b2 is the response to an element that doesn’t exist

Bad Behavior has blocked 146 access attempts in the last 7 days.

Hyper Smash