Rev 37726 | Blame | Compare with Previous | Last modification | View Log | RSS feed
buildscript {ext {springBootVersion = '2.0.2.RELEASE'}repositories {mavenCentral()}dependencies {classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")}}apply plugin: 'java'apply plugin: 'eclipse'apply plugin: 'org.springframework.boot'apply plugin: 'io.spring.dependency-management'group = 'com.smartdukaan'version = '0.0.1-SNAPSHOT'sourceCompatibility = 1.8ext['log4j2.version'] = '2.16.0'repositories {maven { url "https://repo.maven.apache.org/maven2" }maven { url 'https://jitpack.io' }mavenLocal()}task run {Set environments = ["dev", "staging", "prod"]def environment = "dev"if (project.hasProperty("env")) {if (environments.contains(project.getProperty("env"))) {environment = project.getProperty("env");} else {logger.warn("Invalid Environment value, Choose any 'dev', 'staging', 'prod'");logger.info("Environment set to dev");}} else {logger.info("Environment set to dev");}ant.propertyfile(file: "src/main/resources/META-INF/env.property") {entry(key: "profile", value: environment)}// Sentry/GlitchTip reports ONLY from a deliberate staging/prod build, and is// labelled with that environment. A plain local build leaves the committed// enabled=false in place, so a developer's laptop cannot post to the live board.ant.propertyfile( file: "src/main/resources/sentry.properties"){entry( key: "enabled", value: (environment == "dev" ? "false" : "true"))entry( key: "environment", value: environment)}logger.info("Build is being built by " + environment)}tasks.build.doLast() {ant.propertyfile(file: "src/main/resources/META-INF/env.property") {entry(key: "profile", value: "dev")}ant.propertyfile( file: "src/main/resources/sentry.properties"){entry( key: "enabled", value: "false")entry( key: "environment", value: "dev")}}dependencies {compile('org.springframework.boot:spring-boot-starter') {exclude(module: 'logback-classic')exclude(module: 'spring-boot-starter-logging')}implementation group: 'org.springframework', name: 'spring-context-support', version: '4.3.6.RELEASE'compile group: 'org.apache.velocity', name: 'velocity', version: '1.7'compile project(':profitmandi-common')compile project(':profitmandi-dao')compile 'com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6'compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6:'compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6'compile group: 'org.jsoup', name: 'jsoup', version: '1.11.3'compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.41.0'implementation 'org.jsoup:jsoup:1.11.3'implementation 'org.apache.httpcomponents:httpclient:4.5.13'implementation 'org.bouncycastle:bcprov-jdk16:1.45'//dependency needed to resolve okhttp and further required for seleniumimplementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.0'// https://mvnrepository.com/artifact/opencv/opencvimplementation group: 'org.openpnp', name: 'opencv', version: '3.4.2-0'implementation('com.google.auth:google-auth-library-oauth2-http:1.17.0') {exclude group: 'org.apache.httpcomponents', module: 'httpclient'exclude group: 'com.google.guava', module: 'guava'}dependencies {implementation 'org.jsoup:jsoup:1.18.1'}implementation('org.springframework.boot:spring-boot-starter-actuator') {exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'}implementation('io.micrometer:micrometer-core') {exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'}implementation('io.micrometer:micrometer-registry-prometheus') {exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'}implementation 'org.springframework.boot:spring-boot-starter-log4j2'// Ships ERROR-level log events to GlitchTip (self-hosted, Sentry protocol).// Pinned to 7.x: 8.x drops Java 8. Verified class major version 52.implementation 'io.sentry:sentry-log4j2:7.22.6'implementation('org.springframework.boot:spring-boot-starter-web') {exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'}implementation 'org.aspectj:aspectjweaver'implementation ('org.springframework.boot:spring-boot-starter-security'){exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'}// Add HikariCP dependencyimplementation 'com.zaxxer:HikariCP:3.4.5' // Use the latest versionimplementation 'net.lingala.zip4j:zip4j:2.11.5'testCompile 'junit:junit:4.13.2'testCompile 'org.mockito:mockito-core:3.12.4'// Force byte-buddy: Spring Boot BOM downgrades to 1.7.11 which is incompatible with Mockito 3.12.testCompile 'net.bytebuddy:byte-buddy:1.11.13'testCompile 'net.bytebuddy:byte-buddy-agent:1.11.13'}/** Unpack selenium-remote-driver from the fat jar at startup.** Selenium reads its JS "atoms" as classpath RESOURCES on essentially every WebDriver* command -- W3CHttpCommandCodec.amendParameters -> executeAtom -> Resources.toString.* Inside a Spring Boot fat jar that is a NESTED-jar read served by* org.springframework.boot.loader.jar.ZipInflaterInputStream, and on this loader* (Spring Boot 2.0.2, 2018) that read is the failure surface behind three separate* inflater corruptions seen on prod -- "invalid stored block lengths", "invalid distance* too far back", "invalid code lengths set" -- on a jar whose outer AND nested archives* both pass `unzip -t`. Intact bytes plus three different inflater errors is a reader* fault, not a file fault.** requiresUnpack extracts the jar to a real file at launch, so the atom read becomes an* ordinary filesystem read and leaves the nested reader out of the hot path entirely.* This is the durable half of the 2026-09-21/22 activation outage (17,508 then 27,768* failures/day against a ~30-50 baseline); the other half is in* Oppo/RealmeImeiActivationService, which no longer spends the day's imei pool when the* whole chunk fails.** NOTE this is also why a restart is an unreliable cure: it was restarted at 13:16 on* 09-22 and still failed for three hours, then a 16:36 restart came up clean, on the* SAME jar. Do not treat "restart fixed it" as a diagnosis.*/bootJar {requiresUnpack '**/selenium-remote-driver*.jar'}defaultTasks 'run', 'build'