资源简介
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个文件信息
相关资源
- SpringBoot+H2+mybatis-plus59130
- uboot到linux logo显示不间断 补丁
- Bootloader源码分析(好东西).rar
- atmega64bootload
- BootLoader和BSP
- 基于J2EE物资出入库管理系统
- 基于SSM+CXF构建的RESTFul webservice
- Cellular automata Model: an Adaptive Approach
- 易语言Bootstrap类模块2.13源码
- 大数据中的云网络Cloud Networking for B
- Spring+MyBatis企业应用实战第一二版的源
- web开发舔狗日记 框架bootstrap
- bootstrap demo 源码大全
- springboot+rabbitmq项目demo(亲测可正常运
- springboot整合RabbitMQ实现延时队列的两
- 关于Spring MVC项目maven中通过fileupload上
- Spring-Data-Redis2.0+Spring5
- 基于S32K144的CANbootloader
- 2017年-传智播客-张志君老师-SpringBoo
- ARM7TDMI-S在嵌入式系统中的Bootloader代码
- springboot+mybatis整合实现注册登录
-
spring-fr
amework-5.0.2.RELEASE 源码包 - 基于web的图书馆运营系统
- springboot+webflux+mongodb+freemarker
- springboot整合activiti完整demo
- SpringBoot实战(第4版)清晰版.pdf.zip
- SpringBoot 中文文档
- springboot+jpa+thymeleaf实现增删改查分页
- es(elasticsearch)整合SpringCloudSpringBo
- Springboot日志开启SLF4J过程解析
评论
共有 条评论