Hello,
I am very new to Gradle and loving it so far.
Any guidance would be greatly appreciated.
Using Intellij, Open Liberty, Gradle
I am able to get struts2-core:2.5.33 working , but when I change the
Implementation to struts2-core:7.0.3, I received this error:
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter was found, but is missing another class
//My build.gradle:
apply plugin: 'war'
apply plugin: 'liberty'
sourceCompatibility = 21
targetCompatibility = 21
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// configure liberty-gradle-plugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.openliberty.tools:liberty-gradle-plugin:3.9.3'
}
}
repositories {
mavenCentral()
}
dependencies {
// provided dependencies
providedCompile 'jakarta.platform:jakarta.jakartaee-api:10.0.0'
providedCompile 'org.eclipse.microprofile:microprofile:7.0'
implementation("org.apache.struts:struts2-core:7.0.3")
implementation 'javax.servlet:javax.servlet-api:4.0.1'
implementation 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.3'
implementation 'org.slf4j:slf4j-api:2.0.12'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.23.1'
implementation("com.opensymphony:xwork:2.1.3")
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.1'
// test dependencies
testImplementation 'junit:junit:4.13.2'
testImplementation platform('org.junit:junit-bom:5.13.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.apache.httpcomponents.client5:httpclient5:5.5'
}
ext {
liberty.server.var.'http.port' = '9080'
liberty.server.var.'https.port' = '9443'
liberty.server.var.'app.context.root' = project.name
}
task openBrowser {
description = 'Open browser to the running application'
doLast {
String port = liberty.server.var.'http.port'
String context = liberty.server.var.'app.context.root'
String URL = "http://localhost:" + port + "/" + context + "/" + "servlet + \"/\" + index.action"
java.awt.Desktop.desktop.browse URL.toURI()
}
}
test {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut'
exceptionFormat 'full'
}
systemProperty 'http.port', liberty.server.var.'http.port'
systemProperty 'context.root', liberty.server.var.'app.context.root'
}
test.dependsOn 'libertyStart'
test.finalizedBy(openBrowser)
clean.dependsOn 'libertyStop'