Boost Developer Productivity with Payara Server Maven Plugin + AI Agent
Published on 12 Sep 2025

Managing Payara Server Just Got Smarter
Imagine managing your Jakarta EE applications not just with Maven goals, but by asking natural questions.
With the experimental AI Agent built into the Payara Server Community's Maven Plugin, you can now query server internals and perform admin tasks using plain English — directly from the same terminal where you build and deploy your applications.
Thanks to this integration, developers can inspect, query and even execute server commands using natural language. It's a powerful and intuitive way to interact with Payara Server — no need to remember long command syntax or dig through documentation.
In this post, I’ll walk you through how it works, with real examples that show just how seamless the AI-powered CLI experience can be.
What Is the Payara Server Maven Plugin?
The Payara Server Maven Plugin simplifies server lifecycle management and app deployment via Maven goals like:
- start: Launch the server with configurable options.
- dev: A development-friendly mode enabling auto build, auto deploy, live reload browser, and session persistence.
Now, with the AI Agent, it goes a step further, bringing intelligence control directly to your terminal.
Meet the AI Agent (Experimental)
The AI Agent listens to natural language queries typed in your terminal. Instead of memorizing asadmin commands, you can now just ask:
"What is the current heap usage?
Show thread pool stats.
Create a JDBC connection pool
Ping a JDBC pool. "
It interprets your questions, queries internal APIs (JMX, domain.xml, logs, etc.), and responds intelligently. Perfect for speeding up diagnostics and reducing context switching.
Demo #1 – Memory & Threads, in Plain English
In the first clip below, I ran the mvn payara-server:dev goal and started typing natural queries into the CLI:
✅ What’s happening:
- Asked about current non-heap memory usage (both absolute and percentage)
- Queried heap memory
- Requested details on thread pools
- Asked how many threads are allocated
👉 See it in action:
No need to dig through JMX or logs manually. The AI Agent fetches and summarizes it instantly.
Demo #2 – JDBC, JMX, and JMS Made Easy
In the second demo, I explored resource management features:
✅ What’s happening:
- Asked the AI to create a JDBC connection for a PostgreSQL DB named alphadb using user alphauser
- Listed all existing JDBC connection pools
- Pinged a known pool (h2pool)
- Asked how to create a JMX resource
- Checked for existing JMS resources
👉 See it in action:
Instead of navigating the admin console or writing XML config, AI does the heavy lifting.
Configuring the AI Agent
To unlock the full capabilities of the Payara AI Agent, you can fine-tune its behavior using system properties or environment variables. Here's what you need to know:
Essential Configuration Variables
Environment Variable |
System Property |
Description |
PAYARA_AI_AGENT |
payara.ai.agent |
Enables the AI Agent (true or false). Default: true in dev mode. |
PAYARA_AI_API_KEY |
payara.ai.api.key |
Your API key for accessing the AI service provider (e.g., OpenAI). Required for most providers. |
PAYARA_AI_PROVIDER |
payara.ai.provider |
Defines the AI provider to use. See list below. |
PAYARA_AI_MODEL |
payara.ai.model |
Specifies the AI model (e.g., gpt-4o-mini, claude-3-opus, etc.). |
You can pass these as environment variables:
export PAYARA_AI_AGENT=true
export PAYARA_AI_API_KEY=sk-xxxxxx
export PAYARA_AI_PROVIDER=OPEN_AI
export PAYARA_AI_MODEL=gpt-4o-mini
Or via Maven:
mvn payara-server:dev \
-Dpayara.ai.agent=true \
-Dpayara.ai.api.key=sk-xxxxxx \
-Dpayara.ai.provider=OPEN_AI \
-Dpayara.ai.model=gpt-4o-mini
How to Enable the AI Agent
By default, the AI Agent is enabled in dev mode. Otherwise, enable it explicitly using:
-Dpayara.ai.agent=true
Or set the environment variable:
export PAYARA_AI_AGENT=true The AI Agent currently supports a variety of providers, so you can integrate with the one that best fits your setup:
OPEN_AI, CUSTOM_OPEN_AI, GOOGLE, DEEPINFRA,
DEEPSEEK, GROQ, MISTRAL, OLLAMA, ANTHROPIC,
LM_STUDIO, GPT4ALL
This gives you flexibility to run models locally (e.g., Ollama, LM Studio), via API (e.g., OpenAI, Google, Mistral), or even from custom endpoints.
Final Thoughts
The Payara Server Maven Plugin already simplified the Jakarta EE development lifecycle but with the AI Agent, it becomes an intelligent assistant. Whether you're inspecting memory, managing JDBC pools, or just experimenting, it drastically reduces friction and boosts productivity.
⚠️ As powerful as the AI Agent is, it’s still experimental and not recommended for production environments.
⚠️ Also, since it accesses sensitive runtime internals like JMX metrics, logs, configuration files and connection pool details, keep it restricted to local development, testing or isolated sandboxes.
Want to see this in action?
We’re hosting a free, 45-minute webinar where we’ll demo the AI Agent in the Payara Server Community Maven Plugin. You’ll discover how to query server metrics, manage JDBC and JMS resources, and run diagnostics in plain English — all from your terminal. This session is designed for the community: experimental, fun, and a glimpse into how AI can make Jakarta EE development more intuitive. Register here to join the webinar!
Ready to check out our latest AI tool? Get the latest version of Payara Server Community now and give the enhanced plugin a try in your next project!
Related Posts
The Payara Monthly Catch - August 2025
Published on 02 Sep 2025
by Dominika Tasarz
0 Comments
The Payara Monthly Catch - July 2025
Published on 31 Jul 2025
by Chiara Civardi
0 Comments