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

[WIP][ISSUE #199] Support Kafka connector plugin and Kafka as event store #199 #376

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
java-version: ${{ matrix.java }}

- name: Build
run: ./gradlew clean build jacocoTestReport
run: ./gradlew clean build jacocoTestReport checkLicense

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v1
Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ All code should be well reviewed by one or more committers. Some principles:
- Elegance: New functions, classes or components should be well-designed.
- Testability: Important code should be well-tested (high unit test coverage).

### License review

Eventmesh follows [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) policy. All source files should
have the Apache License header added to the file header. Eventmesh uses the [apache/skywalking-eyes](https://github.com/apache/skywalking-eyes) to check
the source file header. And Eventmesh uses [Gradle-License-Report](https://github.com/jk1/Gradle-License-Report) plugin to check for third-part dependencies.
When you need to add a three-part dependency, you need to register the newly added dependency in tool/license/allowed-licenses.txt, you can execute `./gradlew clean checkLicense` to judge
whether there exist dependencies isn't added, and the newly added three-part libraries need to meet [ASF 3RD PARTY LICENSE POLICY](https://apache.org/legal/resolved.html).
It is highly recommended communicating with Eventmesh community before you need to add a three-part library.

## Community

### Contact us

Mail: [email protected]
11 changes: 11 additions & 0 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@
- 优雅: 新功能,类或组件应经过精心设计
- 可测试性: 重要代码应经过良好测试(较高的单元测试覆盖率)

### License审查

Eventmesh遵循[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) 政策。
所有的源代码文件应该在文件头部添加Apache License header,Eventmesh会使用[apache/skywalking-eyes](https://github.com/apache/skywalking-eyes)
对源代码文件头进行校验。Eventmesh使用[Gradle-License-Report](https://github.com/jk1/Gradle-License-Report)插件
检查第三方依赖,当你需要添加三方依赖时,你需要将新添加的依赖注册在tool/license/allowed-licenses.txt中,你可以通过执行`./gradlew clean checkLicense`命令可以判断当前是否有license尚未添加,
同时新添加的三方库需要满足[Apache对于第三方的政策](https://apache.org/legal/resolved.html)。
非常建议在需要添加三方依赖之前与Eventmesh社区进行沟通。

## 社区

### 联系我们

邮件:[email protected]
163 changes: 71 additions & 92 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import java.util.concurrent.TimeUnit

//import com.github.spotbugs.snom.SpotBugsTask

buildscript {
repositories {
maven {
Expand All @@ -32,6 +30,8 @@ buildscript {

dependencies {
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.1"
classpath "io.spring.gradle:dependency-management-plugin:1.0.11.RELEASE"
classpath "com.github.jk1:gradle-license-report:1.17"
}
}

Expand All @@ -47,17 +47,8 @@ allprojects {
apply plugin: "pmd"
apply plugin: "java-library"
apply plugin: 'signing'
apply plugin: 'com.github.jk1.dependency-license-report'

// print(project)
// if (project.findProperty("jdk") == "1.7") {
// sourceCompatibility = 1.7
// targetCompatibility = 1.7
// version = version + "-jdk7"
// } else {
// sourceCompatibility = 1.8
// targetCompatibility = 1.8
// version = version + "-jdk8"
// }
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'

compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
Expand All @@ -71,6 +62,22 @@ allprojects {
if ((project.findProperty("snapshot") instanceof String) && (Boolean.valueOf(project.property("snapshot")))) {
version = version + "-SNAPSHOT"
}

licenseReport {
allowedLicensesFile = new File("build/license/allowed-licenses.json")
}

checkLicense.doFirst {
new File("build/license").mkdirs()
new File("build/license/allowed-licenses.json").createNewFile()

def writer = new File("build/license/allowed-licenses.json").newPrintWriter()
new File("tool/license/allowed-licenses.txt").filterLine {
String line -> line.trim().length() != 0 && !line.startsWith("#")
}.writeTo(writer)
writer.flush()
writer.close()
}
}

task tar(type: Tar) {
Expand All @@ -83,7 +90,6 @@ task tar(type: Tar) {
}
}


task zip(type: Zip) {
extension = 'zip'
archiveFileName = project.name + '.' + project.version + '.' + extension
Expand All @@ -95,71 +101,7 @@ task zip(type: Zip) {

subprojects {

List fastjson = [
"com.alibaba:fastjson:1.2.71"
]

List jackson = [
'com.fasterxml.jackson.core:jackson-databind:2.11.0',
'com.fasterxml.jackson.core:jackson-core:2.11.0',
'com.fasterxml.jackson.core:jackson-annotations:2.11.0'
]

List apache_commons = [
"org.apache.commons:commons-lang3:3.6",
"org.apache.commons:commons-collections4:4.1"
]

List httpclient = [
"org.apache.httpcomponents:httpclient:4.5.2"
]

List guava = [
"com.google.guava:guava:29.0-jre"
]

List netty = [
"io.netty:netty-all:4.1.49.Final"
]

List junit = [
"junit:junit:4.12",
"com.github.stefanbirkner:system-rules:1.16.1"
]

List log = [
"org.slf4j:slf4j-api:1.7.30"
]

List log4j2 = [
"org.apache.logging.log4j:log4j-api:2.13.3",
"org.apache.logging.log4j:log4j-core:2.13.3",
"org.apache.logging.log4j:log4j-slf4j-impl:2.13.3",
"org.apache.logging.log4j:log4j-web:2.13.3",
"com.lmax:disruptor:3.4.2"
]

List common = [
"commons-io:commons-io:2.4",
"org.apache.commons:commons-text:1.9"
]

List assertj = [
"org.assertj:assertj-core:2.6.0"
]

List mock = [
"org.mockito:mockito-core:2.23.0",
"org.powermock:powermock-module-junit4:2.0.2",
"org.powermock:powermock-api-mockito2:2.0.2",
]

dependencies {
implementation apache_commons, guava, log, log4j2, fastjson, jackson, common, httpclient, netty
testImplementation apache_commons, guava, log, log4j2, fastjson, jackson, common, junit, assertj, mock, httpclient, netty
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
}
apply plugin: "io.spring.dependency-management"

sourceSets {
main {
Expand Down Expand Up @@ -189,22 +131,14 @@ subprojects {
}

spotbugs {
//toolVersion = '4.2.3'
ignoreFailures = true
showProgress = true
showStackTraces = true
//reportLevel = 'default'
effort = 'default'
//visitors = [ 'FindSqlInjection', 'SwitchFallthrough' ]
//omitVisitors = [ 'FindNonShortCircuit' ]
reportsDir = file("$buildDir/reports/spotbugs")
//includeFilter = file('spotbugs-include.xml')
//excludeFilter = file('spotbugs-exclude.xml')
//onlyAnalyze = ['org/apache/eventmesh/**']
projectName = rootProject.name
release = version
extraArgs = ['-nested:false']
//jvmArgs = [ '-Duser.language=zh' ]
maxHeapSize = '256m'

}
Expand Down Expand Up @@ -285,8 +219,8 @@ subprojects {
exclude '**/spring-boot-devtools*.jar'
exclude '**/mumble-sdk-test*.jar'
exclude '*connector-rocketmq*.jar'
exclude '*connector-kafka*.jar'
exclude 'eventmesh-runtime*.jar'
// exclude '*log4j*.jar'
exclude 'commons-collections-3.2.2.jar'
}

Expand All @@ -304,7 +238,6 @@ subprojects {

javadoc {
source = sourceSets.main.java
//classpath = configurations.implementation
destinationDir = reporting.file("javadoc")
}

Expand All @@ -325,8 +258,8 @@ subprojects {
}

if (!Boolean.valueOf(signEnabled)) {
tasks.whenTaskAdded {task ->
if(task.name.contains("sign")) {
tasks.whenTaskAdded { task ->
if (task.name.contains("sign")) {
task.enabled = false
}
}
Expand All @@ -338,7 +271,6 @@ subprojects {
mavenLocal()
}


configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, TimeUnit.SECONDS
resolutionStrategy.cacheDynamicVersionsFor 0, TimeUnit.SECONDS
Expand Down Expand Up @@ -401,5 +333,52 @@ subprojects {
sign publishing.publications.mavenJava
}

}
dependencyManagement {
dependencies {
dependency "org.apache.commons:commons-lang3:3.6"
dependency "org.apache.commons:commons-collections4:4.1"
dependency "commons-io:commons-io:2.4"
dependency "org.apache.commons:commons-text:1.9"

dependency "com.google.guava:guava:29.0-jre"

dependency "org.slf4j:slf4j-api:1.7.30"
dependency "org.apache.logging.log4j:log4j-api:2.13.3"
dependency "org.apache.logging.log4j:log4j-core:2.13.3"
dependency "org.apache.logging.log4j:log4j-core:2.13.3"
dependency "org.apache.logging.log4j:log4j-slf4j-impl:2.13.3"
dependency "org.apache.logging.log4j:log4j-web:2.13.3"

dependency "com.lmax:disruptor:3.4.2"
dependency "com.alibaba:fastjson:1.2.71"

dependency "com.fasterxml.jackson.core:jackson-databind:2.11.0"
dependency "com.fasterxml.jackson.core:jackson-core:2.11.0"
dependency "com.fasterxml.jackson.core:jackson-annotations:2.11.0"

dependency "org.apache.httpcomponents:httpclient:4.5.2"

dependency "io.netty:netty-all:4.1.49.Final"

dependency 'io.dropwizard.metrics:metrics-core:4.1.0'
dependency "io.dropwizard.metrics:metrics-healthchecks:4.1.0"
dependency "io.dropwizard.metrics:metrics-annotation:4.1.0"
dependency "io.dropwizard.metrics:metrics-json:4.1.0"

dependency "io.openmessaging:openmessaging-api:2.2.1-pubsub"

dependency "com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0"
dependency "com.mebigfatguy.fb-contrib:fb-contrib:7.4.7"

dependency "org.springframework.boot:spring-boot-starter-web:2.1.6.RELEASE"

dependency "junit:junit:4.12"
dependency "com.github.stefanbirkner:system-rules:1.16.1"
dependency "org.assertj:assertj-core:2.6.0"

dependency "org.mockito:mockito-core:2.23.0"
dependency "org.powermock:powermock-module-junit4:2.0.2"
dependency "org.powermock:powermock-api-mockito2:2.0.2"
}
}
}
Loading