Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddJavaAppWithJar

Method
📦 Aspire.Hosting.Java v17.0.0-preview.1.26565.2
func (DistributedApplicationBuilder) AddJavaAppWithJar(
name string,
appDirectory string,
jarPath string,
args []string,
) JavaAppResource

Signature

methodAddJavaAppWithJarbuilder
Adds a Java application that runs a prebuilt JAR with java -jar.
AddJavaAppWithJar(
name string,
appDirectory string,
jarPath string,
args []string,
) JavaAppResource
namestringThe name of the resource.
appDirectorystringThe application directory. Relative paths are resolved against the AppHost directory.
jarPathstringThe path to the JAR file to execute. Relative paths are resolved against appDirectory.
args[]stringArguments passed to the Java application after the JAR path.
JavaAppResource

A reference to the IResourceBuilder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types:

typeDistributedApplicationBuilder