Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change domain #1

Merged
merged 7 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/swagger4kafka-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: swagger4kafka-ui

on:
push:
paths:
- 'swagger4kafka-ui/*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew -p swagger4kafka-ui build
15 changes: 9 additions & 6 deletions .github/workflows/swagger4kafka.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build swagger4kafka
name: swagger4kafka

on: [push]
on:
push:
paths:
- 'swagger4kafka/*'

jobs:
build:
Expand All @@ -9,14 +12,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew test
run: ./gradlew -p swagger4kafka test
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ and allows you to publish it to the correct topic with a single click.
It is not another generic REST API for Kafka.

### Usage
_Note for springfox users - using swagger4kafka with springfox versions before 2.9.2 might raise an exception._
_Note for springfox users - using swagger4kafka with springfox versions before 2.9.2 might raise an exception._

By applying the following instructions, methods annotated with ```@KafkaListener``` inside ```@Component``` and
```@Service``` annotated classes will be scanned once in runtime. Of course, it is a requirement that the project is a
Spring Boot project with the ```spring-kafka``` library and its relevant configurations.

#### Dependencies
swagger4kafka is hosted on maven central.
swagger4kafka is hosted on jcenter.
##### Gradle
```groovy
dependencies {
// Provides the documentation API
implementation 'com.stavshamir:swagger4kafka:1.1.0'
implementation 'io.github.stavshamir:swagger4kafka:0.0.1'

// Provides the UI - optional (recommended)
implementation 'com.stavshamir:swagger4kafka-ui:1.0.0'
Expand All @@ -47,9 +47,9 @@ dependencies {
```xml
<dependencies>
<dependency>
<groupId>com.stavshamir</groupId>
<groupId>io.github.stavshamir</groupId>
<artifactId>swagger4kafka</artifactId>
<version>1.1.0</version>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.stavshamir</groupId>
Expand All @@ -69,7 +69,7 @@ public class Swagger4KafkaConfiguration {
public Docket docket() {
return Docket.builder()
.serviceName("Swagger4Kafka Example Project")
.basePackage("com.stavshamir.swagger4kafka.example.consumers")
.basePackage("io.github.stavshamir.swagger4kafka.example.consumers")
.bootstrapServers("localhost:9092")
.build();
}
Expand All @@ -92,7 +92,7 @@ A default Kafka producer implementation is provided, but a custom producer with
public Docket docket() {
return Docket.builder()
.serviceName("Swagger4Kafka Example Project")
.basePackage("com.stavshamir.swagger4kafka.example.consumers")
.basePackage("io.github.stavshamir.swagger4kafka.example.consumers")
.producerConfiguration(producerConfiguration())
.build();
}
Expand Down
119 changes: 2 additions & 117 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,118 +1,3 @@
buildscript {
ext {
springBootVersion = '2.1.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.stavshamir'
archivesBaseName = 'swagger4kafka'
version = '1.1.0'
sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
implementation 'io.swagger:swagger-inflector:1.0.16'
implementation 'io.springfox:springfox-core:2.8.0'

implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.kafka:spring-kafka'

implementation 'com.google.guava:guava:27.0.1-jre'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.4'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2'

compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok:1.18.4'

testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.springframework.kafka:spring-kafka-test')

testCompile 'org.projectlombok:lombok:1.18.4'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.4'

testCompile('org.assertj:assertj-core:3.11.1')
}

jar.enabled = true
bootJar.enabled = false

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
}

signing {
sign configurations.archives
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

def username = hasProperty('ossrhUsername') ? ossrhUsername : System.getenv('ossrhUsername')
def password = hasProperty('ossrhPassword') ? ossrhPassword : System.getenv('ossrhPassword')

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: username, password: password)
}

snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: username, password: password)
}

pom.project {
name 'swagger4kafka'
packaging 'jar'
url 'https://github.com/stavshamir/swagger4kafka'
description 'Automated JSON API documentation for Kafka Listeners built with Spring'

scm {
url 'https://github.com/stavshamir/swagger4kafka'
connection 'scm:git:git://github.com/stavshamir/swagger4kafka.git'
developerConnection 'scm:git:https//github.com/stavshamir/swagger4kafka.git'
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'stavshamir'
name 'Stav Shamir'
email 'shamir.stav@gmail.com'
}
}
}
}
}
allprojects {
group = 'io.github.stavshamir'
}
84 changes: 84 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
13 changes: 13 additions & 0 deletions swagger4kafka-ui/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
44 changes: 44 additions & 0 deletions swagger4kafka-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# profiling files
chrome-profiler-events.json
speed-measure-plugin.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
Loading