Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slim down embedded dependencies #937

Merged
merged 6 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions server/bootstrap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ sourceSets {
}

dependencies
{
def tomcatVersion = project.apacheTomcatVersion

implementation "org.apache.tomcat:tomcat-api:${tomcatVersion}"
implementation "org.apache.tomcat:tomcat-catalina:${tomcatVersion}"
implementation "org.apache.tomcat:tomcat-juli:${tomcatVersion}"
implementation "org.apache.tomcat:tomcat-util:${tomcatVersion}"
{
implementation('org.apache.tomcat.embed:tomcat-embed-core') {
version {
strictly "${apacheTomcatVersion}"
}
}
}

def JAR_BASE_NAME = "labkeyBootstrap"
project.jar {
Expand Down Expand Up @@ -65,9 +64,6 @@ project.afterEvaluate {
publications('libs')
}
}

}
}
}


}
22 changes: 7 additions & 15 deletions server/embedded/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ configurations {
}

configurations.configureEach {
// exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j'
}

dependencies {
implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-validation:${springBootVersion}"
implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
exclude group: "org.springframework.boot", module: "spring-boot-starter-json" // Not used (?) and pulls in an old version of Jackson
exclude group: "jakarta.annotation", module: "jakarta.annotation-api" // Already present in tomcat-annotations-api
}

// Allows forcing a Spring Framework version that differs from spring-boot's version (e.g., to address CVEs)
implementation('org.springframework:spring-web') {
Expand All @@ -50,11 +50,6 @@ dependencies {

// Allows forcing a Tomcat version that differs from spring-boot's version (e.g., to address CVEs or regressions,
// or to test a Tomcat release candidate)
implementation('org.apache.tomcat.embed:tomcat-embed-core') {
version {
strictly "${apacheTomcatVersion}"
}
}
implementation('org.apache.tomcat.embed:tomcat-embed-el') {
version {
strictly "${apacheTomcatVersion}"
Expand All @@ -70,14 +65,11 @@ dependencies {
strictly "${apacheTomcatVersion}"
}
}
implementation('org.apache.tomcat:tomcat-jsp-api') {
version {
strictly "${apacheTomcatVersion}"
}
}

runtimeOnly "org.apache.tomcat.embed:tomcat-embed-jasper:${apacheTomcatVersion}"
runtimeOnly group: "org.apache.tomcat", name: "tomcat-dbcp", version: "${apacheTomcatVersion}"
runtimeOnly("org.apache.tomcat:tomcat-dbcp:${apacheTomcatVersion}") {
exclude group: "org.apache.tomcat", module: "tomcat-juli"
}
runtimeOnly "org.apache.logging.log4j:log4j-slf4j2-impl:${log4j2Version}"
implementation "commons-io:commons-io:${commonsIoVersion}"
implementation "org.apache.logging.log4j:log4j-core:${log4j2Version}"
Expand Down
2 changes: 0 additions & 2 deletions server/embedded/src/org/labkey/embedded/LabKeyServer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.labkey.embedded;

import jakarta.validation.constraints.NotNull;
import org.apache.catalina.connector.Connector;
import org.labkey.bootstrap.PipelineBootstrapConfig;
import org.springframework.boot.Banner;
Expand Down Expand Up @@ -405,7 +404,6 @@ public static class ContextProperties

private String webAppLocation;
private String workDirLocation;
@NotNull (message = "Must provide encryptionKey")
labkey-adam marked this conversation as resolved.
Show resolved Hide resolved
private String encryptionKey;
private String oldEncryptionKey;
private String legacyContextPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.labkey.embedded;

import org.jboss.logging.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.labkey.bootstrap.LabKeyBootstrapClassLoader;

import java.io.IOException;
Expand All @@ -19,7 +20,7 @@
*/
public class LabKeySpringBootClassLoader extends LabKeyBootstrapClassLoader
{
private static final Logger LOG = Logger.getLogger(LabKeySpringBootClassLoader.class);
private static final Logger LOG = LogManager.getLogger(LabKeySpringBootClassLoader.class);

public LabKeySpringBootClassLoader()
{
Expand Down