一 ,下載代碼
Release 2.2.2 (Apr 11, 2023) · alibaba/nacos · GitHub
二,?執(zhí)行打包
mvn -Prelease-nacos -Dmaven.test.skip=true -Drat.skip=true clean install -U
或
mvn -Prelease-nacos ‘-Dmaven.test.skip=true’ ‘-Drat.skip=true’ clean install -U
注意:請不要把源碼放在中文路徑下,會報各種意想不到的錯誤。
打包的結(jié)果在distribution中
三,添加驅(qū)動jar包
?1,根目錄下:/pom.xml
postgresql的?
<postgresql.version>42.3.3</postgresql.version>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
高斯的
<opengauss.version>3.0.0</opengauss.version>
<dependency>
<groupId>org.opengauss</groupId>
<artifactId>opengauss-jdbc</artifactId>
<version>${opengauss.version}</version>
</dependency>
2,config項目下的 /pom.xml
postgresql的
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
高斯的
<dependency>
<groupId>org.opengauss</groupId>
<artifactId>opengauss-jdbc</artifactId>
</dependency>
3,naming項目下的
?postgresql的
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
高斯的
<dependency>
<groupId>org.opengauss</groupId>
<artifactId>opengauss-jdbc</artifactId>
</dependency>
四,添加PostgreSQL驅(qū)動代碼
高斯的驅(qū)動代碼和PostgreSQL是一模一樣的
① PropertiesConstant.java
public static final String POSTGRESQL = "postgresql";
② PropertyUtil.java#loadSetting
String platform = DatasourcePlatformUtil.getDatasourcePlatform("");
/*boolean useExternalStorage = !PropertiesConstant.EMPTY_DATASOURCE_PLATFORM.equalsIgnoreCase(platform)
&& !PropertiesConstant.DERBY.equalsIgnoreCase(platform);
setUseExternalDB(useExternalStorage);*/
setUseExternalDB(PropertiesConstant.MYSQL.equalsIgnoreCase(platform) || PropertiesConstant.POSTGRESQL.equalsIgnoreCase(platform));
③ ExternalDataSourceProperties.java
private static final String JDBC_DRIVER_NAME_POSTGRESQL = "org.postgresql.Driver";
④ StartingApplicationListener.java
private static final String DATABASE_POSTGRESQL = "postgresql";
五, 配置文件文章來源:http://www.zghlxwxcb.cn/news/detail-743381.html
數(shù)據(jù)庫鏈接自己配置文章來源地址http://www.zghlxwxcb.cn/news/detail-743381.html
到了這里,關(guān)于Nacos-2.2.2源碼修改集成高斯數(shù)據(jù)庫GaussDB,postresql的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!