/th2-gradle-plugin

Repository contains plugins that simplify set up of th2 components for Java/Kotlin projects

Primary LanguageKotlinApache License 2.0Apache-2.0

th2 Gradle

This project contains Gradle plugins that simplifies development of th2 components.

Gradle Plugin Portal Version

Available plugins

The following plugins are available:

com.exactpro.th2.gradle.base

This plugin MUST be applied to the root project.

It adds required configuration to the project to be ready for vulnerability scanning and building license report. Also, it adds useful information from git into the JAR file. If one of Java plugins is applied it also add maven BOM into dependencies.

To provide API key to access NVD vulnerability database use property nvdApiKey. To provide delay in milliseconds between attempts to connect to NVD database use property nvdDelay.

Third-party plugins applied under the hood:

Configuration properties

com.exactpro.th2.gradle.grpc

This plugin prepares the project to be built as gRPC library for th2 component. If this plugin is applied to the root project it also applies base plugin. The java-library plugin MUST be also applied to the project with grpc plugin. Plugin can be either configured via th2Grpc extension.

Plugin configures protobuf plugin to generate java stubs from src/main/proto source set.

The minimal set of required dependencies to protobuf and gRPC libraries is added automatically.

Third-party plugins applied under the hood:

com.exactpro.th2.gradle.publish

This plugin MUST be applied to the root project.

Plugin prepares the project to be published to maven repository. It will prepare the project only if maven-publish plugin is applied to that project. Plugin can be either configured via th2Publish extension or via properties.

Supported properties:

  • Sonatype (only when both properties specified the project will be configured to publish to sonatype):
    • sonatypeUsername
    • sonatypePassword
  • Nexus:
    • nexus_url
    • nexus_user
    • nexus_password
  • Signature:
    • signingKey
    • signingPassword

Third-party plugins applied under the hood:

com.exactpro.th2.gradle.component

This plugin prepares the project to be packaged as Docker image. The project MUST use application plugin to package the component.

Third-party plugins applied under the hood:

Apply from Sonatype repository

Until this plugin is not published to Gradle portal it can be applied from Sonatype repository.

Apply plugins

Example:

plugins {
  id 'java-library'
  id 'maven-publish'
  id 'com.exactpro.th2.gradle.grpc' version '<version>'
  id 'com.exactpro.th2.gradle.publish' version '<version>'
}

License

This plugin is made available under the Apache 2.0 License.