此内容没有您所选择的语言版本。
Chapter 2. Configuring your applications
This section explains how to configure your applications to work with Eclipse Vert.x runtime. It also describes the procedure to use Agroal in your Eclipse Vert.x applications.
2.1. Configuring your application to use Eclipse Vert.x 复制链接链接已复制到粘贴板!
Reference the Eclipse Vert.x BOM (Bill of Materials) artifact in the pom.xml file at the root directory of your application.
Prerequisites
- A Maven-based application
Procedure
Open the
pom.xmlfile, add theio.vertx:vertx-dependenciesartifact to the<dependencyManagement>section, and specify the<type>pom</type>and<scope>import</scope>:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Include the following properties to track the version of Eclipse Vert.x and the Vert.x Maven Plugin you are using:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reference
vertx-maven-pluginas the plugin used to package your application:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Include
repositoriesandpluginRepositoriesto specify the repositories that contain the artifacts and plugins to build your application:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
- For more information about packaging your Eclipse Vert.x application, see the Vert.x Maven Plugin documentation.
Starting with Eclipse Vert.x release 3.5.1.redhat-003, Agroal replaced C3PO as the default JDBC connection pool. C3PO and Agroal use different property names. Upgrading to a newer release of Eclipse Vert.x might break the JDBC connection pool configuration of your Eclipse Vert.x applications. Update the property names in the configuration of your JDBC connection pool to avoid this issue.
To continue using C3P0 as the JDBC connection pool for your application, set the value of the provider_class property in your JDBC connection pool configuration to io.vertx.ext.jdbc.spi.impl.C3P0DataSourceProvider.
Procedure
- Update the following property names within your JDBC connection pool configuration to match the connection pool you use:
| C3P0 property name | Agroal property name |
|---|---|
| url | jdbcUrl |
| driver_class | driverClassName |
| user | principal |
| password | credential |
| castUUID | castUUID |
Additional information
Example JDBC connection pool configuration using C3P0:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example JDBC connection pool configuration using Agroal:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow