资源简介
springboot2.0+mybatis主从数据库双数据源,测试了事务,事务是单独分开的。回滚只回滚主库的事务。
代码片段和文件信息
/*
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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1226 2019-03-26 13:21 wfw-user\.classpath
文件 303 2019-03-26 05:21 wfw-user\.gitignore
文件 48337 2019-03-26 05:21 wfw-user\.mvn\wrapper\maven-wrapper.jar
文件 116 2019-03-26 05:21 wfw-user\.mvn\wrapper\maven-wrapper.properties
文件 4625 2019-03-26 05:21 wfw-user\.mvn\wrapper\MavenWrapperDownloader.java
文件 560 2019-03-26 13:21 wfw-user\.project
文件 214 2019-04-23 16:54 wfw-user\.settings\org.eclipse.core.resources.prefs
文件 243 2019-03-26 13:21 wfw-user\.settings\org.eclipse.jdt.core.prefs
文件 90 2019-03-26 13:21 wfw-user\.settings\org.eclipse.m2e.core.prefs
文件 355 2019-03-26 05:21 wfw-user\HELP.md
文件 9114 2019-03-26 05:21 wfw-user\mvnw
文件 5811 2019-03-26 05:21 wfw-user\mvnw.cmd
文件 3456 2019-04-23 18:36 wfw-user\pom.xm
文件 2079 2019-04-23 18:40 wfw-user\src\main\java\com\wfwuser\config\DataConfig1.java
文件 2054 2019-04-23 18:48 wfw-user\src\main\java\com\wfwuser\config\DataConfig2.java
文件 3095 2019-04-23 19:11 wfw-user\src\main\java\com\wfwuser\Main.java
文件 437 2019-04-24 12:07 wfw-user\src\main\java\com\wfwuser\mapper\test1\UserMapper.java
文件 433 2019-04-24 12:09 wfw-user\src\main\java\com\wfwuser\mapper\test2\TestMapper.java
文件 1256 2019-04-24 12:15 wfw-user\src\main\java\com\wfwuser\service\TestService.java
文件 306 2019-03-26 05:21 wfw-user\src\main\java\com\wfwuser\WfwUserApplication.java
文件 1321 2019-04-23 20:33 wfw-user\src\main\resources\application.properties
文件 1679 2019-04-23 20:34 wfw-user\src\main\resources\logback-spring.xm
文件 954 2019-04-23 20:25 wfw-user\src\main\resources\mapper\test1\UserMapper.xm
文件 954 2019-04-23 20:26 wfw-user\src\main\resources\mapper\test2\TestMapper.xm
文件 486 2019-04-24 11:22 wfw-user\src\test\java\com\wfwuser\WfwUserApplicationTests.java
文件 1321 2019-04-24 12:15 wfw-user\target\classes\application.properties
文件 2817 2019-04-23 18:42 wfw-user\target\classes\com\wfwuser\config\DataConfig1.class
文件 2752 2019-04-23 18:48 wfw-user\target\classes\com\wfwuser\config\DataConfig2.class
文件 2275 2019-04-23 19:11 wfw-user\target\classes\com\wfwuser\Main.class
文件 570 2019-04-24 12:07 wfw-user\target\classes\com\wfwuser\mapper\test1\UserMapper.class
............此处省略56个文件信息
评论
共有 条评论