• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sponiro/gradle-nar-plugin: Gradle nifi plugin

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

sponiro/gradle-nar-plugin

开源软件地址(OpenSource Url):

https://github.com/sponiro/gradle-nar-plugin

开源编程语言(OpenSource Language):

Groovy 100.0%

开源软件介绍(OpenSource Introduction):

gradle-nar-plugin

A gradle plugin to create nar files for Apache nifi.

Installation

To use the plugin, add the bintray repository to your script and add the plugin dependency:

buildscript {
    repositories {
        mavenCentral()
        maven {
            url 'http://dl.bintray.com/sponiro/gradle-plugins'
        }
    }
    dependencies {
        classpath group: 'de.fanero.gradle.plugin.nar', name: 'gradle-nar-plugin', version: '0.4'
    }
}

apply plugin: 'de.fanero.gradle.plugin.nar'

Usage

Run gradle nar to execute the nar task and create a nar archive.

Configuration

This plugin depends on the JavaPlugin. If it does not exist it will add it to the build.

Nar Task

The plugin adds a new preconfigured task of type Nar named nar to the project. The Nar class extends Jar and can be modified as such. The task is configured to add all runtime dependencies and the jar archive itself to the nar archive.

Nar Parent

Nar archives can have a parent nar. The parent is optional and there can be at maximum one parent. The parent relationship is added to the manifest. To tell the plugin to add a parent you have to add a nar dependency to the nar configuration. The nar configuration is created by the plugin. Add the parent nar like this:

dependencies {
    nar 'org.apache.nifi:nifi-standard-services-api-nar:0.2.1'
}

If you add more than one dependency, it will complain and crash the build.

Manifest

The manifest of a nar file contains properties to identify the nar file and a parent nar. This plugin configures the manifest generation to contain the values from the project name, group and version. The same goes for the nar parent.

Default manifest values

Manifest Property Key Value
Nar-Group project.group
Nar-Id project.name
Nar-Version project.version
Nar-Dependency-Group nar config group
Nar-Dependency-Id nar config name
Nar-Dependency-Version nar config version

Override manifest values

The plugin respects manifest overrides from the user. For example:

nar {
    manifest {
        attributes 'Nar-Group': 'overriden-nar-group-value'
    }
}

A full description can be found at https://docs.gradle.org/current/userguide/java_plugin.html#sec:jar.

Shortcomings

Version 0.1 and 0.2 do not add the parent nar in the nar configuration to the dependencies. To fix this you can either use version 0.3 or add the following code to your build:

configurations {
    compileOnly.extendsFrom(configurations.nar)
}

Service Locator

Apache nifi uses the ServiceLocator to define processors. The Processor API explains in detail how this works. Basically, you have to add a file in META-INF/services directory named org.apache.nifi.processor.Processor. This text file contains a fully-qualified class names of your processors. One per line.

Contributions

Version 0.4

Thanks to Lars Winderling for making the plugin ready for Gradle 6.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap