Backend Development 3 min read

How to Compile Nacos with Oracle Support and Run It in Standalone Mode

Learn how to extend Nacos’s configuration persistence beyond Derby and MySQL by cloning the feature_multiple_datasource_support branch, compiling the source with Maven, configuring Oracle as a datasource in application.properties, and launching Nacos in standalone mode, with step‑by‑step commands and essential scripts.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
How to Compile Nacos with Oracle Support and Run It in Standalone Mode

Currently Nacos provides configuration persistence using Derby and MySQL. In scenarios where these databases cannot be used, you need to extend support for other databases manually. Nacos previously created a branch to adapt other databases, which can be obtained by compiling the source.

Getting Source Code and Building

Clone the branch that supports multiple data sources.

<code>git clone https://github.com/alibaba/nacos.git -b feature_multiple_datasource_support</code>

Build the executable.

<code>mvn -B clean package -Dmaven.test.skip=true -Prelease-nacos</code>

After compilation, the file nacos-server-1.4.2-SNAPSHOT.zip is generated in nacos/distribution/target .

Running Nacos

Obtain the database initialization scripts; after extracting, they can be found in the

conf

directory.

Edit

bin/application.properties

to add Oracle or other datasource information.

<code>## jpa
spring.data.jpa.repositories.enabled=true
spring.jpa.show-sql=true
## The datasource is used by oracle
spring.jpa.hibernate.naming.physical-strategy=com.alibaba.nacos.config.server.configuration.NacosPhysicalNamingStrategy
nacos.datasource.type=ORACLE
nacos.datasource.relational.dsList[0].url=jdbc:oracle:thin:@192.168.0.12:1521:XE
nacos.datasource.relational.dsList[0].username=oracle
nacos.datasource.relational.dsList[0].password=oracle
nacos.datasource.relational.dsList[0].driver-class-name=oracle.jdbc.driver.OracleDriver
</code>

Start Nacos.

<code>./startup.sh -m standalone</code>

Summary

The official

feature_multiple_datasource_support

branch is no longer maintained, meaning the multi‑datasource compatible Nacos version is 1.4.2.

Nacos 1.4.2 corresponds to Spring Cloud Alibaba 2021.1 and generally meets daily needs.

The

feature_multiple_datasource_support

branch is based on Spring Data JPA.

backendConfigurationmavenNacosOracleSpring Data JPA
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.