Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion docs/guides/add-ebean-postgres-database-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,18 @@ Database database(Configuration config) {
return Database.builder()
.name("db")
.dataSourceBuilder(dataSource)
.skipDataSourceCheck(true)
.build();
}
```

If the project has a dedicated config-wrapper class (a `@Component` that reads config
keys), accept it as a parameter instead of `Configuration`.

> **Note:** Injecting `Configuration` requires that `avaje-config` is properly wired
> into the DI context. If you encounter "No dependency provided for
> io.avaje.config.Configuration" errors, use `Config.get(...)` static access instead
> (as shown in Step 2).

---

## Step 4 (Optional) — Add a read-only datasource
Expand Down
17 changes: 13 additions & 4 deletions docs/guides/add-ebean-postgres-maven-pom.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ already exist:
```xml
<properties>
<!-- add this line; use latest stable from https://github.com/ebean-orm/ebean/releases -->
<ebean.version>17.2.0</ebean.version>
<ebean.version>17.5.0</ebean.version>
</properties>
```

Expand Down Expand Up @@ -141,8 +141,17 @@ for Postgres test instances:
<version>${ebean.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.8</version>
<scope>test</scope>
</dependency>
```

The `io.avaje:junit` bundle includes JUnit Jupiter (API + engine) and AssertJ,
avoiding the need to declare those dependencies separately.

---

## Step 4b — Add DI framework dependencies (if applicable)
Expand All @@ -156,12 +165,12 @@ annotation processor. Skip this step if the user chose Spring or no DI.
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject</artifactId>
<version>11.5</version>
<version>12.5</version>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject-test</artifactId>
<version>11.5</version>
<version>12.5</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -185,7 +194,7 @@ the final `<annotationProcessorPaths>` block should include both:
<path> <!-- generate avaje-inject DI code -->
<groupId>io.avaje</groupId>
<artifactId>avaje-inject-generator</artifactId>
<version>11.5</version>
<version>12.5</version>
</path>
</annotationProcessorPaths>
```
Expand Down
10 changes: 10 additions & 0 deletions docs/guides/add-ebean-postgres-test-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,13 @@ mkdir -p ~/.ebean && touch ~/.ebean/ignore-docker-shutdown
```

On CI servers, omit this file so containers are cleaned up after each build.

---

## Next Steps

- **Add `TestEntityBuilder`** to your test configuration for rapid test data creation
with auto-populated random values. See `testing-with-testentitybuilder.md`.
- **Proceed to Step 3** — production database configuration
(`add-ebean-postgres-database-config.md`). Verify this step passes with
`mvn verify` before continuing.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void shutdown() {
*/
@Override
public @Nullable ProfileStream createProfileStream(@Nullable ProfileLocation location, @Nullable String label) {
if (!Span.current().getSpanContext().isValid()) {
if (!Span.current().isRecording()) {
// No active OTel trace context — don't create spans to avoid noise
return null;
}
Expand Down
Loading