@@ -70,12 +70,21 @@ dependencies {
7070 implementation(" org.eclipse.elk:org.eclipse.elk.alg.layered:0.9.1" )
7171 implementation(" org.eclipse.elk:org.eclipse.elk.alg.mrtree:0.9.1" )
7272
73- // Tests
73+ // Jetty pour le serveur embarqué des tests (EmbeddedJettyServer)
74+ testImplementation(" org.eclipse.jetty:jetty-server:$jettyVersion " )
75+ testImplementation(" org.eclipse.jetty:jetty-webapp:$jettyVersion " )
76+ testImplementation(" org.eclipse.jetty:jetty-servlet:$jettyVersion " )
77+ testImplementation(" org.eclipse.jetty:jetty-http:$jettyVersion " )
78+ testImplementation(" org.eclipse.jetty:jetty-io:$jettyVersion " )
79+ testImplementation(" org.eclipse.jetty:jetty-util:$jettyVersion " )
80+
81+ // Tests JUnit 5
7482 testImplementation(" org.junit.jupiter:junit-jupiter-api:$junitVersion " )
7583 testImplementation(" org.junit.jupiter:junit-jupiter-params:$junitVersion " )
7684 testRuntimeOnly(" org.junit.jupiter:junit-jupiter-engine:$junitVersion " )
7785 testImplementation(" org.junit.platform:junit-platform-suite-api:1.9.3" )
7886
87+ // Tests Selenium
7988 testImplementation(" org.seleniumhq.selenium:selenium-java:$seleniumVersion " )
8089 testImplementation(" io.github.bonigarcia:webdrivermanager:5.3.3" )
8190}
@@ -137,17 +146,19 @@ eclipse {
137146 }
138147}
139148
140- // Task to unpack WebJars for tests (Monaco Editor)
149+ // Task to unpack WebJars (Monaco Editor)
150+ // Extract to classes directory so it's available at runtime and in the WAR
141151val unpackWebJars by tasks.registering(Copy ::class ) {
142152 from({
143153 configurations.runtimeClasspath.get()
144154 .filter { it.name.contains(" monaco-editor" ) }
145155 .map { zipTree(it) }
146156 })
147157 include(" **/min/vs/loader.js" , " **/min/vs/**/*" , " **/min-maps/vs/**/*" )
148- into(layout.buildDirectory.dir(" resources /main" ))
158+ into(layout.buildDirectory.dir(" classes/java /main" ))
149159}
150160
161+ // Ensure WebJars are unpacked before processing resources
151162tasks.processResources {
152163 dependsOn(unpackWebJars)
153164}
@@ -156,6 +167,11 @@ tasks.processTestResources {
156167 dependsOn(unpackWebJars)
157168}
158169
170+ // Ensure WebJars are unpacked before creating the WAR
171+ tasks.war {
172+ dependsOn(unpackWebJars)
173+ }
174+
159175// Versions plugin configuration
160176tasks.named< com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask > (" dependencyUpdates" ) {
161177 rejectVersionIf {
@@ -167,13 +183,18 @@ tasks.named<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask>("
167183}
168184
169185// Clean minified resources before build
186+ // NOTE: Minified resources should be generated manually with Maven for now:
187+ // mvn -f pom.xml generate-resources
188+ // Uncomment the next lines if you want to regenerate them each time
189+ /*
170190val cleanMinifiedResources by tasks.registering(Delete::class) {
171191 delete(fileTree("src/main/webapp/min"))
172192}
173193
174194tasks.clean {
175195 dependsOn(cleanMinifiedResources)
176196}
197+ */
177198
178199// Task to optimize/minify web resources (CSS, JS)
179200val optimizeWebResources by tasks.registering {
@@ -195,11 +216,11 @@ val optimizeWebResources by tasks.registering {
195216}
196217
197218// Build process
198- tasks.processResources {
199- dependsOn(cleanMinifiedResources)
200- }
219+ // Note: Minified resources in src/main/webapp/min should be generated manually with Maven
201220
202- // Note: For CSS/JS minification, you'll need to integrate a tool like Webpack or use an appropriate Gradle plugin
221+ // Note: For CSS/JS minification, generate files manually with Maven:
222+ // mvn -f pom.xml generate-resources
223+ // Or integrate a frontend build tool like Webpack/Vite
203224
204225tasks.compileJava {
205226 options.encoding = " UTF-8"
0 commit comments