mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 07:27:12 -07:00
Updated for RIFE2 1.1.1.
Added RIFE2 agent and relevant instructions. Improved README.
This commit is contained in:
parent
1c93546fd7
commit
44637cc6fc
3 changed files with 42 additions and 10 deletions
28
README.md
28
README.md
|
@ -42,6 +42,10 @@ Go to:
|
||||||
The resulting archive will be in:
|
The resulting archive will be in:
|
||||||
`war/build/libs`
|
`war/build/libs`
|
||||||
|
|
||||||
|
If you use any of the byte-code instrumented features , like continuations,
|
||||||
|
metadata merging or lazy-loaded database entities, you'll need to launch your
|
||||||
|
servlet container with the `-javaagent:[path-to]/rife2-*-agent.jar` argument.
|
||||||
|
Exactly how is dependent on each servlet container.
|
||||||
|
|
||||||
## Making an UberJar
|
## Making an UberJar
|
||||||
|
|
||||||
|
@ -54,4 +58,26 @@ Then run it with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
java -jar app/build/libs/hello-uber-1.0.jar
|
java -jar app/build/libs/hello-uber-1.0.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you use any of the byte-code instrumented features, you'll need to also tell
|
||||||
|
`java` to use the RIFE2 agent.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
java -javaagent:[path-to]/rife2-*-agent.jar -jar app/build/libs/hello-uber-1.0.jar
|
||||||
|
```
|
||||||
|
|
||||||
|
## Get in touch
|
||||||
|
|
||||||
|
Thanks for using RIFE2!
|
||||||
|
|
||||||
|
If you have any questions, suggestions, ideas or just want to chat, feel free
|
||||||
|
to post on the [forums](https://github.com/gbevin/rife2/discussions), to join
|
||||||
|
me on [Discord](https://discord.gg/DZRYPtkb6J) or to connect with me on
|
||||||
|
[Mastodon](https://uwyn.net/@gbevin).
|
||||||
|
|
||||||
|
|
||||||
|
**Read more in the [full documentation](https://github.com/gbevin/rife2/wiki)
|
||||||
|
and [RIFE2 Javadocs](https://gbevin.github.io/rife2/).**
|
||||||
|
|
|
@ -2,8 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
// Apply the application plugin to add support for building a CLI application in Java.
|
java
|
||||||
application
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base {
|
base {
|
||||||
|
@ -28,7 +27,8 @@ sourceSets.main {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.uwyn.rife2:rife2:1.1.0")
|
implementation("com.uwyn.rife2:rife2:1.1.1")
|
||||||
|
runtimeOnly("com.uwyn.rife2:rife2:1.1.1:agent")
|
||||||
runtimeOnly("org.eclipse.jetty:jetty-server:11.0.13")
|
runtimeOnly("org.eclipse.jetty:jetty-server:11.0.13")
|
||||||
runtimeOnly("org.eclipse.jetty:jetty-servlet:11.0.13")
|
runtimeOnly("org.eclipse.jetty:jetty-servlet:11.0.13")
|
||||||
runtimeOnly("org.slf4j:slf4j-simple:2.0.5")
|
runtimeOnly("org.slf4j:slf4j-simple:2.0.5")
|
||||||
|
@ -37,11 +37,6 @@ dependencies {
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
|
||||||
// Define the main class for the application.
|
|
||||||
mainClass.set("hello.App")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
named<Test>("test") {
|
named<Test>("test") {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
|
@ -72,6 +67,16 @@ tasks {
|
||||||
dependsOn("precompileTemplates")
|
dependsOn("precompileTemplates")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace the run task with one that uses the RIFE2 agent
|
||||||
|
register<JavaExec>("run") {
|
||||||
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
|
mainClass.set("hello.App")
|
||||||
|
val rifeAgentJar = configurations.runtimeClasspath.get().files
|
||||||
|
.filter { it.toString().contains("rife2") }
|
||||||
|
.filter { it.toString().endsWith("-agent.jar") }[0]
|
||||||
|
jvmArgs = listOf("-javaagent:$rifeAgentJar")
|
||||||
|
}
|
||||||
|
|
||||||
// These two tasks create a self-container UberJar
|
// These two tasks create a self-container UberJar
|
||||||
register<Copy>("copyWebapp") {
|
register<Copy>("copyWebapp") {
|
||||||
from("src/main/")
|
from("src/main/")
|
||||||
|
@ -89,6 +94,7 @@ tasks {
|
||||||
}
|
}
|
||||||
val dependencies = configurations
|
val dependencies = configurations
|
||||||
.runtimeClasspath.get()
|
.runtimeClasspath.get()
|
||||||
|
.exclude("**/rife2*-agent.jar")
|
||||||
.map(::zipTree)
|
.map(::zipTree)
|
||||||
from(dependencies, "$buildDir/webapp")
|
from(dependencies, "$buildDir/webapp")
|
||||||
with(jar.get())
|
with(jar.get())
|
||||||
|
|
|
@ -19,5 +19,5 @@ dependencies {
|
||||||
tasks.war {
|
tasks.war {
|
||||||
webAppDirectory.set(file("../app/src/main/webapp"))
|
webAppDirectory.set(file("../app/src/main/webapp"))
|
||||||
webXml = file("src/web.xml")
|
webXml = file("src/web.xml")
|
||||||
rootSpec.exclude("**/jetty*.jar", "**/slf4j*.jar")
|
rootSpec.exclude("**/jetty*.jar", "**/slf4j*.jar", "**/rife2*-agent.jar")
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue