Skip to content
Docs Try Aspire
Docs Try

JavaAppHostingExtension

Class static net10.0
📦 CommunityToolkit.Aspire.Hosting.Java v13.4.0
Provides extension methods for adding Java applications to an Hosting.IDistributedApplicationBuilder.
namespace Aspire.Hosting;
public static class JavaAppHostingExtension
{
// ...
}
AddJavaApp(IDistributedApplicationBuilder, string, JavaAppContainerResourceOptions)extensionobsolete
IResourceBuilder<JavaAppContainerResource>
Adds a Java application to the application model. Executes the containerized Java app.
AddJavaApp(IDistributedApplicationBuilder, string, string, string, string[]?)extensionats export
IResourceBuilder<JavaAppExecutableResource>
Adds a Java application to the application model. Executes the executable Java app.
AddJavaApp(IDistributedApplicationBuilder, string, string)extensionats export
IResourceBuilder<JavaAppExecutableResource>
Adds a Java application to the application model. Executes the executable Java app.
AddJavaApp(IDistributedApplicationBuilder, string, string, JavaAppExecutableResourceOptions)extensionobsolete
IResourceBuilder<JavaAppExecutableResource>
Adds a Java application to the application model. Executes the executable Java app.
AddJavaContainerApp(IDistributedApplicationBuilder, string, string, string?)extensionats export
IResourceBuilder<JavaAppContainerResource>
Adds a Java application to the application model. Executes the containerized Java app.
AddSpringApp(IDistributedApplicationBuilder, string, JavaAppContainerResourceOptions)extensionobsolete
IResourceBuilder<JavaAppContainerResource>
Adds a Spring application to the application model. Executes the containerized Spring app.
AddSpringApp(IDistributedApplicationBuilder, string, string, JavaAppExecutableResourceOptions)extensionobsolete
IResourceBuilder<JavaAppExecutableResource>
Adds a Spring application to the application model. Executes the executable Spring app.
WithGradleBuild(IResourceBuilder<JavaAppExecutableResource>, string[])extensionats export
IResourceBuilder<JavaAppExecutableResource>
WithGradleTask(IResourceBuilder<JavaAppExecutableResource>, string, string[])extensionats export
IResourceBuilder<JavaAppExecutableResource>
WithJvmArgs(IResourceBuilder<T>, string[])extensionats export
IResourceBuilder<T>
Configures the Java Virtual Machine arguments for the Java application. The arguments are set via the JAVA_TOOL_OPTIONS environment variable, which is recognized by the JVM regardless of how the application is launched (e.g., java -jar, Maven wrapper, or Gradle wrapper).
WithMavenBuild(IResourceBuilder<JavaAppExecutableResource>, MavenOptions)extensionobsolete
IResourceBuilder<JavaAppExecutableResource>
Adds a Maven build step to the application model.
WithMavenBuild(IResourceBuilder<JavaAppExecutableResource>, string[])extensionats export
IResourceBuilder<JavaAppExecutableResource>
WithMavenGoal(IResourceBuilder<JavaAppExecutableResource>, string, string[])extensionats export
IResourceBuilder<JavaAppExecutableResource>
WithOtelAgent(IResourceBuilder<T>, string?)extensionats export
IResourceBuilder<T>
Configures the OpenTelemetry Java Agent for the Java application.
WithWrapperPath(IResourceBuilder<JavaAppExecutableResource>, string)extensionats export
IResourceBuilder<JavaAppExecutableResource>
Configures a custom build tool wrapper script path. This is useful when the wrapper script is not in the default location or has a non-standard name.
View all methods