AsyncAPI Gradle plugin

Gradle plugin for AsyncAPI. Helps to generate AsyncAPI specification from hand-crafted AsyncAPI class at choosed build cycle step.

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.asyncapi
ArtifactId

ArtifactId

asyncapi-gradle-plugin
Last Version

Last Version

1.0.0-EAP
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

AsyncAPI Gradle plugin
Gradle plugin for AsyncAPI. Helps to generate AsyncAPI specification from hand-crafted AsyncAPI class at choosed build cycle step.
Project URL

Project URL

https://github.com/asyncapi/jasyncapi
Project Organization

Project Organization

AsyncAPI Initiative
Source Code Management

Source Code Management

https://github.com/asyncapi/jasyncapi

Download asyncapi-gradle-plugin

Dependencies

compile (6)

Group / Artifact Type Version
org.reflections : reflections jar 0.9.12
com.fasterxml.jackson.core : jackson-databind jar 2.10.3
com.fasterxml.jackson.core : jackson-annotations jar 2.10.3
com.fasterxml.jackson.core : jackson-core jar 2.10.3
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.10.3
com.asyncapi : asyncapi-plugin-core jar 1.0.0-SNAPSHOT

runtime (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.61

Project Modules

There are no modules declared in this project.


AsyncAPI logo

Building the future of event-driven architectures

We're on a mission to standardize message-based communication and increase interoperability of the different systems out there.

⚠️ This project doesn't support AsyncAPI 1.x

This monorepo stores modules, which simplifies interacting with AsyncAPI in jvm ecosystem.

Index

Monorepo structure

Currently here it's splitted on two submodules:

core

This submodule stores projection of AsyncAPI specification to java classes. Each class is being properly annotated with jsr-305 annotations, which allows to use it in null-safety languages like kotlin without extra headache.

<dependency>
  <groupId>com.asyncapi</groupId>
  <artifactId>asyncapi-core</artifactId>
  <version>1.0.0-EAP</version>
</dependency>

plugin

This submodule stores plugins, which automatizes work with AsyncAPI specification.

Currently here are three plugins:

maven

Maven plugin helps to generate AsyncAPI specification from hand-crafted AsyncAPI class at choosed build cycle step.

<dependency>
  <groupId>com.asyncapi</groupId>
  <artifactId>asyncapi-maven-plugin</artifactId>
  <version>1.0.0-EAP</version>
  <type>maven-plugin</type>
</dependency>

Source code with description and example

gradle

Gradle plugin helps to generate AsyncAPI specification from hand-crafted AsyncAPI class at choosed build cycle step.

Source code with description and example

IDEA

IDEA plugin simplifies work with AsyncAPI specification not only in Intellij IDEA, but in others IDE from JetBrains

JetBrains plugin marketplace

Source code with description and example

Release

Sonatype Instruction with references and clarifications

⚠️ WARNING: next artifacts MUST always have common version at release. Because of dependency of plugins from core

Release maven artifacts:

  • Request credentials for one of AsyncAPI's account on Sonatype's Jira, which is synced with Sonatype's nexus
  • Generate pgp key if it was not generated yet
  • Create /Users/{userName}/.m2/settings.xml
<settings>
  <profiles>
    <profile>
      <id>ossrh</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.keyname>GPG key name</gpg.keyname>
        <gpg.executable>gpg</gpg.executable>
        <gpg.passphrase>GPG passphrase for selected key</gpg.passphrase>
        <gpg.homedir>/Users/{userName}/.gnupg</gpg.homedir>
      </properties>
    </profile>
  </profiles>
  <servers>
    <server>
      <id>ossrh</id>
      <username>Jira username</username>
      <password>Jira password</password>
    </server>
  </servers>
</settings>
  • Choose new release version and set it to root pom.xml.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.asyncapi</groupId>
    <artifactId>asyncapi</artifactId>
    <version>{new release version}</version>

    <!-- Other project properties was omitted. They are located below and won't be updated generally -->

</project>

Example

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>asyncapi-plugin</artifactId>
        <groupId>com.asyncapi</groupId>
        <version>{new release version}</version>
    </parent>

    <!-- Other project properties was omitted. They are located below and won't be updated generally -->

</project>
  • Build it, test it and release it to maven central repository
➜  async-api git:(1.0.0-EAP) ✗ mvn clean deploy -P release 

Release gradle artifacts:

release to maven central

gradle gpg instruction
sonatype's instruction for deployment releasing

  • Request credentials for one of AsyncAPI's account on Sonatype's Jira, which is synced with Sonatype's nexus
  • Generate pgp key if it was not generated yet
    • export secret key ring file containing your private key
      gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
  • Create /Users/{userName}/.gradle/gradle.properties
# gpg
signing.keyId={key name}
signing.password={key passphrase}
signing.secretKeyRingFile=/Users/{userName}/.gnupg/secring.gpg

# oss.sonatype.org
ossrhUsername={Jira username}
ossrhPassword={Jira password}
version = "{new release version}"
  • Build it, test it and release it to maven central repository
➜  asyncapi-plugin-gradle git:(1.0.0-EAP) ✗ ./gradlew publishPluginMavenPublicationToMavenRepository
  • Go to stagin repositories and release it manually
    • Select repository
    • Click close and wait some time
    • Click release

release to gradle plugins

  • Request key and secret for gradle account
  • Update /Users/{userName}/.gradle/gradle.properties with gradle credential
gradle.publish.key={key}
gradle.publish.secret={secret}
➜  asyncapi-plugin-gradle git:(1.0.0-EAP) ✗ ./gradlew publishPlugins
com.asyncapi

AsyncAPI Initiative

Versions

Version
1.0.0-EAP