资源简介
Spring Boot整合Spring Batch的一个小例子,在网上发现这方面的资源比较少,特此将其上传供大家学习。
代码片段和文件信息
/*
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
http://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) {
System
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-06 12:27 batch\
文件 1226 2019-03-05 21:43 batch\.classpath
文件 277 2019-03-05 13:40 batch\.gitignore
目录 0 2019-03-06 12:27 batch\.mvn\
目录 0 2019-03-06 12:27 batch\.mvn\wrapper\
文件 48337 2019-03-05 13:40 batch\.mvn\wrapper\maven-wrapper.jar
文件 116 2019-03-05 13:40 batch\.mvn\wrapper\maven-wrapper.properties
文件 4624 2019-03-05 13:40 batch\.mvn\wrapper\MavenWrapperDownloader.java
文件 557 2019-03-05 21:43 batch\.project
目录 0 2019-03-06 12:27 batch\.settings\
文件 155 2019-03-05 21:43 batch\.settings\org.eclipse.core.resources.prefs
文件 243 2019-03-05 21:43 batch\.settings\org.eclipse.jdt.core.prefs
文件 90 2019-03-05 21:41 batch\.settings\org.eclipse.m2e.core.prefs
文件 700 2019-03-05 13:40 batch\HELP.md
文件 9113 2019-03-05 13:40 batch\mvnw
文件 5810 2019-03-05 13:40 batch\mvnw.cmd
文件 1979 2019-03-06 12:27 batch\pom.xm
目录 0 2019-03-06 12:27 batch\src\
目录 0 2019-03-06 12:27 batch\src\main\
目录 0 2019-03-06 12:27 batch\src\main\java\
目录 0 2019-03-06 12:27 batch\src\main\java\com\
目录 0 2019-03-06 12:27 batch\src\main\java\com\jxufe\
目录 0 2019-03-06 12:27 batch\src\main\java\com\jxufe\batch\
文件 305 2019-03-06 09:12 batch\src\main\java\com\jxufe\batch\BatchApplication.java
目录 0 2019-03-06 12:27 batch\src\main\java\com\jxufe\batch\controller\
文件 914 2019-03-06 12:09 batch\src\main\java\com\jxufe\batch\controller\DemoController.java
目录 0 2019-03-06 12:27 batch\src\main\java\com\jxufe\batch\domain\
文件 885 2019-03-06 12:09 batch\src\main\java\com\jxufe\batch\domain\DataInfo.java
文件 993 2019-03-05 21:54 batch\src\main\java\com\jxufe\batch\domain\Person.java
目录 0 2019-03-06 12:27 batch\src\main\java\com\jxufe\batch\springbatch\
文件 6627 2019-03-06 12:19 batch\src\main\java\com\jxufe\batch\springbatch\CsvBatchConfig.java
............此处省略49个文件信息
相关资源
- bootstrap.css.map
- IntelliJ IDEA创建的spring boot项目
- alipay支付Demo-springboot整合版
- springboot入门视频代码教材资源.txt
- STM32F207的串口_IAPBootloader程序
- springboot 登录注册
- 晶科物流管理系统后台页面模板
- Spring+Hibernate工具类所有增删改查
- springboot微信点餐视频源码全.txt
- spring框架毕业设计英文翻译
- springboot+CXF发布webservice接口
- springer.zip
- 尚硅谷spring boot资源,带代码。
- Bootstrap-datetimepicker年月日时分秒均可
- toutiao_第二次课代码 解决spring-boot兼容
- Springboot中ajax实现动态绑定省市区
- 蓝牙测试软件.zip
- freescaleMPC5606sBootLoad
- 修改后的bootstrap-datetimepicker,可以选
- 2小时学会springboot源码
- Spring相关的外文文献和翻译.zip
- SSM到SpringBoot从零开发校园商铺平台
- bootstrap-timepicker.min.rar
- springboot开发的物业管理系统-毕业设计
- SpringBoot开发理财平台产品系统网盘地
- springboot2.0.4下的LCN
- 尚硅谷SpringBoot视频教程上核心技术篇
- bootstrap字体图标资源
- 《Spring微服务实战Spring Microservices i
- 东城在线答疑系统
评论
共有 条评论