Boost Developer Productivity with Payara Server Maven Plugin + AI Agent

Community
Understanding the Security Issues of Aging Middleware

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 inspectquery 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. 

Memory & Threads, in Plain English 

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. 

Demo #2 – JDBC, JMX, and JMS Made Easy

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 developmenttesting 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. Watch the Replay of the webinar!

Smarter Jakarta EE Management - AI Powered Payara Server with Maven

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!

Payara Platform Community

Start Using Payara Server Maven Plugin with AI Agent

Streamline builds, automate repetitive tasks, and experiment with intelligent code assistance—all within your familiar Maven environment.

Download Payara Platform Community

Comments (0)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

Related Posts

How to Run and Scale AI Java Applications in Production: An Overview for Developers with no Machine Learning Expertise 9 minutes
Jakarta EE

How to Run and Scale AI Java Applications in Production: An Overview for Developers with no Machine Learning Expertise

Organizations are increasingly interested in adopting artificial intelligence (AI) and generative AI (GenAI) to improve operations and offer next-generation […]

Blue background with coral and fish. Left text: 'MONTHLY CATCH'. Right: laptop screen with tech tabs and Payara Community logo. 3 minutes
Community

The Payara Monthly Catch -September 2025

Welcome aboard the September issue of The Monthly Catch! With summer holidays wrapping up, the Java world is back […]

Blue background with coral and fish. Left text: 'MONTHLY CATCH'. Right: laptop screen with tech tabs and Payara Community logo. 4 minutes
Community

The Payara Monthly Catch – August 2025

Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]