import Ġorg . gradle . plugins . ide . idea . model . Ide a Model Ċ import Ġorg . springframework . boot . gradle . tasks . bund ling . Boot Jar Ċ import Ġjava . nio . file . Files Ċ import Ġjava . nio . file . Paths Ċ Ċ @ Suppress (" UN CHECK ED _ CAST ") Ċ val Ġlibrary Versions Ġ= Ġroot Project . extra . get (" library Versions ") Ġas ĠMap < String , ĠString > Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġapplication ĊĠĠĠ Ġid (" org . springframework . boot ") ĊĠĠĠ Ġid (" com . github . g ma zz o . build config ") Ġversion Ġ" 2 . 0 . 2 " ĊĊĠĠĠ Ġkotlin (" jvm ") ĊĠĠĠ Ġkotlin (" plugin . spring ") Ċ } Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġapi ( project (": ids - api ")) ĊĠĠĠ Ġ// Ġapi ( project (": ids - acme ")) ĊĠĠĠ Ġapi ( project (": ids - web console ")) ĊĠĠĠ Ġapi ( project (": ids - settings ")) ĊĠĠĠ Ġapi ( project (": ids - container - manager ")) ĊĠĠĠ Ġapi ( project (": ids - route - manager ")) ĊĠĠĠ Ġapi ( project (": ids - inf om odel - manager ")) ĊĠĠĠ Ġapi ( project (": ids - data flow - control ")) ĊĠĠĠ Ġapi ( project (": camel - multipart - processor ")) ĊĊĠĠĠ Ġ// ĠSpring ĠBoot ĊĠĠĠ Ġimplementation (" org . springframework . boot : spring - boot - starter ") ĊĠĠĠ Ġimplementation (" org . springframework . boot : spring - boot - starter - web ") ĊĠĠĠ Ġimplementation (" org . springframework . boot : spring - boot - starter - j ersey ") ĊĠĠĠ Ġimplementation (" org . springframework . boot : spring - boot - starter - jetty ") ĊĠĠĠ Ġ// ĠCamel ĠSpring ĠBoot Ġintegration ĊĠĠĠ Ġimplementation (" org . apache . camel . spring boot : camel - spring - boot - starter ") ĊĠĠĠ Ġimplementation (" org . apache . camel . spring boot : camel - rest - starter ") ĊĠĠĠ Ġimplementation (" org . apache . camel . spring boot : camel - http - starter ") ĊĠĠĠ Ġimplementation (" de . fh g . aise c . ids ", Ġ" camel - id scp 2 ", Ġlibrary Versions [" id scp 2 "]) Ċ } Ċ Ċ // ĠClear s Ġlibrary ĠJ AR s Ġbefore Ġcopying Ċ val Ġclean Lib s Ġ= Ġtasks . create < Delete >(" delete Lib s ") Ġ{ ĊĠĠĠ Ġdelete ("$ build Dir / libs / library J ars ", Ġ"$ build Dir / libs / project J ars ") Ċ } Ċ // ĠCop ies Ġall Ġruntime Ġlibrary ĠJ AR s Ġto Ġbuild / libs / lib Ċ val Ġroot Project Dir : ĠString Ġ= Ġroot Project . project Dir . absolute Path Ċ val Ġcopy Library J ars Ġ= Ġtasks . create < Copy >(" copy Library J ars ") Ġ{ ĊĠĠĠ Ġfrom ( ĊĠĠĠĠĠĠĠ Ġconfigurations . runtime Classpath . get (). filter Not Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . absolute Path . startsWith ( root Project Dir ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) ĊĠĠĠ Ġdestination Dir Ġ= Ġfile ("$ build Dir / libs / library J ars ") ĊĠĠĠ Ġdepends On ( clean Lib s ) Ċ } Ċ val Ġcopy Project J ars Ġ= Ġtasks . create < Copy >(" copy Project J ars ") Ġ{ ĊĠĠĠ Ġfrom ( ĊĠĠĠĠĠĠĠ Ġconfigurations . runtime Classpath . get (). filter Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . absolute Path . startsWith ( root Project Dir ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) ĊĠĠĠ Ġdestination Dir Ġ= Ġfile ("$ build Dir / libs / project J ars ") ĊĠĠĠ Ġdepends On ( clean Lib s ) Ċ } Ċ Ċ tasks . with Type < Jar > Ġ{ ĊĠĠĠ Ġenabled Ġ= Ġtrue ĊĠĠĠ Ġdepends On ( copy Library J ars ) ĊĠĠĠ Ġdepends On ( copy Project J ars ) ĊĠĠĠ Ġ// ĠCopy Ġthe Ġresulting ĠJ AR Ġto Ġinternal Ġlibraries ĊĠĠĠ Ġdo Last Ġ{ ĊĠĠĠĠĠĠĠ ĠFiles . copy ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPaths . get ( archive File . get (). toString ()), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPaths . get ("$ build Dir / libs / project J ars /${ archive FileName . get () }") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ // ĠDisable Ġboot Jar , Ġas Ġthe ĠJ AR Ġpackaging Ġof ĠSpring ĠBoot Ġprevents Ġdynamic ĠSpring ĠXML Ġparsing Ġdue Ġto Ġclasspath Ġissues ! Ċ tasks . with Type < Boot Jar > Ġ{ ĊĠĠĠ Ġenabled Ġ= Ġfalse Ċ } Ċ Ċ apply ( plugin Ġ= Ġ" idea ") Ċ Ċ build Config Ġ{ ĊĠĠĠ Ġsource Sets . get ByName (" main ") Ġ{ ĊĠĠĠĠĠĠĠ ĠpackageName (" de . fh g . aise c . ids ") ĊĠĠĠĠĠĠĠ Ġbuild Config Field ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" String ", Ġ" INFO MODEL _ VERSION ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"\" ${ library Versions [" inf om odel "] Ġ?: Ġerror (" Inf om odel Ġversion Ġnot Ġavailable ") }\ "" ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ configure < Ide a Model > Ġ{ ĊĠĠĠ Ġmodule Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġmark Ġas Ġgenerated Ġsources Ġfor ĠIDEA ĊĠĠĠĠĠĠĠ Ġgenerated Source Dirs . add ( File ("$ build Dir / generated / source / build Config / main / main ")) ĊĠĠĠ Ġ} Ċ } Ċ