Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

Aspire.Hosting.Java

Official
📦 Aspire.Hosting.Javav13.6.0-preview.1.26478.8
15Functions
2Types

Types

Functions

methodaddJavaAppbuilder
Adds a Java application to the application model, launched with `java`.
addJavaApp(name: string, appDirectory: string): JavaAppResource
methodaddJavaAppWithJarbuilder
Adds a Java application that runs a prebuilt JAR with `java -jar`.
addJavaAppWithJar(name: string, appDirectory: string, jarPath: string, args: string[]): JavaAppResource
methodaddJavaContainerbuilder
Adds a Java application that runs from an existing container image.
addJavaContainer(name: string, image: string, tag?: string): JavaContainerResource
methodaddQuarkusAppbuilder
Adds a Quarkus application to the application model, built and launched with its own Maven or Gradle wrapper.
addQuarkusApp(name: string, appDirectory: string): JavaAppResource
methodaddSpringBootAppbuilder
Adds a Spring Boot application to the application model, built and launched with its own Maven or Gradle wrapper.
addSpringBootApp(name: string, appDirectory: string): JavaAppResource
methodwithGradleBuildbuilder
Runs a Gradle build before the Java application starts.
withGradleBuild(args: string[]): JavaAppResource
methodwithGradleTaskbuilder
Launches the Java application through a Gradle task instead of `java`, for example `bootRun`.
withGradleTask(task: string, args: string[]): JavaAppResource
methodwithJarArtifactbuilder
Selects the JAR the generated container image runs, for projects whose build produces more than one.
withJarArtifact(jarPath: string): JavaAppResource
methodwithJvmArgsbuilder
Adds arguments to the Java Virtual Machine that runs the application.
withJvmArgs(args: string[]): IJavaAppResource
methodwithMainClassbuilder
Sets the main class an IDE launches when running or debugging this application. Has no effect on how Aspire starts the process, which is decided by the JAR path, Maven goal, or Gradle task.
withMainClass(mainClass: string): JavaAppResource
methodwithMavenBuildbuilder
Runs a Maven build before the Java application starts.
withMavenBuild(args: string[]): JavaAppResource
methodwithMavenGoalbuilder
Launches the Java application through a Maven goal instead of `java`, for example `spring-boot:run`.
withMavenGoal(goal: string, args: string[]): JavaAppResource
methodwithOtelAgentbuilder
Runs the application with the OpenTelemetry Java agent so it exports traces, metrics, and logs to Aspire.
withOtelAgent(agentPath: string): JavaAppResource
methodwithOtelAgentDefaultPathbuilder
Runs the application with the OpenTelemetry Java agent from the location the build tool writes it to.
withOtelAgentDefaultPath(): JavaAppResource
methodwithWrapperPathbuilder
Overrides the build tool wrapper script path, for repositories whose wrapper is not in the default location or does not use the default name.
withWrapperPath(wrapperPath: string): JavaAppResource