Update Java integration docs for 13.3#1019
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
Updates the Java integration documentation to reflect newer Aspire Community Toolkit Java hosting patterns and adds C#/TypeScript AppHost parity, aligning the page structure with other language integration docs.
Changes:
- Replaces deprecated Spring-specific APIs with newer Java app/container APIs and adds Maven/Gradle/JAR guidance.
- Adds C# + TypeScript tabbed samples throughout using the synced
aspire-langselector. - Expands coverage with sections for building before run, env var injection (including JDBC expressions), health checks, JVM args, and OpenTelemetry agent setup.
Comments suppressed due to low confidence (2)
src/frontend/src/content/docs/integrations/frameworks/java.mdx:73
- The Gradle examples reference
WithGradleTask(...)/WithGradleBuild(...), but these APIs don’t exist in the currently vendoredCommunityToolkit.Aspire.Hosting.Javametadata (13.1.1). Either vendor the newer package metadata that adds Gradle support, or rewrite this section against the available API surface to avoid publishing non-compilable examples.
### Run with Gradle
<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="C# — AppHost.cs" "WithGradleTask"
var builder = DistributedApplication.CreateBuilder(args);
var javaApp = builder.AddJavaApp("spring-api", "../spring-app")
.WithGradleTask("bootRun")
.WithHttpEndpoint(env: "SERVER_PORT");
src/frontend/src/content/docs/integrations/frameworks/java.mdx:226
- This section introduces
AddJavaContainerApp(...)and laterWithOtelAgent(...), but those members are not present in the repo’s currentCommunityToolkit.Aspire.Hosting.JavaAPI metadata (13.1.1, where container hosting is viaAddJavaApp(..., JavaAppContainerResourceOptions)and OTEL agent config is via options). Please align the docs with the vendored API version or update the vendored metadata to the intended 13.3 API so the doc tooling and readers aren’t pointed at missing members.
### Run a container image
<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="C# — AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
var javaApp = builder.AddJavaContainerApp(
name: "java-api",
image: "docker.io/example/spring-api",
imageTag: "latest")
.WithHttpEndpoint(env: "SERVER_PORT");
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const builder = await createBuilder(); | ||
|
|
||
| const javaApp = await builder.addJavaApp('spring-api', '../spring-app'); |
There was a problem hiding this comment.
Did the support for TS in the Community Toolkit ship? I didn't think that happened yet. We'd need to remove the TS tabs as they're not yet supported.
There was a problem hiding this comment.
I thought the polyglot support shipped with 13.3 last week
Updates the Java integration docs to reflect the current Community Toolkit Java integration APIs introduced in Aspire 13.3, replacing the deprecated
AddSpringApp/JavaAppResourceOptionspatterns.Changes
AddSpringAppwithAddJavaApp,WithMavenGoal,WithGradleTask, etc.JdbcConnectionString/UserNameReference/PasswordParameterexpressions for Spring Boot datasource configuration (PR #11938)