You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,18 @@ Unfortunately, this doesn't actually work because the implementation uses its ow
16
16
## The solution
17
17
The workaround is to unpack the jars used by the scripts.
18
18
19
+
## Motivation
20
+
Kotlin scripts in my application for evaluations etc. are a powerful option.
21
+
Scripts can be adapted at runtime.
22
+
But please note: scripts must be well secured because they may have full access to the application.
23
+
24
+
## State of the art (call for improvements)
25
+
I tried several approaches:
26
+
- passing my own classLoader (doesn't work)
27
+
- unpacking jars in the SpringBoot fatjar (does work), and
28
+
- automatically copying jars from the fatjar to the local file system (will follow).
29
+
I will show all approaches here and call for improvements.
30
+
19
31
## Gradle vs. Maven
20
32
I migrated my project (ProjectForge) from *Maven* to *Gradle*. In principle, unpacking fatjars with maven is also possible, but it is incredibly more complicated.
21
33
@@ -27,6 +39,11 @@ This project contains sample code including a gradle setup that implements a min
27
39
### Module: application
28
40
The Spring Boot application with gradle configuration to unpack the jars.
29
41
42
+
The current solution:
43
+
44
+
- Variables can be passed. This is useful, for example, if users are required in ThreadLocal for the user authentication of application functions used.
45
+
- The script is automatically stopped after a defined runtime. This avoids endless scripts or unwanted long-running scripts.
46
+
30
47
### Module: business
31
48
A simple module with a class that is used by the Kotlin script.
0 commit comments