Skip to content

Commit

Permalink
Merge branch 'develop' into chore/programming-exercises/improve-perfo…
Browse files Browse the repository at this point in the history
…rmance
  • Loading branch information
SimonEntholzer authored Jan 2, 2025
2 parents e6bfc2b + b26821c commit 6ecf6c3
Show file tree
Hide file tree
Showing 67 changed files with 804 additions and 429 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 TUM Applied Education Technologies
Copyright (c) 2025 TUM Applied Education Technologies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"packageManager": "npm",
"cache": {
"enabled": true,
"path": ".cache",
"path": "./build/angular/",
"environment": "all"
},
"schematicCollections": [
Expand Down
34 changes: 15 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:${spotless_plugin_version}"
// This is required so that the latest version of the liquibase gradle plugin works
classpath "org.liquibase:liquibase-core:${liquibase_version}"
}
}

plugins {
id "checkstyle"
id "java"
id "maven-publish"
id "idea"
id "jacoco"
id "org.springframework.boot" version "${spring_boot_version}"
id "io.spring.dependency-management" version "1.1.7"
id "com.google.cloud.tools.jib" version "3.4.4"
id "com.github.node-gradle.node" version "${gradle_node_plugin_version}"
id "com.diffplug.spotless" version "6.25.0"
// this allows us to find outdated dependencies via ./gradlew dependencyUpdates
id "com.github.ben-manes.versions" version "0.51.0"
id "java"
id "com.adarshr.test-logger" version "4.0.0"
id "com.diffplug.spotless" version "${spotless_plugin_version}"
id "com.github.andygoossens.modernizer" version "${modernizer_plugin_version}"
id "com.github.ben-manes.versions" version "0.51.0"
id "com.github.node-gradle.node" version "${gradle_node_plugin_version}"
id "com.google.cloud.tools.jib" version "3.4.4"
id "com.gorylenko.gradle-git-properties" version "2.4.2"
id "io.spring.dependency-management" version "1.1.7"
id "org.liquibase.gradle" version "${liquibase_plugin_version}"
id "org.owasp.dependencycheck" version "11.1.1"
id "com.adarshr.test-logger" version "4.0.0"
id "org.springframework.boot" version "${spring_boot_version}"
}

group = "de.tum.cit.aet.artemis"
Expand Down Expand Up @@ -144,7 +145,7 @@ dependencies {
exclude module: "jaxb-api"
}

implementation "org.gitlab4j:gitlab4j-api:6.0.0-rc.7"
implementation "org.gitlab4j:gitlab4j-api:6.0.0-rc.8"

implementation "de.jplag:jplag:${jplag_version}"

