Building Jakarta Messaging and JMS Projects with Maven
Apache Maven is a software management tool that can be used to build, install, and distribute Java-based projects. With Apache Maven, you can obtain, install, and deploy Solace Messaging API artifacts.
Jakarta Messaging is the evolution of the Java Message Service (JMS) specification under the Eclipse Foundation. Both the Solace Jakarta Messaging API (recommended for new development) and the Solace JMS API (fully supported for existing applications) are covered on this page. Artifact names and broker configurations retain "JMS" naming for backward compatibility.
Solace provides two Maven artifacts for Jakarta Messaging and JMS development:
- sol-jms-jakarta—Solace Jakarta Messaging API (modern, recommended for new development)
- sol-jms—Solace JMS API (legacy, for existing applications)
Both APIs require the following supporting artifacts:
- sol-jcsmp-10.x.x.jar—the Solace JCSMP API libraries
- solsuite-10.x.x.pom—Solace Messaging API project configuration file
- sol-common-10.x.x.jar—Solace Java API utilities
To use the Solace Jakarta Messaging API with Maven, you can:
- obtain Solace Jakarta Messaging API artifacts from Maven Central
- install Solace Jakarta Messaging API artifacts in a local corporate Maven repository
- deploy Solace Jakarta Messaging API artifacts to remote repositories
Obtaining Artifacts from Maven Central
Using the Solace Jakarta Messaging API
Recommended for new development with the jakarta.jms namespace. Declare the following dependency in your pom.xml file:
<dependency>
<groupId>com.solacesystems</groupId>
<artifactId>sol-jms-jakarta</artifactId>
<version>10.30.x</version>
</dependency>
Using the Solace JMS API
For existing applications using the javax.jms namespace. Declare the following dependency in your pom.xml file:
<dependency>
<groupId>com.solacesystems</groupId>
<artifactId>sol-jms</artifactId>
<version>10.30.x</version>
</dependency>
Using JMS 1.1 Compatibility Layer with the Solace JMS API
Some applications may need to continue to use the Geronimo 1.1 Spec if they have components that are dependent on version 1.1 of the JMS Specification. For versions 10.20 and later of the Solace JMS API, you need to use a compatibility layer to allow backwards compatibility with applications that have Geronimo JMS 1.1 dependencies (geronimo-jms_1.1_spec). You also need to exclude the Geronimo JMS 2.0 specifications to avoid conflicts. To achieve this, add the following to your pom.xml file:
<dependency>
<groupId>com.solacesystems</groupId>
<artifactId>sol-jms</artifactId>
<version>10.20.x</version>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
</exclusion>
</dependency>
<dependency>
<groupId>com.solacesystems</groupId>
<artifactId>sol-jms-compat-1.1</artifactId>
<version>1.0.0</version>
</dependency>
Installing Artifacts Locally
To use Solace Messaging API artifacts as Maven dependencies, you must install the jar files and pom.xml files into your local repository.
To install a jar or a pom.xml file locally, enter the following command in a terminal window:
mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile> -Dmaven.repo.local=<path-to-local-repository>
Example: Installing Solace Jakarta Messaging API
Recommended for new development. Installing the sol-jms-jakarta.jar file:
$ mvn install:install-file
-Dfile=/downloads/sol-jms-jakarta/lib/sol-jms-jakarta-10.x.x.jar
-DpomFile=/downloads/sol-jms-jakarta/lib/sol-jms-jakarta-10.x.x.pom
-Dmaven.repo.local=./.repository
Example: Installing Solace JMS API
For existing applications. Installing the sol-jms.jar file:
$ mvn install:install-file
-Dfile=/downloads/sol-jms/lib/sol-jms-10.x.x.jar
-DpomFile=/downloads/sol-jms/lib/sol-jms-10.x.x.pom
-Dmaven.repo.local=./.repository
Example of installing a pom.xml file (applies to both APIs):
$ mvn install:install-file -Dfile=/downloads/sol-jms/lib/solsuite-10.x.x.pom -DpomFile=/downloads/sol-jms/lib/solsuite-10.x.x.pom -Dmaven.repo.local=./.repository
Using JCA Resource Adapters
For Jakarta EE application server environments (such as WildFly 27+ or JBoss EAP 8+), use the Jakarta-based JCA Resource Adapter instead of the legacy javax.*-based adapter.
To include the Jakarta resource adapter in your Maven project, add the following dependency to your pom.xml file:
<dependency>
<groupId>com.solacesystems</groupId>
<artifactId>sol-jms-jakarta-ra</artifactId>
<version>10.30.0</version>
</dependency>
For detailed information about the Jakarta resource adapter, including supported application servers and configuration examples, see Solace JCA Resource Adapter for Jakarta Messaging Overview.
Choosing Between javax and Jakarta Resource Adapters
Select the appropriate resource adapter based on your application server:
| Use This Resource Adapter | For These Application Servers |
|---|---|
|
Solace JCA Resource Adapter for JMS ( |
Legacy Java EE servers:
|
|
Solace JCA Resource Adapter for Jakarta Messaging ( |
Modern Jakarta EE servers:
|
The two resource adapter variants provide equivalent functionality but are binary-incompatible due to namespace differences. Do not attempt to use the javax.*-based adapter on Jakarta EE servers or vice versa.
Deploying Artifacts to Remote Repositories
To use Solace Messaging API artifacts as Maven dependencies, you must deploy the jar and pom.xml files to a remote Maven repository for your project.
To deploy a jar or a pom.xml file to a Maven remote repository, enter the following command in a terminal window:
mvn deploy:deploy-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile> -DrepositoryId=release -Durl=<repository-url>
This process is the same for both the Solace Jakarta Messaging API (sol-jms-jakarta) and Solace JMS API (sol-jms) artifacts.