资源简介
SpringBoot +Maven +Druid 多数据源(Mysql+SqlServer)动态切换数据源
代码片段和文件信息
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License Version 2.0 (the
“License“); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing
software distributed under the License is distributed on an
“AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from if no ‘downloadUrl‘ is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
“https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar“;
/**
* Path to the maven-wrapper.properties file which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
“.mvn/wrapper/maven-wrapper.properties“;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
“.mvn/wrapper/maven-wrapper.jar“;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = “wrapperUrl“;
public static void main(String args[]) {
System.out.println(“- Downloader started“);
File baseDirectory = new File(args[0]);
System.out.println(“- Using base directory: “ + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL url);
} catch (IOException e) {
Syste
相关资源
- SSM食品管理系统food数据库
- Linux发布SSM项目详细文档
- ssm和PostgreSQL整合
- 简单SSM框架-用户登录
- SpringBoot整合SSM框架——最简单
- springboot+druid+jpa(hibernate)+mysql项目案
- SSM框架IDEA+Spring+SpringMVC+Maven+Mybatis
- spring-boot+mybatis+mysql+maven整合
- Maven+SSM+Shiro框架整合完整实现,实现
- SpringBoot2.0整合SSM框架,Vue.js项目
- Spirng+SpringMVC+Maven+Mybatis+MySQL
- MyBatis 通过第三方Druid数据连接池连接
- maven+springboot+jpa+shiro权限管理内有数据
- SSMA for Oracle 5.2
- SSMA for Oracle 5.2 带license
- 基于SSM框架在线考试系统设计文档
- Maven+springmvc+mybatis+easyui+mysql DEMO
- Spring MVC 整合Mybatis详解,SSM框架的配
- 基于ssm的小区物业管理系统
- 在线云盘项目SSM框架源代码+sql+答辩
- 基于SSM框架在线考试系统
- SQLServer2017,SSMS中文版,SQLServer2017密
- Spring+Mybatis+SpringMVC+Maven+MySql项目搭建
- SSMA for Oracle 6.0 带license
- 基于SSM实现人事管理系统
- 基于SSM+MySQL的进销存管理系统
- Shiro登陆验证,采用SSM
- 基于ssm框架的师生交流系统的设计与
- 黑马boot客户管理系统.zip
- maven+ssm用idea写的一个简单vip管理系统
评论
共有 条评论