Skip to content

Commit aaed130

Browse files
dlvenablesimonelbaz
authored andcommitted
Data Prepper developer documentation for debugging and using Maven artifacts. (opensearch-project#6427)
Signed-off-by: David Venable <dlv@amazon.com> Signed-off-by: Simon ELBAZ <elbazsimon9@gmail.com>
1 parent 9d51000 commit aaed130

3 files changed

Lines changed: 72 additions & 3 deletions

File tree

docs/debugging.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Debugging Data Prepper
2+
3+
This page serves as a guide to debugging Data Prepper.
4+
You can enable Java debugging by using `JAVA_OPTS`.
5+
6+
7+
## Docker
8+
9+
The following Docker compose snippet shows you how to set up debugging for Docker compose.
10+
11+
```yaml
12+
services:
13+
data-prepper:
14+
container_name: data-prepper
15+
image: opensearchproject/data-prepper:2
16+
ports:
17+
- "5005:5005"
18+
# other ports you need
19+
environment:
20+
- JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
21+
# More configuration
22+
```

docs/developer_guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,5 +256,6 @@ which includes a summary of the results.
256256
We have the following pages for specific development guidance on the topics:
257257

258258
* [Plugin Development](plugin_development.md)
259+
* [Debugging Data Prepper](debugging.md)
259260
* [Error Handling](error_handling.md)
260261
* [Logs](logs.md)

docs/plugin_development.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,62 @@ If your plugin requires no arguments, it can use a default constructor which wil
2929
Additionally, the plugin framework can create a plugin using a single parameter constructor with
3030
a single parameter of type `PluginSetting`. This behavior is deprecated and planned for removal.
3131

32-
## Deploying Maven Artifacts
32+
## Maven artifacts
3333

3434
If you are developing a plugin in another Gradle project your project will depend on at least the `data-prepper-api` project.
35-
You can deploy this artifact locally so that you can add it as a dependency in your other project.
35+
The Data Prepper maintainers publish Data Prepper libraries to Maven Central.
3636

37-
Run the following command:
37+
All Maven artifacts are published to the `org.opensearch.dataprepper` group id.
38+
39+
```
40+
org.opensearch.dataprepper:data-prepper-api:2.13.0
41+
```
42+
43+
As a plugin developer, you should also consider using `org.opensearch.dataprepper.test:plugin-test-framework` to test your plugin.
44+
45+
For example, to use in Gradle:
46+
47+
```groovy
48+
dependencies {
49+
implementation 'org.opensearch.dataprepper:data-prepper-api:2.13.0'
50+
testImplementation 'org.opensearch.dataprepper.test:plugin-test-framework:2.13.0'
51+
}
52+
```
53+
54+
Browse using Maven Central:
55+
56+
* https://repo1.maven.org/maven2/org/opensearch/dataprepper/
57+
58+
### Nightly snapshots
59+
60+
Data Prepper Maven artifacts release nightly snapshot builds.
61+
62+
The Maven repository is:
63+
* `https://central.sonatype.com/repository/maven-snapshots`
64+
65+
For example, to use in Gradle:
66+
67+
```groovy
68+
repositories {
69+
// Other repositories such as mavenCentral()
70+
maven {
71+
name = "Snapshots"
72+
url = "https://central.sonatype.com/repository/maven-snapshots"
73+
}
74+
}
75+
```
76+
77+
### Deploying Maven artifacts from local
78+
79+
You can deploy Data Prepper artifacts locally so that you can add add any local changes as a dependency in your plugin project.
80+
81+
From the Data Prepper repository, run the following command:
3882

3983
```
4084
./gradlew publishToMavenLocal
4185
```
4286

4387
The Maven artifacts will then be available in your local Maven repository. In standard environments
4488
they will be available at `${USER}/.m2/repository/org/opensearch/dataprepper/`.
89+
90+
Be sure to enable `mavenLocal()` as a repository in your plugin's build project.

0 commit comments

Comments
 (0)