Expand Down Expand Up @@ -326,7 +327,7 @@ dependencies {
implementation "org.bouncycastle:bcpkix-jdk18on:1.79"
implementation "org.bouncycastle:bcprov-jdk18on:1.79"

implementation "com.mysql:mysql-connector-j:9.1.0"
implementation "com.mysql:mysql-connector-j:${mysql_version}"
implementation "org.postgresql:postgresql:42.7.4"

implementation "org.zalando:problem-spring-web:0.29.1"
Expand Down Expand Up @@ -365,7 +366,7 @@ dependencies {
strictly byte_buddy_version
}
}
liquibase("net.bytebuddy:byte-buddy") {
liquibaseRuntime("net.bytebuddy:byte-buddy") {
version {
strictly byte_buddy_version
}
Expand All @@ -380,11 +381,6 @@ dependencies {
strictly byte_buddy_version
}
}
liquibase("net.bytebuddy:byte-buddy-agent") {
version {
strictly byte_buddy_version
}
}

annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernate_version}"
annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}"
Expand Down
3 changes: 2 additions & 1 deletion docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ http {

keepalive_timeout 65;

#gzip on;
gzip on;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;

# specific Artemis value from the Artemis ansible collection
server_names_hash_bucket_size 256;
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'Artemis'
copyright = '2024, Applied Education Technologies, Technical University of Munich'
copyright = '2025, Applied Education Technologies, Technical University of Munich'
author = 'Applied Education Technologies, Technical University of Munich'


Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ fasterxml_version=2.18.2
# TODO: 7.1.0 includes bugs related to git diffs, therefore we cannot update
jgit_version=7.0.0.202409031743-r
sshd_version=2.14.0
checkstyle_version=10.21.0
checkstyle_version=10.21.1
jplag_version=5.1.0
# not really used in Artemis, nor JPlag, nor the used version of Stanford CoreNLP, but we use the latest to avoid security vulnerability warnings
# NOTE: we cannot need to use the latest version 9.x or 10.x here as long as Stanford CoreNLP does not reference it
lucene_version=8.11.4
slf4j_version=2.0.16
sentry_version=7.19.0
sentry_version=7.19.1
liquibase_version=4.30.0
docker_java_version=3.4.1
logback_version=1.5.15
java_parser_version=3.26.2
byte_buddy_version=1.15.11
netty_version=4.1.115.Final
mysql_version=9.1.0

# testing
# make sure both versions are compatible
Expand All @@ -43,12 +44,12 @@ junit_platform_version=1.11.4
mockito_version=5.14.2
testcontainer_version=1.20.4


# gradle plugin version
gradle_node_plugin_version=7.1.0
apt_plugin_version=0.21
liquibase_plugin_version=2.2.2
liquibase_plugin_version=3.0.1
modernizer_plugin_version=1.10.0
spotless_plugin_version=6.25.0

org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
Expand Down
43 changes: 25 additions & 18 deletions gradle/liquibase.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
import org.gradle.internal.os.OperatingSystem

configurations {
liquibase
liquibaseRuntime.extendsFrom sourceSets.main.compileClasspath
}

dependencies {
liquibase "org.liquibase.ext:liquibase-hibernate6:${liquibase_version}"
implementation "org.liquibase:liquibase-core:${liquibase_version}"
liquibaseRuntime "org.liquibase:liquibase-core:${liquibase_version}"
// Dependency required to parse options. Refer to https://github.com/liquibase/liquibase-gradle-plugin/tree/Release_2.2.0#news.
liquibaseRuntime "info.picocli:picocli:4.7.6"

liquibaseRuntime "org.liquibase.ext:liquibase-hibernate6:${liquibase_version}"
liquibaseRuntime "com.mysql:mysql-connector-j:${mysql_version}"
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate6:${liquibase_version}"
}

ext.isWindows = OperatingSystem.current().isWindows()

if (isWindows) {
tasks.register('pathingLiquibaseJar', Jar) {
tasks.register("pathingLiquibaseJar", Jar) {
dependsOn configurations.liquibase
archiveAppendix = 'pathingLiquibase'
archiveAppendix = "pathingLiquibase"

doFirst {
manifest {
attributes 'Class-Path': (sourceSets.main.runtimeClasspath + configurations.liquibase).collect {
it.toURI().toURL().toString().replaceFirst(/file:\/+/, '/')
}.join(' ')
attributes "Class-Path": (sourceSets.main.runtimeClasspath + configurations.liquibase).collect {
it.toURI().toURL().toString().replaceFirst(/file:\/+/, "/")
}.join(" ")
}
}
}
}

tasks.register('initPaths', {
tasks.register("initPaths", {
group = "liquibase"
dependsOn tasks.named('compileJava')
dependsOn tasks.named("compileJava")
if (isWindows) {
dependsOn tasks.named('pathingLiquibaseJar')
dependsOn tasks.named("pathingLiquibaseJar")
}
})

def liquibaseCommand(command) {
tasks.register("runLiquibaseCommand", JavaExec) {
if (isWindows) {
classpath tasks.named('pathingLiquibaseJar').get().outputs.files
classpath tasks.named("pathingLiquibaseJar").get().outputs.files
} else {
classpath sourceSets.main.runtimeClasspath
classpath configurations.liquibase
Expand All @@ -57,29 +64,29 @@ def liquibaseCommand(command) {
}.get().exec()
}

tasks.register('liquibaseDiffChangeLog', {
dependsOn tasks.named('initPaths')
tasks.register("liquibaseDiffChangeLog", {
dependsOn tasks.named("initPaths")
doLast {
liquibaseCommand("diffChangeLog")
}
})

tasks.register('liquibaseClearChecksums', {
dependsOn tasks.named('initPaths')
tasks.register("liquibaseClearChecksums", {
dependsOn tasks.named("initPaths")
doLast {
liquibaseCommand("clearChecksums")
}
})

tasks.register('liquibaseGenerateChangelog', {
dependsOn tasks.named('initPaths')
tasks.register("liquibaseGenerateChangelog", {
dependsOn tasks.named("initPaths")
doLast {
liquibaseCommand("generateChangeLog")
}
})

static def buildTimestamp() {
def date = new Date()
def formattedDate = date.format('yyyyMMddHHmmss')
def formattedDate = date.format("yyyyMMddHHmmss")
return formattedDate
}
24 changes: 12 additions & 12 deletions gradle/profile_dev.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ dependencies {
}
*/

def profiles = 'dev'
if (project.hasProperty('no-liquibase')) {
profiles += ',no-liquibase'
def profiles = "dev"
if (project.hasProperty("no-liquibase")) {
profiles += ",no-liquibase"
}
if (project.hasProperty('tls')) {
profiles += ',tls'
if (project.hasProperty("tls")) {
profiles += ",tls"
}

springBoot {
Expand All @@ -36,16 +36,16 @@ bootJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

tasks.register('webapp', NpmTask) {
inputs.property('appVersion', project.version)
tasks.register("webapp", NpmTask) {
inputs.property("appVersion", project.version)
inputs.files("package-lock.json")
.withPropertyName('package-lock')
.withPropertyName("package-lock")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("build.gradle")
.withPropertyName('build.gradle')
.withPropertyName("build.gradle")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("angular.json")
.withPropertyName('angular.json')
.withPropertyName("angular.json")
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files("tsconfig.json", "tsconfig.app.json")
.withPropertyName("tsconfig")
Expand All @@ -63,8 +63,8 @@ tasks.register('webapp', NpmTask) {
}

processResources {
inputs.property('version', version)
inputs.property('springProfiles', profiles)
inputs.property("version", version)
inputs.property("springProfiles", profiles)
filesMatching("**/application.yml") {
filter {
it.replace("#project.version#", version)
Expand Down
20 changes: 10 additions & 10 deletions gradle/profile_prod.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def profiles = 'prod'
if (project.hasProperty('no-liquibase')) {
profiles += ',no-liquibase'
def profiles = "prod"
if (project.hasProperty("no-liquibase")) {
profiles += ",no-liquibase"
}

springBoot {
Expand All @@ -11,26 +11,26 @@ bootRun {
args = []
}

tasks.register('webapp_test', NpmTask) {
tasks.register("webapp_test", NpmTask) {
dependsOn "npm_install"
args = ["run", "webapp:test"]
}

tasks.register('webapp', NpmTask) {
tasks.register("webapp", NpmTask) {
dependsOn "npm_install"
args = ["run", "webapp:prod"]
environment = [APP_VERSION: project.version]
}

processResources {
inputs.property('version', version)
inputs.property('springProfiles', profiles)
filesMatching('**/application.yml') {
inputs.property("version", version)
inputs.property("springProfiles", profiles)
filesMatching("**/application.yml") {
filter {
it.replace('#project.version#', version)
it.replace("#project.version#", version)
}
filter {
it.replace('#spring.profiles.active#', profiles)
it.replace("#spring.profiles.active#", profiles)
}
}
}
Expand Down
Loading

0 comments on commit 6ecf6c3

Please sign in to comment.