Skip to content

Update Java integration docs for 13.3#1019

Open
marshalhayes wants to merge 1 commit into
microsoft:mainfrom
marshalhayes:feat/java-docs-13.3
Open

Update Java integration docs for 13.3#1019
marshalhayes wants to merge 1 commit into
microsoft:mainfrom
marshalhayes:feat/java-docs-13.3

Conversation

@marshalhayes
Copy link
Copy Markdown

Updates the Java integration docs to reflect the current Community Toolkit Java integration APIs introduced in Aspire 13.3, replacing the deprecated AddSpringApp/JavaAppResourceOptions patterns.

Changes

  • Replace deprecated AddSpringApp with AddJavaApp, WithMavenGoal, WithGradleTask, etc.
  • Add full C# and TypeScript AppHost parity throughout
  • Add sections for: build before run, run a container image, pass environment variables, health checks, configure JVM arguments, and configure OpenTelemetry
  • Use JdbcConnectionString / UserNameReference / PasswordParameter expressions for Spring Boot datasource configuration (PR #11938)
  • Apply code token highlighting throughout
  • Follow the same style and structure as the JavaScript and Python integration docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@marshalhayes marshalhayes requested a review from IEvangelist as a code owner May 20, 2026 03:40
Copilot AI review requested due to automatic review settings May 20, 2026 03:40
@marshalhayes
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-lang selector.
  • 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 vendored CommunityToolkit.Aspire.Hosting.Java metadata (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 later WithOtelAgent(...), but those members are not present in the repo’s current CommunityToolkit.Aspire.Hosting.Java API metadata (13.1.1, where container hosting is via AddJavaApp(..., 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.

Comment thread src/frontend/src/content/docs/integrations/frameworks/java.mdx

const builder = await createBuilder();

const javaApp = await builder.addJavaApp('spring-api', '../spring-app');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the polyglot support shipped with 13.3 last week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants