From 59f2ac5f37f21ca2f7bc26074f60e6c03ec084b8 Mon Sep 17 00:00:00 2001 From: ReaJason Date: Sat, 7 Jun 2025 00:53:06 +0800 Subject: [PATCH] build: use Kotlin DSL --- boot/build.gradle | 63 ---------- boot/build.gradle.kts | 48 +++++++ build.gradle | 117 ------------------ build.gradle.kts | 21 ++++ buildSrc/build.gradle.kts | 11 ++ .../maven-publish-convention.gradle.kts | 40 ++++++ deserialize/build.gradle | 28 ----- deserialize/build.gradle.kts | 33 +++++ generator/build.gradle | 64 ---------- generator/build.gradle.kts | 55 ++++++++ gradle/libs.versions.toml | 2 + gradlew | 4 +- gradlew.bat | 4 +- integration-test/build.gradle | 56 --------- integration-test/build.gradle.kts | 43 +++++++ memshell-agent/build.gradle | 10 -- .../memshell-agent-asm/build.gradle | 35 ------ .../memshell-agent-asm/build.gradle.kts | 30 +++++ .../memshell-agent-attacher/build.gradle | 33 ----- .../memshell-agent-attacher/build.gradle.kts | 33 +++++ .../memshell-agent-bytebuddy/build.gradle | 31 ----- .../memshell-agent-bytebuddy/build.gradle.kts | 31 +++++ .../memshell-agent-javassist/build.gradle | 31 ----- .../memshell-agent-javassist/build.gradle.kts | 30 +++++ memshell-party-bom/build.gradle | 47 ------- memshell-party-bom/build.gradle.kts | 40 ++++++ memshell-party-common/build.gradle | 25 ---- memshell-party-common/build.gradle.kts | 35 ++++++ memshell/build.gradle | 22 ---- memshell/build.gradle.kts | 29 +++++ settings.gradle | 40 ------ settings.gradle.kts | 43 +++++++ tools/ant-sword/build.gradle | 29 ----- tools/ant-sword/build.gradle.kts | 33 +++++ tools/behinder/build.gradle | 29 ----- tools/behinder/build.gradle.kts | 33 +++++ tools/build.gradle | 5 - tools/godzilla/build.gradle | 28 ----- tools/godzilla/build.gradle.kts | 33 +++++ tools/suo5/build.gradle | 27 ---- tools/suo5/build.gradle.kts | 32 +++++ vul/build.gradle | 10 -- vul/vul-springboot1/build.gradle | 37 ------ vul/vul-springboot1/build.gradle.kts | 27 ++++ vul/vul-springboot2-jetty/build.gradle | 28 ----- vul/vul-springboot2-jetty/build.gradle.kts | 24 ++++ vul/vul-springboot2-undertow/build.gradle | 28 ----- vul/vul-springboot2-undertow/build.gradle.kts | 24 ++++ vul/vul-springboot2-webflux/build.gradle | 14 --- vul/vul-springboot2-webflux/build.gradle.kts | 14 +++ vul/vul-springboot2/build.gradle | 26 ---- vul/vul-springboot2/build.gradle.kts | 22 ++++ vul/vul-springboot3-webflux/build.gradle | 15 --- vul/vul-springboot3-webflux/build.gradle.kts | 15 +++ vul/vul-springboot3/build.gradle | 17 --- vul/vul-springboot3/build.gradle.kts | 17 +++ vul/vul-webapp-deserialize/build.gradle | 58 --------- vul/vul-webapp-deserialize/build.gradle.kts | 62 ++++++++++ vul/vul-webapp-expression/build.gradle | 40 ------ vul/vul-webapp-expression/build.gradle.kts | 39 ++++++ .../{build.gradle => build.gradle.kts} | 8 +- .../{build.gradle => build.gradle.kts} | 8 +- 62 files changed, 911 insertions(+), 1005 deletions(-) delete mode 100644 boot/build.gradle create mode 100644 boot/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/src/main/kotlin/maven-publish-convention.gradle.kts delete mode 100644 deserialize/build.gradle create mode 100644 deserialize/build.gradle.kts delete mode 100644 generator/build.gradle create mode 100644 generator/build.gradle.kts create mode 100644 gradle/libs.versions.toml delete mode 100644 integration-test/build.gradle create mode 100644 integration-test/build.gradle.kts delete mode 100644 memshell-agent/build.gradle delete mode 100644 memshell-agent/memshell-agent-asm/build.gradle create mode 100644 memshell-agent/memshell-agent-asm/build.gradle.kts delete mode 100644 memshell-agent/memshell-agent-attacher/build.gradle create mode 100644 memshell-agent/memshell-agent-attacher/build.gradle.kts delete mode 100644 memshell-agent/memshell-agent-bytebuddy/build.gradle create mode 100644 memshell-agent/memshell-agent-bytebuddy/build.gradle.kts delete mode 100644 memshell-agent/memshell-agent-javassist/build.gradle create mode 100644 memshell-agent/memshell-agent-javassist/build.gradle.kts delete mode 100644 memshell-party-bom/build.gradle create mode 100644 memshell-party-bom/build.gradle.kts delete mode 100644 memshell-party-common/build.gradle create mode 100644 memshell-party-common/build.gradle.kts delete mode 100644 memshell/build.gradle create mode 100644 memshell/build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts delete mode 100644 tools/ant-sword/build.gradle create mode 100644 tools/ant-sword/build.gradle.kts delete mode 100644 tools/behinder/build.gradle create mode 100644 tools/behinder/build.gradle.kts delete mode 100644 tools/build.gradle delete mode 100644 tools/godzilla/build.gradle create mode 100644 tools/godzilla/build.gradle.kts delete mode 100644 tools/suo5/build.gradle create mode 100644 tools/suo5/build.gradle.kts delete mode 100644 vul/build.gradle delete mode 100644 vul/vul-springboot1/build.gradle create mode 100644 vul/vul-springboot1/build.gradle.kts delete mode 100644 vul/vul-springboot2-jetty/build.gradle create mode 100644 vul/vul-springboot2-jetty/build.gradle.kts delete mode 100644 vul/vul-springboot2-undertow/build.gradle create mode 100644 vul/vul-springboot2-undertow/build.gradle.kts delete mode 100644 vul/vul-springboot2-webflux/build.gradle create mode 100644 vul/vul-springboot2-webflux/build.gradle.kts delete mode 100644 vul/vul-springboot2/build.gradle create mode 100644 vul/vul-springboot2/build.gradle.kts delete mode 100644 vul/vul-springboot3-webflux/build.gradle create mode 100644 vul/vul-springboot3-webflux/build.gradle.kts delete mode 100644 vul/vul-springboot3/build.gradle create mode 100644 vul/vul-springboot3/build.gradle.kts delete mode 100644 vul/vul-webapp-deserialize/build.gradle create mode 100644 vul/vul-webapp-deserialize/build.gradle.kts delete mode 100644 vul/vul-webapp-expression/build.gradle create mode 100644 vul/vul-webapp-expression/build.gradle.kts rename vul/vul-webapp-jakarta/{build.gradle => build.gradle.kts} (50%) rename vul/vul-webapp/{build.gradle => build.gradle.kts} (52%) diff --git a/boot/build.gradle b/boot/build.gradle deleted file mode 100644 index 0ee1dea7..00000000 --- a/boot/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '3.4.6' - id 'io.spring.dependency-management' version '1.1.7' -} - -group = 'com.reajason.javaweb' -version = rootProject.version - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - -def runtimeJvmArgs = [ - '--add-opens=java.base/java.util=ALL-UNNAMED', - '--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED', - '--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.runtime=ALL-UNNAMED' -] - -tasks.processResources { filesMatching("**/application.yaml") { expand(project.properties) } } - -tasks.withType(Test).configureEach { - jvmArgs += runtimeJvmArgs -} - -// For running the application -tasks.withType(JavaExec).configureEach { - jvmArgs += runtimeJvmArgs -} - -configurations { - compileOnly { - extendsFrom annotationProcessor - } -} - -dependencies { - implementation(project(":generator")) { - exclude group: 'org.apache.tomcat', module: 'tomcat-catalina' - exclude group: 'commons-logging', module: 'commons-logging' - } - implementation(project(":deserialize")) { - exclude group: 'commons-logging', module: 'commons-logging' - } - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation('org.springframework.boot:spring-boot-starter-web') { - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' - } - implementation 'org.apache.commons:commons-lang3:3.17.0' - implementation 'org.springframework.boot:spring-boot-starter-undertow' - compileOnly 'org.projectlombok:lombok' - developmentOnly 'org.springframework.boot:spring-boot-devtools' - annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' - annotationProcessor 'org.projectlombok:lombok' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' -} - -test { - useJUnitPlatform() -} diff --git a/boot/build.gradle.kts b/boot/build.gradle.kts new file mode 100644 index 00000000..e924863f --- /dev/null +++ b/boot/build.gradle.kts @@ -0,0 +1,48 @@ +plugins { + id("java") + id("org.springframework.boot") version "3.5.0" + id("io.spring.dependency-management") version "1.1.7" +} + +group = "io.github.reajason" +version = rootProject.version + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +tasks.processResources { filesMatching("**/application.yaml") { expand(project.properties) } } + +configurations { + compileOnly { + extendsFrom(configurations.annotationProcessor.get()) + } +} + +dependencies { + implementation(project(":generator")) { + exclude(group = "org.apache.tomcat", module = "tomcat-catalina") + exclude(group = "commons-logging", module = "commons-logging") + } + implementation(project(":deserialize")) { + exclude(group = "commons-logging", module = "commons-logging") + } + implementation("org.springframework.boot:spring-boot-starter-thymeleaf") + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude(group = "org.springframework.boot", module = "spring-boot-starter-tomcat") + } + implementation("org.apache.commons:commons-lang3:3.17.0") + implementation("org.springframework.boot:spring-boot-starter-jetty") + compileOnly("org.projectlombok:lombok") + developmentOnly("org.springframework.boot:spring-boot-devtools") + annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") + annotationProcessor("org.projectlombok:lombok") + testImplementation("org.springframework.boot:spring-boot-starter-test") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 8e8efefe..00000000 --- a/build.gradle +++ /dev/null @@ -1,117 +0,0 @@ -import com.vanniktech.maven.publish.SonatypeHost - -version = '1.10.0-SNAPSHOT' - -buildscript { - repositories { - mavenCentral() - gradlePluginPortal() - } - dependencies { - classpath 'com.vanniktech:gradle-maven-publish-plugin:0.31.0' - classpath "io.freefair.lombok:io.freefair.lombok.gradle.plugin:8.13.1" - } -} - -allprojects { - group = 'io.github.reajason' - - if (it.name != 'memshell-party-bom') { - apply(plugin: 'java') - apply(plugin: 'idea') - apply(plugin: 'jacoco') - apply(plugin: 'io.freefair.lombok') - } - - apply(plugin: 'com.vanniktech.maven.publish') - - mavenPublishing { - publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - signAllPublications() - coordinates("io.github.reajason", project.name, rootProject.version as String) - - pom { - name = 'MemShellParty' - description = project.description - url = 'https://github.com/ReaJason/MemShellParty' - inceptionYear = '2025' - licenses { - license { - name = 'MIT' - url = 'https://spdx.org/licenses/MIT.html' - } - } - developers { - developer { - id = 'reajason' - name = 'ReaJason' - url = "https://reajason.eu.org" - } - } - scm { - connection = 'scm:git:https://github.com/ReaJason/MemShellParty.git' - developerConnection = 'scm:git:ssh://github.com/ReaJason/MemShellParty.git' - url = 'https://github.com/ReaJason/MemShellParty' - } - } - } - - if (it.name != 'memshell-party-bom' && !it.name.startsWith("vul")) { - dependencies { - implementation platform(project(':memshell-party-bom')) - } - } - - repositories { - mavenCentral() - } -} - -idea { - module { - excludeDirs += file('src') - } -} - -jacocoTestReport { - reports { - xml.required = true - csv.required = true - html.required = true - } - afterEvaluate { - executionData.from fileTree(rootDir) { - include '**/build/jacoco/**/*.exec' - } - - sourceDirectories = files('generator/src/main/java') - - classDirectories.from( - fileTree('generator/build/classes/java/main') { - excludes = [ - 'com/reajason/javaweb/memshell/**/godzilla/**', - 'com/reajason/javaweb/memshell/**/injector/**', - 'com/reajason/javaweb/memshell/**/command/**', - 'com/reajason/javaweb/config/**' - ] - } - ) - } -} - -tasks.register('publishAllToMavenCentral') { - def isSnapshot = rootProject.version.toString().endsWith('-SNAPSHOT') - if (isSnapshot) { - dependsOn ':memshell-party-bom:publishAllPublicationsToMavenCentralRepository' - dependsOn ':memshell-party-common:publishAllPublicationsToMavenCentralRepository' - dependsOn ':deserialize:publishAllPublicationsToMavenCentralRepository' - dependsOn ':memshell:publishAllPublicationsToMavenCentralRepository' - dependsOn ':generator:publishAllPublicationsToMavenCentralRepository' - } else { - dependsOn ':memshell-party-bom:publishAndReleaseToMavenCentral' - dependsOn ':memshell-party-common:publishAndReleaseToMavenCentral' - dependsOn ':deserialize:publishAndReleaseToMavenCentral' - dependsOn ':memshell:publishAndReleaseToMavenCentral' - dependsOn ':generator:publishAndReleaseToMavenCentral' - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..de780a0b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("java") +} +version = "1.10.0-SNAPSHOT" + +tasks.register("publishAllToMavenCentral") { + val isSnapshot = rootProject.version.toString().endsWith("-SNAPSHOT") + if (isSnapshot) { + dependsOn(":memshell-party-bom:publishAllPublicationsToMavenCentralRepository") + dependsOn(":memshell-party-common:publishAllPublicationsToMavenCentralRepository") + dependsOn(":deserialize:publishAllPublicationsToMavenCentralRepository") + dependsOn(":memshell:publishAllPublicationsToMavenCentralRepository") + dependsOn(":generator:publishAllPublicationsToMavenCentralRepository") + } else { + dependsOn(":memshell-party-bom:publishAndReleaseToMavenCentral") + dependsOn(":memshell-party-common:publishAndReleaseToMavenCentral") + dependsOn(":deserialize:publishAndReleaseToMavenCentral") + dependsOn(":memshell:publishAndReleaseToMavenCentral") + dependsOn(":generator:publishAndReleaseToMavenCentral") + } +} \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..cd0cb42b --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() +} + +dependencies { + implementation("com.vanniktech:gradle-maven-publish-plugin:0.32.0") +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/maven-publish-convention.gradle.kts b/buildSrc/src/main/kotlin/maven-publish-convention.gradle.kts new file mode 100644 index 00000000..5af7b0ca --- /dev/null +++ b/buildSrc/src/main/kotlin/maven-publish-convention.gradle.kts @@ -0,0 +1,40 @@ +import com.vanniktech.maven.publish.SonatypeHost + +plugins { + id("com.vanniktech.maven.publish") +} + +mavenPublishing { + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) + signAllPublications() + coordinates( + "io.github.reajason", + project.name, + rootProject.version as String + ) + + pom { + name.set("MemShellParty") + description.set(project.description) + url.set("https://github.com/ReaJason/MemShellParty") + inceptionYear.set("2025") + licenses { + license { + name.set("MIT") + url.set("https://spdx.org/licenses/MIT.html") + } + } + developers { + developer { + id.set("reajason") + name.set("ReaJason") + url.set("https://reajason.eu.org") + } + } + scm { + connection.set("scm:git:https://github.com/ReaJason/MemShellParty.git") + developerConnection.set("scm:git:ssh://github.com/ReaJason/MemShellParty.git") + url.set("https://github.com/ReaJason/MemShellParty") + } + } +} \ No newline at end of file diff --git a/deserialize/build.gradle b/deserialize/build.gradle deleted file mode 100644 index 24d3e795..00000000 --- a/deserialize/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -group = 'io.github.reajason' -description = "Java deserialize payload for MemShellParty" -version = rootProject.version - -dependencies { - implementation project(":memshell-party-common") - implementation 'net.bytebuddy:byte-buddy' - - implementation 'com.caucho:hessian:4.0.66' - implementation 'commons-beanutils:commons-beanutils:1.9.2' - implementation 'commons-collections:commons-collections:3.2.1' - implementation 'org.apache.commons:commons-collections4:4.0' - - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/deserialize/build.gradle.kts b/deserialize/build.gradle.kts new file mode 100644 index 00000000..add0db51 --- /dev/null +++ b/deserialize/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("java") + alias(libs.plugins.lombok) + id("maven-publish-convention") +} + +group = "io.github.reajason" +description = "Java deserialize payload for MemShellParty" +version = rootProject.version + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation(project(":memshell-party-common")) + implementation("net.bytebuddy:byte-buddy") + implementation("com.caucho:hessian:4.0.66") + implementation("commons-beanutils:commons-beanutils:1.9.2") + implementation("commons-collections:commons-collections:3.2.1") + implementation("org.apache.commons:commons-collections4:4.0") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +tasks.test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/generator/build.gradle b/generator/build.gradle deleted file mode 100644 index 53129e46..00000000 --- a/generator/build.gradle +++ /dev/null @@ -1,64 +0,0 @@ -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -group = 'io.github.reajason' -description = "MemShell Generator for Java" -version = rootProject.version - -// 测试使用 JDK17 进行编译与运行 -tasks.withType(Test).configureEach { - javaLauncher = javaToolchains.launcherFor { - languageVersion = JavaLanguageVersion.of(17) - } -} - -tasks.named('compileTestJava') { - javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(17) - } - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} - -test { - useJUnitPlatform() - finalizedBy jacocoTestReport -} - -dependencies { - implementation project(":memshell-party-common") - implementation project(":deserialize") - - implementation project(":memshell") - implementation 'net.bytebuddy:byte-buddy' - implementation 'org.ow2.asm:asm-commons' - - implementation 'net.java.dev.jna:jna' - implementation 'net.java.dev.jna:jna-platform' - - implementation 'javax.servlet:javax.servlet-api' - implementation 'javax.websocket:javax.websocket-api' - - implementation 'org.apache.bcel:bcel' - - implementation 'commons-io:commons-io' - implementation 'org.apache.commons:commons-lang3' - implementation 'com.squareup.okhttp3:okhttp' - implementation 'ch.qos.logback:logback-classic' - implementation 'com.fasterxml.jackson.core:jackson-databind' - - implementation 'org.springframework:spring-webmvc' - implementation 'org.springframework:spring-webflux' - implementation 'io.projectreactor.netty:reactor-netty-core' - - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation "org.mockito:mockito-core" - testImplementation 'org.mockito:mockito-junit-jupiter' -} \ No newline at end of file diff --git a/generator/build.gradle.kts b/generator/build.gradle.kts new file mode 100644 index 00000000..992054be --- /dev/null +++ b/generator/build.gradle.kts @@ -0,0 +1,55 @@ +plugins { + id("java") + alias(libs.plugins.lombok) + id("maven-publish-convention") +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +group = "io.github.reajason" +description = "MemShell Generator for Java" +version = rootProject.version + +tasks.compileTestJava { + javaCompiler.set(javaToolchains.compilerFor { + languageVersion.set(JavaLanguageVersion.of(17)) + }) +} + +tasks.test { + useJUnitPlatform() +} + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation(project(":memshell-party-common")) + implementation(project(":deserialize")) + + implementation(project(":memshell")) + implementation("net.bytebuddy:byte-buddy") + implementation("org.ow2.asm:asm-commons") + implementation("net.java.dev.jna:jna") + implementation("net.java.dev.jna:jna-platform") + implementation("javax.servlet:javax.servlet-api") + implementation("javax.websocket:javax.websocket-api") + implementation("org.apache.bcel:bcel") + implementation("commons-io:commons-io") + implementation("org.apache.commons:commons-lang3") + implementation("com.squareup.okhttp3:okhttp") + implementation("ch.qos.logback:logback-classic") + implementation("com.fasterxml.jackson.core:jackson-databind") + implementation("org.springframework:spring-webmvc") + implementation("org.springframework:spring-webflux") + implementation("io.projectreactor.netty:reactor-netty-core") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") + testImplementation("org.mockito:mockito-core") + testImplementation("org.mockito:mockito-junit-jupiter") +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..f1384e3a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,2 @@ +[plugins] +lombok = { id = "io.freefair.lombok", version = "8.13.1" } \ No newline at end of file diff --git a/gradlew b/gradlew index faf93008..23d15a93 100755 --- a/gradlew +++ b/gradlew @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9b42019c..5eed7ee8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/integration-test/build.gradle b/integration-test/build.gradle deleted file mode 100644 index 48897fc5..00000000 --- a/integration-test/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -group = 'io.github.reajason' -version = rootProject.version - -dependencies { - testImplementation project(":vul:vul-webapp") - testImplementation project(":memshell-party-common") - testImplementation project(":tools:behinder") - testImplementation project(":tools:godzilla") - testImplementation project(":tools:suo5") - testImplementation project(":tools:ant-sword") - testImplementation project(':generator') - - testImplementation 'net.bytebuddy:byte-buddy' - - testImplementation 'javax.servlet:javax.servlet-api' - testImplementation 'javax.websocket:javax.websocket-api' - - testImplementation 'org.java-websocket:Java-WebSocket' - testImplementation 'com.squareup.okhttp3:okhttp' - testImplementation 'org.slf4j:slf4j-simple:2.0.16' - - testImplementation platform('org.junit:junit-bom') - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.junit.platform:junit-platform-reporting' - testImplementation 'org.hamcrest:hamcrest' - testImplementation 'org.testcontainers:testcontainers' - testImplementation 'org.testcontainers:junit-jupiter' -} - -tasks.withType(Test).tap { - configureEach { - testLogging { - events "passed", "skipped", "failed" - } - } -} - -tasks.withType(Test).configureEach { - jvmArgs += [ - '--add-opens=java.base/java.util=ALL-UNNAMED', - '--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED', - '--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.runtime=ALL-UNNAMED' - ] -} - -idea { - module { - excludeDirs += file('src/main') - } -} - -test { - useJUnitPlatform() - finalizedBy jacocoTestReport -} \ No newline at end of file diff --git a/integration-test/build.gradle.kts b/integration-test/build.gradle.kts new file mode 100644 index 00000000..e11540aa --- /dev/null +++ b/integration-test/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + id("java") + alias(libs.plugins.lombok) +} + +group = "io.github.reajason" +version = rootProject.version + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + testImplementation(project(":vul:vul-webapp")) + testImplementation(project(":memshell-party-common")) + testImplementation(project(":tools:behinder")) + testImplementation(project(":tools:godzilla")) + testImplementation(project(":tools:suo5")) + testImplementation(project(":tools:ant-sword")) + testImplementation(project(":generator")) + testImplementation("net.bytebuddy:byte-buddy") + testImplementation("javax.servlet:javax.servlet-api") + testImplementation("javax.websocket:javax.websocket-api") + testImplementation("org.java-websocket:Java-WebSocket") + testImplementation("com.squareup.okhttp3:okhttp") + testImplementation("org.slf4j:slf4j-simple:2.0.16") + testImplementation(platform("org.junit:junit-bom")) + testRuntimeOnly("org.junit.platform:junit-platform-launcher") + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation("org.junit.platform:junit-platform-reporting") + testImplementation("org.hamcrest:hamcrest") + testImplementation("org.testcontainers:testcontainers") + testImplementation("org.testcontainers:junit-jupiter") +} + +tasks.test { + useJUnitPlatform() + jvmArgs( + "--add-opens=java.base/java.util=ALL-UNNAMED", + "--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED", + "--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.runtime=ALL-UNNAMED" + ) + testLogging { + events("passed", "skipped", "failed") + } +} \ No newline at end of file diff --git a/memshell-agent/build.gradle b/memshell-agent/build.gradle deleted file mode 100644 index 0a9217f7..00000000 --- a/memshell-agent/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -idea { - module { - excludeDirs += file('src') - } -} - -subprojects { - group = 'com.reajason.javaweb.memshell-agent' - version = '' -} \ No newline at end of file diff --git a/memshell-agent/memshell-agent-asm/build.gradle b/memshell-agent/memshell-agent-asm/build.gradle deleted file mode 100644 index e1c91248..00000000 --- a/memshell-agent/memshell-agent-asm/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'java' - id "com.gradleup.shadow" version "8.3.6" -} - -group = 'com.reajason.javaweb' -version = '1.0.0' - -repositories { - mavenCentral() -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 -} - -dependencies { - implementation 'org.ow2.asm:asm-commons:9.8' -} - -jar { - manifest { - attributes 'Premain-Class': 'com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer' - attributes 'Agent-Class': 'com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer' - attributes 'Can-Redefine-Classes': true - attributes 'Can-Retransform-Classes': true - attributes 'Can-Set-Native-Method-Prefix': true - } -} - -jar.finalizedBy shadowJar \ No newline at end of file diff --git a/memshell-agent/memshell-agent-asm/build.gradle.kts b/memshell-agent/memshell-agent-asm/build.gradle.kts new file mode 100644 index 00000000..ddf8bb41 --- /dev/null +++ b/memshell-agent/memshell-agent-asm/build.gradle.kts @@ -0,0 +1,30 @@ +plugins { + id("java") + id("com.gradleup.shadow") version "8.3.6" +} + +group = "com.reajason.javaweb" +version = "1.0.0" + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_6 + targetCompatibility = JavaVersion.VERSION_1_6 +} + +dependencies { + implementation("org.ow2.asm:asm-commons:9.8") +} + +tasks.jar { + manifest { + attributes("Premain-Class" to "com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer") + attributes("Agent-Class" to "com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer") + attributes("Can-Redefine-Classes" to true) + attributes("Can-Retransform-Classes" to true) + attributes("Can-Set-Native-Method-Prefix" to true) + } + finalizedBy(tasks.shadowJar) +} \ No newline at end of file diff --git a/memshell-agent/memshell-agent-attacher/build.gradle b/memshell-agent/memshell-agent-attacher/build.gradle deleted file mode 100644 index b85d1c11..00000000 --- a/memshell-agent/memshell-agent-attacher/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -plugins { - id 'java' - id "com.gradleup.shadow" version "8.3.6" -} - -group = 'com.reajason.javaweb' -version = '1.0.0' - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 -} - -dependencies { - implementation 'net.java.dev.jna:jna:5.17.0' - implementation 'net.java.dev.jna:jna-platform:5.17.0' -} - -jar { - manifest { - attributes 'Premain-Class': 'Agent' - attributes 'Agent-Class': 'Agent' - attributes 'Main-Class': "Main" - attributes 'Can-Redefine-Classes': true - attributes 'Can-Retransform-Classes': true - attributes 'Can-Set-Native-Method-Prefix': true - } -} - -jar.finalizedBy shadowJar diff --git a/memshell-agent/memshell-agent-attacher/build.gradle.kts b/memshell-agent/memshell-agent-attacher/build.gradle.kts new file mode 100644 index 00000000..91e3fc56 --- /dev/null +++ b/memshell-agent/memshell-agent-attacher/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("java") + id("com.gradleup.shadow") version "8.3.6" +} + +group = "com.reajason.javaweb" +version = "1.0.0" + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_6 + targetCompatibility = JavaVersion.VERSION_1_6 +} + +dependencies { + implementation("net.java.dev.jna:jna:5.17.0") + implementation("net.java.dev.jna:jna-platform:5.17.0") +} + +tasks.jar { + manifest { + attributes("Premain-Class" to "Agent") + attributes("Agent-Class" to "Agent") + attributes("Main-Class" to "Main") + attributes("Can-Redefine-Classes" to true) + attributes("Can-Retransform-Classes" to true) + attributes("Can-Set-Native-Method-Prefix" to true) + } + finalizedBy(tasks.shadowJar) +} + diff --git a/memshell-agent/memshell-agent-bytebuddy/build.gradle b/memshell-agent/memshell-agent-bytebuddy/build.gradle deleted file mode 100644 index 76d8325a..00000000 --- a/memshell-agent/memshell-agent-bytebuddy/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -plugins { - id 'java' - id "com.gradleup.shadow" version "8.3.6" -} - -group = 'com.reajason.javaweb' -version = '1.0.0' - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 -} - -dependencies { - implementation 'net.bytebuddy:byte-buddy:1.17.5' -} - -jar { - manifest { - attributes 'Premain-Class': 'com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer' - attributes 'Agent-Class': 'com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer' - attributes 'Can-Redefine-Classes': true - attributes 'Can-Retransform-Classes': true - attributes 'Can-Set-Native-Method-Prefix': true - } -} - -jar.finalizedBy shadowJar \ No newline at end of file diff --git a/memshell-agent/memshell-agent-bytebuddy/build.gradle.kts b/memshell-agent/memshell-agent-bytebuddy/build.gradle.kts new file mode 100644 index 00000000..412b62af --- /dev/null +++ b/memshell-agent/memshell-agent-bytebuddy/build.gradle.kts @@ -0,0 +1,31 @@ +plugins { + id("java") + id("com.gradleup.shadow") version "8.3.6" +} + +group = "com.reajason.javaweb" +version = "1.0.0" + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_6 + targetCompatibility = JavaVersion.VERSION_1_6 +} + +dependencies { + implementation("net.bytebuddy:byte-buddy:1.17.5") +} + +tasks.jar { + manifest { + attributes("Premain-Class" to "com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer") + attributes("Agent-Class" to "com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer") + attributes("Can-Redefine-Classes" to true) + attributes("Can-Retransform-Classes" to true) + attributes("Can-Set-Native-Method-Prefix" to true) + } + + finalizedBy(tasks.shadowJar) +} \ No newline at end of file diff --git a/memshell-agent/memshell-agent-javassist/build.gradle b/memshell-agent/memshell-agent-javassist/build.gradle deleted file mode 100644 index 495774bc..00000000 --- a/memshell-agent/memshell-agent-javassist/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -plugins { - id 'java' - id "com.gradleup.shadow" version "8.3.6" -} - -group = 'com.reajason.javaweb' -version = '1.0.0' - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 -} - -dependencies { - implementation 'org.javassist:javassist:3.30.2-GA' -} - -jar { - manifest { - attributes 'Premain-Class': 'com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer' - attributes 'Agent-Class': 'com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer' - attributes 'Can-Redefine-Classes': true - attributes 'Can-Retransform-Classes': true - attributes 'Can-Set-Native-Method-Prefix': true - } -} - -jar.finalizedBy shadowJar \ No newline at end of file diff --git a/memshell-agent/memshell-agent-javassist/build.gradle.kts b/memshell-agent/memshell-agent-javassist/build.gradle.kts new file mode 100644 index 00000000..8238715a --- /dev/null +++ b/memshell-agent/memshell-agent-javassist/build.gradle.kts @@ -0,0 +1,30 @@ +plugins { + id("java") + id("com.gradleup.shadow") version "8.3.6" +} + +group = "com.reajason.javaweb" +version = "1.0.0" + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_6 + targetCompatibility = JavaVersion.VERSION_1_6 +} + +dependencies { + implementation("org.javassist:javassist:3.30.2-GA") +} + +tasks.jar { + manifest { + attributes("Premain-Class" to "com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer") + attributes("Agent-Class" to "com.reajason.javaweb.memshell.agent.CommandFilterChainTransformer") + attributes("Can-Redefine-Classes" to true) + attributes("Can-Retransform-Classes" to true) + attributes("Can-Set-Native-Method-Prefix" to true) + } + finalizedBy(tasks.shadowJar) +} \ No newline at end of file diff --git a/memshell-party-bom/build.gradle b/memshell-party-bom/build.gradle deleted file mode 100644 index 7644a189..00000000 --- a/memshell-party-bom/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ -plugins { - id 'java-platform' -} - -group = "io.github.reajason" -description = "This Bill of Materials POM can be used to ease dependency management when referencing multiple MemShellParty artifacts using Gradle or Maven." -version = rootProject.version - -dependencies { - constraints { - api 'net.bytebuddy:byte-buddy:1.17.5' - api 'org.ow2.asm:asm-commons:9.8' - - // JDK6 版本依赖 - api 'net.java.dev.jna:jna:5.13.0' - api 'net.java.dev.jna:jna-platform:5.13.0' - - api 'javax.servlet:javax.servlet-api:3.0.1' - api 'jakarta.servlet:jakarta.servlet-api:6.0.0' - api 'javax.websocket:javax.websocket-api:1.1' - - api 'org.springframework:spring-webmvc:5.3.24' - api 'org.springframework:spring-webflux:5.3.24' - api 'io.projectreactor.netty:reactor-netty-core:1.1.25' - - api 'commons-io:commons-io:2.19.0' - api 'org.apache.commons:commons-lang3:3.17.0' - api 'commons-codec:commons-codec:1.18.0' - api 'ch.qos.logback:logback-classic:1.5.18' - - api 'org.apache.bcel:bcel:5.2' - - api 'org.java-websocket:Java-WebSocket:1.6.0' - api 'com.squareup.okhttp3:okhttp:4.12.0' - api 'com.alibaba.fastjson2:fastjson2:2.0.57' - api 'com.fasterxml.jackson.core:jackson-databind:2.19.0' - - api 'org.jetbrains:annotations:26.0.2' - - api 'org.mockito:mockito-core:5.18.0' - api 'org.mockito:mockito-junit-jupiter:5.18.0' - api 'org.hamcrest:hamcrest:3.0' - api 'org.junit:junit-bom:5.12.2' - api 'org.testcontainers:testcontainers:1.21.0' - api 'org.testcontainers:junit-jupiter:1.21.0' - } -} \ No newline at end of file diff --git a/memshell-party-bom/build.gradle.kts b/memshell-party-bom/build.gradle.kts new file mode 100644 index 00000000..46808855 --- /dev/null +++ b/memshell-party-bom/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("java-platform") + id("maven-publish-convention") +} + +group = "io.github.reajason" +description = + "This Bill of Materials POM can be used to ease dependency management when referencing multiple MemShellParty artifacts using Gradle or Maven." +version = rootProject.version + +dependencies { + constraints { + api("net.bytebuddy:byte-buddy:1.17.5") + api("org.ow2.asm:asm-commons:9.8") + api("net.java.dev.jna:jna:5.13.0") + api("net.java.dev.jna:jna-platform:5.13.0") + api("javax.servlet:javax.servlet-api:3.0.1") + api("jakarta.servlet:jakarta.servlet-api:6.0.0") + api("javax.websocket:javax.websocket-api:1.1") + api("org.springframework:spring-webmvc:5.3.24") + api("org.springframework:spring-webflux:5.3.24") + api("io.projectreactor.netty:reactor-netty-core:1.1.25") + api("commons-io:commons-io:2.19.0") + api("org.apache.commons:commons-lang3:3.17.0") + api("commons-codec:commons-codec:1.18.0") + api("ch.qos.logback:logback-classic:1.5.18") + api("org.apache.bcel:bcel:5.2") + api("org.java-websocket:Java-WebSocket:1.6.0") + api("com.squareup.okhttp3:okhttp:4.12.0") + api("com.alibaba.fastjson2:fastjson2:2.0.57") + api("com.fasterxml.jackson.core:jackson-databind:2.19.0") + api("org.jetbrains:annotations:26.0.2") + api("org.mockito:mockito-core:5.18.0") + api("org.mockito:mockito-junit-jupiter:5.18.0") + api("org.hamcrest:hamcrest:3.0") + api("org.junit:junit-bom:5.12.2") + api("org.testcontainers:testcontainers:1.21.0") + api("org.testcontainers:junit-jupiter:1.21.0") + } +} \ No newline at end of file diff --git a/memshell-party-common/build.gradle b/memshell-party-common/build.gradle deleted file mode 100644 index 657b56b2..00000000 --- a/memshell-party-common/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -group = 'io.github.reajason' -description = "Common Utilities for MemShellParty" -version = rootProject.version - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencies { - implementation 'net.bytebuddy:byte-buddy' - implementation 'org.ow2.asm:asm-commons' - implementation 'commons-io:commons-io' - implementation 'org.apache.commons:commons-lang3' - implementation 'commons-codec:commons-codec' - implementation 'org.jetbrains:annotations' - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation "org.mockito:mockito-core" -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/memshell-party-common/build.gradle.kts b/memshell-party-common/build.gradle.kts new file mode 100644 index 00000000..9abb797e --- /dev/null +++ b/memshell-party-common/build.gradle.kts @@ -0,0 +1,35 @@ +plugins { + id("java") + alias(libs.plugins.lombok) + id("maven-publish-convention") +} + +group = "io.github.reajason" +description = "Common Utilities for MemShellParty" +version = rootProject.version + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation("net.bytebuddy:byte-buddy") + implementation("org.ow2.asm:asm-commons") + implementation("commons-io:commons-io") + implementation("org.apache.commons:commons-lang3") + implementation("commons-codec:commons-codec") + implementation("org.jetbrains:annotations") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") + testImplementation("org.mockito:mockito-core") +} + +tasks.test { + useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + } +} \ No newline at end of file diff --git a/memshell/build.gradle b/memshell/build.gradle deleted file mode 100644 index 2d2416ab..00000000 --- a/memshell/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -group = 'io.github.reajason' -description = "Normal Java MemShell" -version = rootProject.version - - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencies { - implementation 'net.bytebuddy:byte-buddy' - implementation 'org.ow2.asm:asm-commons' - implementation 'javax.servlet:javax.servlet-api' - implementation 'javax.websocket:javax.websocket-api' - implementation 'org.springframework:spring-webmvc' - implementation 'org.springframework:spring-webflux' - implementation 'io.projectreactor.netty:reactor-netty-core' -} \ No newline at end of file diff --git a/memshell/build.gradle.kts b/memshell/build.gradle.kts new file mode 100644 index 00000000..0131dbf6 --- /dev/null +++ b/memshell/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("java") + alias(libs.plugins.lombok) + id("maven-publish-convention") +} + +group = "io.github.reajason" +description = "Normal Java MemShell" +version = rootProject.version + + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation("net.bytebuddy:byte-buddy") + implementation("org.ow2.asm:asm-commons") + implementation("javax.servlet:javax.servlet-api") + implementation("javax.websocket:javax.websocket-api") + implementation("org.springframework:spring-webmvc") + implementation("org.springframework:spring-webflux") + implementation("io.projectreactor.netty:reactor-netty-core") +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e2773cf3..00000000 --- a/settings.gradle +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0' -} - -rootProject.name = 'memshell-party' - -include 'memshell-party-bom' -include 'memshell-party-common' - -include 'tools' -include 'tools:godzilla' -include 'tools:behinder' -include 'tools:suo5' -include 'tools:ant-sword' - -include 'memshell' - -include 'deserialize' -include 'boot' -include 'generator' -include 'integration-test' - -include 'vul' -include 'vul:vul-webapp' -include 'vul:vul-webapp-jakarta' -include 'vul:vul-webapp-expression' -include 'vul:vul-webapp-deserialize' -include 'vul:vul-springboot1' -include 'vul:vul-springboot2' -include 'vul:vul-springboot2-jetty' -include 'vul:vul-springboot2-undertow' -include 'vul:vul-springboot3' -include 'vul:vul-springboot2-webflux' -include 'vul:vul-springboot3-webflux' - -include 'memshell-agent' -include 'memshell-agent:memshell-agent-attacher' -include 'memshell-agent:memshell-agent-asm' -include 'memshell-agent:memshell-agent-javassist' -include 'memshell-agent:memshell-agent-bytebuddy' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..478621fa --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,43 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention").version("1.0.0") +} + +dependencyResolutionManagement { + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS + repositories { + mavenCentral() + } +} + +rootProject.name = "memshell-party" + +include("memshell-party-bom") +include("memshell-party-common") +include("tools:godzilla", "tools:behinder", "tools:suo5", "tools:ant-sword") +include("memshell") +include("deserialize") +include("boot") +include("generator") +include("integration-test") +include("vul:vul-webapp") +include("vul:vul-webapp-jakarta") +include("vul:vul-webapp-expression") +include("vul:vul-webapp-deserialize") +include("vul:vul-springboot1") +include("vul:vul-springboot2") +include("vul:vul-springboot2-jetty") +include("vul:vul-springboot2-undertow") +include("vul:vul-springboot3") +include("vul:vul-springboot2-webflux") +include("vul:vul-springboot3-webflux") +include("memshell-agent:memshell-agent-attacher") +include("memshell-agent:memshell-agent-asm") +include("memshell-agent:memshell-agent-javassist") +include("memshell-agent:memshell-agent-bytebuddy") \ No newline at end of file diff --git a/tools/ant-sword/build.gradle b/tools/ant-sword/build.gradle deleted file mode 100644 index 89c5ffe6..00000000 --- a/tools/ant-sword/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -group = 'com.reajason.javaweb.tools' -version = rootProject.version - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencies { - implementation project(":memshell-party-common") - implementation 'net.bytebuddy:byte-buddy' - - implementation 'javax.servlet:javax.servlet-api' - implementation 'commons-io:commons-io' - implementation 'org.apache.commons:commons-lang3' - implementation 'commons-codec:commons-codec' - - implementation 'com.squareup.okhttp3:okhttp' - implementation 'com.alibaba.fastjson2:fastjson2' - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/tools/ant-sword/build.gradle.kts b/tools/ant-sword/build.gradle.kts new file mode 100644 index 00000000..ca82839d --- /dev/null +++ b/tools/ant-sword/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("java") + alias(libs.plugins.lombok) +} + +group = "io.github.reajason" +version = rootProject.version + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation(project(":memshell-party-common")) + implementation("net.bytebuddy:byte-buddy") + implementation("javax.servlet:javax.servlet-api") + implementation("commons-io:commons-io") + implementation("org.apache.commons:commons-lang3") + implementation("commons-codec:commons-codec") + implementation("com.squareup.okhttp3:okhttp") + implementation("com.alibaba.fastjson2:fastjson2") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") +} + +tasks.test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/tools/behinder/build.gradle b/tools/behinder/build.gradle deleted file mode 100644 index 3e0ef453..00000000 --- a/tools/behinder/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -group = 'io.github.reajason.tools' -version = rootProject.version - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - - -dependencies { - implementation project(":memshell-party-common") - implementation 'net.bytebuddy:byte-buddy' - - implementation 'commons-io:commons-io' - implementation 'org.apache.commons:commons-lang3' - implementation 'commons-codec:commons-codec' - - implementation 'com.squareup.okhttp3:okhttp' - implementation 'com.alibaba.fastjson2:fastjson2' - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/tools/behinder/build.gradle.kts b/tools/behinder/build.gradle.kts new file mode 100644 index 00000000..67aebe9f --- /dev/null +++ b/tools/behinder/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("java") + alias(libs.plugins.lombok) +} + +group = "io.github.reajason" +version = rootProject.version + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation(project(":memshell-party-common")) + implementation("net.bytebuddy:byte-buddy") + implementation("commons-io:commons-io") + implementation("org.apache.commons:commons-lang3") + implementation("commons-codec:commons-codec") + implementation("com.squareup.okhttp3:okhttp") + implementation("com.alibaba.fastjson2:fastjson2") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") +} + +tasks.test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/tools/build.gradle b/tools/build.gradle deleted file mode 100644 index 82efb077..00000000 --- a/tools/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -idea { - module { - excludeDirs += file('src') - } -} \ No newline at end of file diff --git a/tools/godzilla/build.gradle b/tools/godzilla/build.gradle deleted file mode 100644 index 31e5b2bd..00000000 --- a/tools/godzilla/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -group = 'io.github.reajason.tools' -version = rootProject.version - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - - -dependencies { - implementation project(":memshell-party-common") - - implementation 'net.bytebuddy:byte-buddy' - - implementation 'commons-io:commons-io' - implementation 'org.apache.commons:commons-lang3' - implementation 'commons-codec:commons-codec' - - implementation 'com.squareup.okhttp3:okhttp' - implementation 'org.java-websocket:Java-WebSocket' - - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/tools/godzilla/build.gradle.kts b/tools/godzilla/build.gradle.kts new file mode 100644 index 00000000..132e7ea1 --- /dev/null +++ b/tools/godzilla/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("java") + alias(libs.plugins.lombok) +} + +group = "io.github.reajason" +version = rootProject.version + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation(project(":memshell-party-common")) + implementation("net.bytebuddy:byte-buddy") + implementation("commons-io:commons-io") + implementation("org.apache.commons:commons-lang3") + implementation("commons-codec:commons-codec") + implementation("com.squareup.okhttp3:okhttp") + implementation("org.java-websocket:Java-WebSocket") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") +} + +tasks.test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/tools/suo5/build.gradle b/tools/suo5/build.gradle deleted file mode 100644 index 4d1c8b56..00000000 --- a/tools/suo5/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -group = 'io.github.reajason.tools' -version = rootProject.version - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - - -dependencies { - implementation project(":memshell-party-common") - - implementation 'net.bytebuddy:byte-buddy' - - implementation 'commons-io:commons-io' - implementation 'org.apache.commons:commons-lang3' - implementation 'commons-codec:commons-codec' - - implementation 'com.squareup.okhttp3:okhttp' - - testImplementation platform('org.junit:junit-bom') - testImplementation 'org.junit.jupiter:junit-jupiter' -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/tools/suo5/build.gradle.kts b/tools/suo5/build.gradle.kts new file mode 100644 index 00000000..5c0efb0f --- /dev/null +++ b/tools/suo5/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("java") + alias(libs.plugins.lombok) +} + +group = "io.github.reajason" +version = rootProject.version + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + + +dependencies { + implementation(platform(project(":memshell-party-bom"))) + implementation(project(":memshell-party-common")) + implementation("net.bytebuddy:byte-buddy") + implementation("commons-io:commons-io") + implementation("org.apache.commons:commons-lang3") + implementation("commons-codec:commons-codec") + implementation("com.squareup.okhttp3:okhttp") + testImplementation(platform("org.junit:junit-bom")) + testImplementation("org.junit.jupiter:junit-jupiter") +} + +tasks.test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/vul/build.gradle b/vul/build.gradle deleted file mode 100644 index ba200d91..00000000 --- a/vul/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -idea { - module { - excludeDirs += file('src') - } -} - -subprojects { - group = 'com.reajason.javaweb.vul' - version = '' -} \ No newline at end of file diff --git a/vul/vul-springboot1/build.gradle b/vul/vul-springboot1/build.gradle deleted file mode 100644 index 7c09bf7a..00000000 --- a/vul/vul-springboot1/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'java' - id 'war' -} - -java { - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 -} - -repositories { - mavenCentral() -} - -configurations { - providedRuntime -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web:1.5.22.RELEASE' - providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat:1.5.22.RELEASE' - testImplementation 'org.springframework.boot:spring-boot-starter-test:1.5.22.RELEASE' -} - -tasks.register('bootJar', Jar) { - archiveBaseName = project.name - archiveVersion = project.version - - from sourceSets.main.output - from { - configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } - } - manifest { - attributes 'Main-Class': 'com.reajason.javaweb.vul.springboot1.VulSpringboot1Application' - } - duplicatesStrategy = DuplicatesStrategy.EXCLUDE -} diff --git a/vul/vul-springboot1/build.gradle.kts b/vul/vul-springboot1/build.gradle.kts new file mode 100644 index 00000000..095611af --- /dev/null +++ b/vul/vul-springboot1/build.gradle.kts @@ -0,0 +1,27 @@ +plugins { + id("java") + id("war") +} + +java { + targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-web:1.5.22.RELEASE") + providedRuntime("org.springframework.boot:spring-boot-starter-tomcat:1.5.22.RELEASE") + testImplementation("org.springframework.boot:spring-boot-starter-test:1.5.22.RELEASE") +} + +tasks.register("bootJar", Jar::class.java) { + archiveBaseName.set(project.name) + archiveVersion.set("") + + from(sourceSets.main.get().output) + from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) + manifest { + attributes["Main-Class"] = "com.reajason.javaweb.vul.springboot1.VulSpringboot1Application" + } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} diff --git a/vul/vul-springboot2-jetty/build.gradle b/vul/vul-springboot2-jetty/build.gradle deleted file mode 100644 index 959998c6..00000000 --- a/vul/vul-springboot2-jetty/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'org.springframework.boot' version '2.7.6' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' - id 'java' - id 'war' -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 -} - -repositories { - mavenCentral() -} - -dependencies { - implementation('org.springframework.boot:spring-boot-starter-web') { - exclude module: "spring-boot-starter-tomcat" - } - implementation 'commons-io:commons-io:2.19.0' - implementation 'net.bytebuddy:byte-buddy:1.10.10' - implementation 'org.springframework.boot:spring-boot-starter-jetty' - testImplementation 'org.springframework.boot:spring-boot-starter-test' -} - -test { - useJUnitPlatform() -} diff --git a/vul/vul-springboot2-jetty/build.gradle.kts b/vul/vul-springboot2-jetty/build.gradle.kts new file mode 100644 index 00000000..a1b56eca --- /dev/null +++ b/vul/vul-springboot2-jetty/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("org.springframework.boot") version "2.7.6" + id("io.spring.dependency-management") version "1.0.15.RELEASE" + id("java") + id("war") +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude(module = "spring-boot-starter-tomcat") + } + implementation("commons-io:commons-io:2.19.0") + implementation("net.bytebuddy:byte-buddy:1.10.10") + implementation("org.springframework.boot:spring-boot-starter-jetty") + testImplementation("org.springframework.boot:spring-boot-starter-test") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/vul/vul-springboot2-undertow/build.gradle b/vul/vul-springboot2-undertow/build.gradle deleted file mode 100644 index 624dc20d..00000000 --- a/vul/vul-springboot2-undertow/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'org.springframework.boot' version '2.7.6' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' - id 'java' - id 'war' -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 -} - -repositories { - mavenCentral() -} - -dependencies { - implementation('org.springframework.boot:spring-boot-starter-web') { - exclude module: "spring-boot-starter-tomcat" - } - implementation 'commons-io:commons-io:2.19.0' - implementation 'net.bytebuddy:byte-buddy:1.10.10' - implementation 'org.springframework.boot:spring-boot-starter-undertow' - testImplementation 'org.springframework.boot:spring-boot-starter-test' -} - -test { - useJUnitPlatform() -} diff --git a/vul/vul-springboot2-undertow/build.gradle.kts b/vul/vul-springboot2-undertow/build.gradle.kts new file mode 100644 index 00000000..9f534e07 --- /dev/null +++ b/vul/vul-springboot2-undertow/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("org.springframework.boot") version "2.7.6" + id("io.spring.dependency-management") version "1.0.15.RELEASE" + id("java") + id("war") +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-web") { + exclude(module = "spring-boot-starter-tomcat") + } + implementation("commons-io:commons-io:2.19.0") + implementation("net.bytebuddy:byte-buddy:1.10.10") + implementation("org.springframework.boot:spring-boot-starter-undertow") + testImplementation("org.springframework.boot:spring-boot-starter-test") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/vul/vul-springboot2-webflux/build.gradle b/vul/vul-springboot2-webflux/build.gradle deleted file mode 100644 index 0614ebc3..00000000 --- a/vul/vul-springboot2-webflux/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id 'org.springframework.boot' version '2.7.6' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' - id 'java' -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' -} \ No newline at end of file diff --git a/vul/vul-springboot2-webflux/build.gradle.kts b/vul/vul-springboot2-webflux/build.gradle.kts new file mode 100644 index 00000000..429324e9 --- /dev/null +++ b/vul/vul-springboot2-webflux/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("org.springframework.boot") version "2.7.6" + id("io.spring.dependency-management") version "1.0.15.RELEASE" + id("java") +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-webflux") +} \ No newline at end of file diff --git a/vul/vul-springboot2/build.gradle b/vul/vul-springboot2/build.gradle deleted file mode 100644 index 76cd8e8a..00000000 --- a/vul/vul-springboot2/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id 'org.springframework.boot' version '2.7.6' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' - id 'java' - id 'war' -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 -} - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'commons-io:commons-io:2.19.0' - implementation 'net.bytebuddy:byte-buddy:1.10.10' - providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' - testImplementation 'org.springframework.boot:spring-boot-starter-test' -} - -test { - useJUnitPlatform() -} diff --git a/vul/vul-springboot2/build.gradle.kts b/vul/vul-springboot2/build.gradle.kts new file mode 100644 index 00000000..4dabebaa --- /dev/null +++ b/vul/vul-springboot2/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("org.springframework.boot") version "2.7.6" + id("io.spring.dependency-management") version "1.0.15.RELEASE" + id("java") + id("war") +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("commons-io:commons-io:2.19.0") + implementation("net.bytebuddy:byte-buddy:1.10.10") + providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") + testImplementation("org.springframework.boot:spring-boot-starter-test") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/vul/vul-springboot3-webflux/build.gradle b/vul/vul-springboot3-webflux/build.gradle deleted file mode 100644 index 8b1624be..00000000 --- a/vul/vul-springboot3-webflux/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '3.3.7' - id 'io.spring.dependency-management' version '1.1.7' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' -} diff --git a/vul/vul-springboot3-webflux/build.gradle.kts b/vul/vul-springboot3-webflux/build.gradle.kts new file mode 100644 index 00000000..6743d49b --- /dev/null +++ b/vul/vul-springboot3-webflux/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("java") + id("org.springframework.boot") version "3.3.7" + id("io.spring.dependency-management") version "1.1.7" +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-webflux") +} diff --git a/vul/vul-springboot3/build.gradle b/vul/vul-springboot3/build.gradle deleted file mode 100644 index 64956a9c..00000000 --- a/vul/vul-springboot3/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -plugins { - id 'java' - id 'war' - id 'org.springframework.boot' version '3.3.7' - id 'io.spring.dependency-management' version '1.1.7' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' -} diff --git a/vul/vul-springboot3/build.gradle.kts b/vul/vul-springboot3/build.gradle.kts new file mode 100644 index 00000000..73f020b9 --- /dev/null +++ b/vul/vul-springboot3/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + id("java") + id("war") + id("org.springframework.boot") version "3.3.7" + id("io.spring.dependency-management") version "1.1.7" +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-web") + providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") +} diff --git a/vul/vul-webapp-deserialize/build.gradle b/vul/vul-webapp-deserialize/build.gradle deleted file mode 100644 index 1cbc63a2..00000000 --- a/vul/vul-webapp-deserialize/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -plugins { - id 'war' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -configurations { - cb110 - cb194 - cb183 - cb170 - cb161 - cc321 - cc40 -} - -dependencies { - cb110 'commons-beanutils:commons-beanutils:1.10.0' - cb194 'commons-beanutils:commons-beanutils:1.9.4' - cb183 'commons-beanutils:commons-beanutils:1.8.3' - cb170 'commons-beanutils:commons-beanutils:1.7.0' - cb161 'commons-beanutils:commons-beanutils:1.6.1' - cc321 'commons-collections:commons-collections:3.2.1' - cc40 'org.apache.commons:commons-collections4:4.0' - - implementation 'com.caucho:hessian:4.0.66' - providedCompile 'javax.servlet:javax.servlet-api:3.1.0' -} - -war { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - - doFirst { - delete "src/main/webapp/WEB-INF/dep" - - copy { from configurations.cb110 into "src/main/webapp/WEB-INF/dep" } - copy { from configurations.cb194 into "src/main/webapp/WEB-INF/dep" } - copy { from configurations.cb183 into "src/main/webapp/WEB-INF/dep" } - copy { from configurations.cb170 into "src/main/webapp/WEB-INF/dep" } - copy { from configurations.cb161 into "src/main/webapp/WEB-INF/dep" } - copy { from configurations.cc321 into "src/main/webapp/WEB-INF/dep" } - copy { from configurations.cc40 into "src/main/webapp/WEB-INF/dep" } - } -} - -clean { - delete "src/main/webapp/WEB-INF/dep" -} - -test { - useJUnitPlatform() -} diff --git a/vul/vul-webapp-deserialize/build.gradle.kts b/vul/vul-webapp-deserialize/build.gradle.kts new file mode 100644 index 00000000..e7b55d9b --- /dev/null +++ b/vul/vul-webapp-deserialize/build.gradle.kts @@ -0,0 +1,62 @@ +plugins { + id("war") +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +configurations { + create("cb110") + create("cb194") + create("cb183") + create("cb170") + create("cb161") + create("cc321") + create("cc40") +} + +dependencies { + "cb110"("commons-beanutils:commons-beanutils:1.10.0") + "cb194"("commons-beanutils:commons-beanutils:1.9.4") + "cb183"("commons-beanutils:commons-beanutils:1.8.3") + "cb170"("commons-beanutils:commons-beanutils:1.7.0") + "cb161"("commons-beanutils:commons-beanutils:1.6.1") + "cc321"("commons-collections:commons-collections:3.2.1") + "cc40"("org.apache.commons:commons-collections4:4.0") + + implementation("com.caucho:hessian:4.0.66") + providedCompile("javax.servlet:javax.servlet-api:3.1.0") +} + +tasks.war { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + + doFirst { + delete("src/main/webapp/WEB-INF/dep") + copy { + from( + configurations["cb110"], + configurations["cb194"], + configurations["cb183"], + configurations["cb170"], + configurations["cb161"], + configurations["cc321"], + configurations["cc40"] + ) + into("src/main/webapp/WEB-INF/dep") + } + } +} + +tasks.clean { + delete("src/main/webapp/WEB-INF/dep") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/vul/vul-webapp-expression/build.gradle b/vul/vul-webapp-expression/build.gradle deleted file mode 100644 index 9740db88..00000000 --- a/vul/vul-webapp-expression/build.gradle +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id 'war' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencies { - implementation 'commons-fileupload:commons-fileupload:1.3.3' - implementation 'commons-beanutils:commons-beanutils:1.9.3' - implementation 'de.odysseus.juel:juel-impl:2.2.7' - implementation 'org.freemarker:freemarker:2.3.23' - implementation 'commons-io:commons-io:2.19.0' - implementation 'org.apache.velocity:velocity:1.7' - implementation 'ognl:ognl:2.7.3' - implementation 'org.mvel:mvel2:2.4.7.Final' - implementation 'org.beanshell:bsh:2.0b5' - implementation 'org.apache.commons:commons-jexl:2.1.1' - implementation 'org.apache.commons:commons-jexl3:3.2.1' - implementation 'commons-jxpath:commons-jxpath:1.3' - implementation 'com.googlecode.aviator:aviator:5.2.7' - implementation 'org.codehaus.groovy:groovy:3.0.6' - implementation 'org.mozilla:rhino:1.7.14' - implementation 'com.hubspot.jinjava:jinjava:2.4.5' - implementation 'org.springframework:spring-expression:4.3.0.RELEASE' - providedCompile 'de.odysseus.juel:juel-api:2.2.7' - providedCompile 'javax.servlet:javax.servlet-api:3.1.0' - - testImplementation platform('org.junit:junit-bom:5.11.4') - testImplementation 'org.junit.jupiter:junit-jupiter' -} - -test { - useJUnitPlatform() -} diff --git a/vul/vul-webapp-expression/build.gradle.kts b/vul/vul-webapp-expression/build.gradle.kts new file mode 100644 index 00000000..c3b3eaa0 --- /dev/null +++ b/vul/vul-webapp-expression/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + id("war") +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation("commons-fileupload:commons-fileupload:1.3.3") + implementation("commons-beanutils:commons-beanutils:1.9.3") + implementation("de.odysseus.juel:juel-impl:2.2.7") + implementation("org.freemarker:freemarker:2.3.23") + implementation("commons-io:commons-io:2.19.0") + implementation("org.apache.velocity:velocity:1.7") + implementation("ognl:ognl:2.7.3") + implementation("org.mvel:mvel2:2.4.7.Final") + implementation("org.beanshell:bsh:2.0b5") + implementation("org.apache.commons:commons-jexl:2.1.1") + implementation("org.apache.commons:commons-jexl3:3.2.1") + implementation("commons-jxpath:commons-jxpath:1.3") + implementation("com.googlecode.aviator:aviator:5.2.7") + implementation("org.codehaus.groovy:groovy:3.0.6") + implementation("org.mozilla:rhino:1.7.14") + implementation("com.hubspot.jinjava:jinjava:2.4.5") + implementation("org.springframework:spring-expression:4.3.0.RELEASE") + providedCompile("de.odysseus.juel:juel-api:2.2.7") + providedCompile("javax.servlet:javax.servlet-api:3.1.0") + testImplementation(platform("org.junit:junit-bom:5.11.4")) + testImplementation("org.junit.jupiter:junit-jupiter") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/vul/vul-webapp-jakarta/build.gradle b/vul/vul-webapp-jakarta/build.gradle.kts similarity index 50% rename from vul/vul-webapp-jakarta/build.gradle rename to vul/vul-webapp-jakarta/build.gradle.kts index ccb852e1..0d7995fe 100644 --- a/vul/vul-webapp-jakarta/build.gradle +++ b/vul/vul-webapp-jakarta/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id 'war' + id("war") } java { @@ -11,7 +11,7 @@ java { } dependencies { - implementation 'commons-fileupload:commons-fileupload:1.5' - implementation 'commons-beanutils:commons-beanutils:1.9.3' - providedCompile 'jakarta.servlet:jakarta.servlet-api:5.0.0' + implementation("commons-fileupload:commons-fileupload:1.5") + implementation("commons-beanutils:commons-beanutils:1.9.3") + providedCompile("jakarta.servlet:jakarta.servlet-api:5.0.0") } \ No newline at end of file diff --git a/vul/vul-webapp/build.gradle b/vul/vul-webapp/build.gradle.kts similarity index 52% rename from vul/vul-webapp/build.gradle rename to vul/vul-webapp/build.gradle.kts index 613e2e74..5049585c 100644 --- a/vul/vul-webapp/build.gradle +++ b/vul/vul-webapp/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id 'war' + id("war") } java { @@ -11,7 +11,7 @@ java { } dependencies { - implementation 'commons-fileupload:commons-fileupload:1.3.3' - implementation 'commons-beanutils:commons-beanutils:1.9.2' - providedCompile "javax.servlet:servlet-api:2.5" + implementation("commons-fileupload:commons-fileupload:1.3.3") + implementation("commons-beanutils:commons-beanutils:1.9.2") + providedCompile("javax.servlet:servlet-api:2.5") }