# JavaAppResource.withMavenGoal

- Module: [Aspire.Hosting.Java](/reference/api/typescript/aspire.hosting.java.md)
- Defined on: [JavaAppResource](/reference/api/typescript/aspire.hosting.java/javaappresource.md)
- Version: `13.6.0-preview.1.26478.8`
- Kind: `method`

Launches the Java application through a Maven goal instead of `java`, for example `spring-boot:run`.

## Definition

```typescript
interface JavaAppResource {
  // ... omitted for brevity
  withMavenGoal(
      goal: string,
      args: string[]): JavaAppResource;
}
```

## Signature

```typescript
withMavenGoal(
    goal: string,
    args: string[]): JavaAppResource
```

## Parameters

- `goal` (`string`)
- `args` (`string[]`)

## Returns

[JavaAppResource](/reference/api/typescript/aspire.hosting.java/javaappresource.md) `builder`

## Defined on

- [JavaAppResource](/reference/api/typescript/aspire.hosting.java/javaappresource.md) -- `handle`
