arconia dev
The arconia dev command runs your Spring Boot application in development mode. It delegates to your build tool’s (Maven/Gradle) development tasks and is designed to work seamlessly with the Arconia Framework.
Alias: arconia run
How It Works
When you run arconia dev, the Arconia Framework detects that the application is running in development mode and activates the dev Spring profile. This enables several key developer experience features:
-
Arconia Dev Services are automatically started. Any external services your application depends on (databases, message brokers, AI inference servers, etc.) are automatically provisioned as containers using Testcontainers. There is no boilerplate code to write: simply add a
testAndDevelopmentOnlydependency and the service is ready to use. -
Spring Boot auto-configuration detects the running containers and configures the connection details automatically (e.g.,
DataSource,ConnectionFactory). No manualapplication.propertieschanges needed. -
Spring Boot DevTools (if present on the classpath) enables live restart on code changes, and Arconia keeps the provisioned containers running across restarts so you don’t pay the startup cost of re-creating them on every change.
Usage
Basic usage:
arconia dev
Using the alias:
arconia run
Run from the test classpath (for Spring Boot’s native Testcontainers approach):
arconia dev --test
Pass extra parameters to the underlying build tool using --:
arconia dev -- --stacktrace
arconia dev -- -DmyProperty=value
Options
The following options are available:
| Option | Default | Description |
|---|---|---|
|
|
Run the application from the test classpath. Equivalent to |
|
|
Include verbose output. |
|
Display help information for the command. |
Build Tool Integration
The dev command automatically detects whether your project uses Maven or Gradle and runs the appropriate development task:
| Build Tool | Command |
|---|---|
Gradle |
|
Maven |
One of:
|
Use -- to pass parameters directly to the underlying build tool. The -- separator is required to distinguish Arconia CLI options from build tool parameters.
When the --test option is used, the command changes to bootTestRun for Gradle and spring-boot:test-run for Maven, running the application from the test classpath.
Workflow with Arconia Dev Services
Arconia Dev Services make it trivial to provision external services for local development. As an example, here is how to add a PostgreSQL database to a Spring Boot application using Gradle:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
runtimeOnly 'org.postgresql:postgresql'
// Arconia Dev Services: only active during development and testing
testAndDevelopmentOnly 'io.arconia:arconia-dev-services-postgresql'
// Optional: enables live restart and keeps containers alive across restarts
developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
dependencyManagement {
imports {
mavenBom 'io.arconia:arconia-bom:0.23.1'
}
}
Then simply run your application:
arconia dev
On startup, Arconia will automatically:
-
Detect the application is running in development mode and activate the
devprofile. -
Start a PostgreSQL container using Testcontainers.
-
Configure the
DataSourceto connect to it. Nospring.datasource.*properties needed. -
Keep the container running across code changes if Spring Boot DevTools is on the classpath.
| Arconia Dev Services are available for a wide range of services, including data stores (PostgreSQL, MongoDB, Redis, MySQL, and more), message brokers (Kafka, RabbitMQ, Pulsar), observability platforms (Grafana LGTM, OpenTelemetry Collector), and AI inference servers (Ollama). See the Arconia Dev Services documentation for the full list. |
If you’re using Spring AI with a vector database, Arconia can automatically use the appropriate container image. For example, when arconia-dev-services-postgresql is present alongside Spring AI PGVector, it automatically uses the pgvector/pgvector image.
|
The --test Flag
The --test flag runs the application from the test classpath. It’s equivalent to ./gradlew bootTestRun or ./mvnw spring-boot:test-run. This is the approach needed when relying on Spring Boot’s native Testcontainers development-time services, which live in the test classpath and require a separate TestApplication class and container configuration beans.
If you are using Arconia Dev Services, you do not need --test. Dev Services work from the main classpath and activate automatically when arconia dev is used, with no boilerplate code required.