Skip to content

Commit

Permalink
add generate pojo gradle & avoid jjschema
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingCattwo committed Jul 12, 2022
1 parent 53ed043 commit 52db924
Show file tree
Hide file tree
Showing 16 changed files with 2,373 additions and 67 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Created by https://www.gitignore.io/api/vim,java,maven,gradle,java-web,intellij,
.idea/**/gradle.xml
.idea/**/libraries

.idea/*.xml
.idea/vcs.xml

# CMake
cmake-build-debug/

Expand Down
85 changes: 68 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
buildscript {
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.4.3"
classpath "org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:1.1.2"
}

dependencies {
classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0"
}

}

plugins {
id 'com.github.spotbugs' version '4.7.0'
id "com.github.hierynomus.license" version "0.15.0"
id "com.github.hierynomus.license-report" version "0.15.0"
}
import com.github.spotbugs.snom.SpotBugsTask

Expand All @@ -34,7 +32,7 @@ apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'io.spring.dependency-management'
apply plugin: "com.github.hierynomus.license"
apply plugin: 'jsonschema2pojo'

if (!gradle.startParameter.isOffline()) {
apply plugin: 'checkstyle'
Expand Down Expand Up @@ -82,13 +80,14 @@ List lombok = [
"org.projectlombok:lombok:1.18.10"
]

def log4j_version="2.18.0"
List logger = [
"org.slf4j:jul-to-slf4j:1.7.30",
"org.apache.logging.log4j:log4j-api:2.15.0",
"org.apache.logging.log4j:log4j-core:2.15.0",
"org.apache.logging.log4j:log4j-slf4j-impl:2.15.0",
"org.apache.logging.log4j:log4j-web:2.15.0",
"org.apache.logging.log4j:log4j-jcl:2.15.0",
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-core:$log4j_version",
"org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version",
"org.apache.logging.log4j:log4j-web:$log4j_version",
"org.apache.logging.log4j:log4j-jcl:$log4j_version",
"com.lmax:disruptor:3.3.7"
]

Expand All @@ -107,12 +106,18 @@ List jmockit = [
"org.jmockit:jmockit:1.47"
]

def jackson_version="2.13.3"
List json = [
"com.fasterxml.jackson.core:jackson-databind:2.11.4",
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.0",
"com.github.fge:json-schema-validator:2.2.6",
"com.github.reinert:jjschema:1.16",
"org.jsonschema2pojo:jsonschema2pojo-core:1.1.1"
"com.fasterxml.jackson.core:jackson-databind:$jackson_version",
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jackson_version",
"com.fasterxml.jackson.module:jackson-module-jsonSchema:$jackson_version",
"com.github.fge:json-schema-validator:2.2.6", //LGPL
// "com.github.reinert:jjschema:1.16", //LGPL
"org.jsonschema2pojo:jsonschema2pojo-core:1.1.2", //apache
"org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:1.1.2", //apache
"com.networknt:json-schema-validator:1.0.71", // apache
// "com.github.victools:jsonschema-generator:4.25.0", // generate schema from java

]

List mysql_driver = [
Expand Down Expand Up @@ -156,6 +161,11 @@ configurations {
}

dependencies {
compile ("uk.co.gresearch.siembol:siembol-common:2.5.0") {
exclude group: "com.github.java-json-tools"
exclude group: "org.apache.kafka"
}


localDeps 'org.projectlombok:lombok:1.18.10'
if (!gradle.startParameter.isOffline()) {
Expand Down Expand Up @@ -322,7 +332,7 @@ if (!gradle.startParameter.isOffline()) {
}
}

uploadArchives {
uploadArchives {
repositories {
mavenDeployer {
// beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
Expand Down Expand Up @@ -381,3 +391,44 @@ gradle.taskGraph.whenReady { taskGraph ->
}
}
}

// Each configuration is set to the default value
jsonSchema2Pojo {

// Location of the JSON Schema file(s). This may refer to a single file or a directory of files.
// source = files("${sourceSets.main.output.resourcesDir}/json")
source = files("D:\\projects\\weid\\WeIdentity\\src\\test\\resources\\cpt")

// Target directory for generated Java source files. The plugin will add this directory to the
// java source set so the compiler will find and compile the newly generated source files.
targetDirectory = file("${project.buildDir}/generated-sources/js2p")

// Package name used for generated Java classes (for types where a fully qualified name has not
// been supplied in the schema using the 'javaType' property).
targetPackage = ''

}


//downloadLicenses {
// ext.apacheTwo = license('Apache License, Version 2.0', 'http://opensource.org/licenses/Apache-2.0')
// ext.bsd = license('BSD License', 'http://www.opensource.org/licenses/bsd-license.php')
//
// includeProjectDependencies = true
// licenses = [
// (group('com.myproject.foo')) : license('My Company License'),
// 'org.apache.james:apache-mime4j:0.6' : apacheTwo,
// 'org.some-bsd:project:1.0' : bsd
// ]
//
// aliases = [
// (apacheTwo) : ['The Apache Software License, Version 2.0', 'Apache 2', 'Apache License Version 2.0', 'Apache License, Version 2.0', 'Apache License 2.0', license('Apache License', 'http://www.apache.org/licenses/LICENSE-2.0')],
// (bsd) : ['BSD', license('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php')]
// ]
//
// excludeDependencies = [
// 'com.some-other-project.bar:foobar:1.0'
// ]
//
// dependencyConfiguration = 'compile'
//}
4 changes: 2 additions & 2 deletions src/main/java/com/webank/weid/protocol/cpt/Cpt109.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
public class Cpt109 {

/**
* caculate the hash from the entire list rather than from any single credential.
* calculate the hash from the entire list rather than from any single credential.
*/
String claimHash;

/**
* trusted timestamping provided by the trusted third party or by the consensus of each node in
* trusted timestamp provided by the trusted third party or by the consensus of each node in
* the consortium chain.
*/
Long timestamp;
Expand Down
Loading

0 comments on commit 52db924

Please sign in to comment.