/*
* Copyright 2007-present the original author or authors.
*
* Licensed 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.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* 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/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".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.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
IDEA+Springboot+Mybatis+MySql+Swagger3.0 的实现 增、删、改、查
共125个文件
xml:100个
java:8个
class:7个
需积分: 50 25 下载量 80 浏览量
2020-08-16
20:27:20
上传
评论 1
收藏 101KB RAR 举报
温馨提示
IDEA+Springboot+Mybatis+MySql+Swagger3.0 的实现 增、删、改、查
资源推荐
资源详情
资源评论
收起资源包目录
IDEA+Springboot+Mybatis+MySql+Swagger3.0 的实现 增、删、改、查 (125个子文件)
User_infoController.class 2KB
Swagger3Config.class 2KB
User_infoService.class 1KB
User_info.class 1KB
DemoApplication.class 871B
DemoApplicationTests.class 521B
User_infoMapper.class 503B
mvnw.cmd 6KB
.gitignore 395B
demo.iml 12KB
maven-wrapper.jar 50KB
MavenWrapperDownloader.java 5KB
User_infoController.java 2KB
Swagger3Config.java 1KB
User_infoService.java 798B
User_info.java 598B
DemoApplication.java 486B
User_infoMapper.java 425B
DemoApplicationTests.java 210B
demo.kotlin_module 16B
HELP.md 1KB
mvnw 10KB
application.properties 590B
application.properties 590B
maven-wrapper.properties 218B
workspace.xml 11KB
uiDesigner.xml 9KB
pom.xml 4KB
User_infoMapper.xml 935B
compiler.xml 803B
Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_3_3_RELEASE.xml 793B
Maven__org_springframework_boot_spring_boot_starter_logging_2_3_3_RELEASE.xml 772B
Maven__org_springframework_boot_spring_boot_starter_tomcat_2_3_3_RELEASE.xml 765B
Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_11_2.xml 760B
Maven__org_springframework_boot_spring_boot_autoconfigure_2_3_3_RELEASE.xml 758B
Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_1_3.xml 754B
Maven__org_springframework_boot_spring_boot_starter_test_2_3_3_RELEASE.xml 751B
Maven__org_springframework_boot_spring_boot_starter_json_2_3_3_RELEASE.xml 751B
Maven__org_springframework_boot_spring_boot_starter_jdbc_2_3_3_RELEASE.xml 751B
Maven__org_springframework_boot_spring_boot_starter_web_2_3_3_RELEASE.xml 744B
Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml 724B
Maven__org_springframework_plugin_spring_plugin_metadata_2_0_0_RELEASE.xml 721B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_11_2.xml 719B
Maven__org_springframework_boot_spring_boot_starter_2_3_3_RELEASE.xml 716B
Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_1_3.xml 712B
User_infoMapper.xml 706B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_11_2.xml 705B
Maven__org_springframework_boot_spring_boot_test_2_3_3_RELEASE.xml 695B
Maven__org_springframework_plugin_spring_plugin_core_2_0_0_RELEASE.xml 693B
Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_37.xml 684B
Maven__org_springframework_spring_expression_5_2_8_RELEASE.xml 682B
Maven__com_fasterxml_jackson_core_jackson_annotations_2_11_2.xml 675B
Maven__org_springframework_spring_context_5_2_8_RELEASE.xml 661B
Maven__org_springframework_boot_spring_boot_2_3_3_RELEASE.xml 660B
Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml 657B
Maven__org_junit_platform_junit_platform_commons_1_6_2.xml 657B
Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml 657B
Maven__com_fasterxml_jackson_core_jackson_databind_2_11_2.xml 654B
Maven__org_springframework_spring_webmvc_5_2_8_RELEASE.xml 654B
Maven__org_junit_platform_junit_platform_engine_1_6_2.xml 650B
Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_37.xml 649B
Maven__org_springframework_spring_beans_5_2_8_RELEASE.xml 647B
Maven__org_springframework_spring_test_5_2_8_RELEASE.xml 640B
Maven__org_springframework_spring_core_5_2_8_RELEASE.xml 640B
Maven__org_springframework_spring_jdbc_5_2_8_RELEASE.xml 640B
Maven__org_junit_jupiter_junit_jupiter_engine_5_6_2.xml 639B
Maven__org_junit_jupiter_junit_jupiter_params_5_6_2.xml 639B
Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml 635B
Maven__org_springframework_spring_jcl_5_2_8_RELEASE.xml 633B
Maven__org_springframework_spring_web_5_2_8_RELEASE.xml 633B
Maven__org_springframework_spring_aop_5_2_8_RELEASE.xml 633B
Maven__org_apache_logging_log4j_log4j_to_slf4j_2_13_3.xml 632B
Maven__io_springfox_springfox_bean_validators_3_0_0.xml 630B
Maven__org_springframework_spring_tx_5_2_8_RELEASE.xml 626B
Maven__com_fasterxml_jackson_core_jackson_core_2_11_2.xml 626B
Maven__io_springfox_springfox_swagger_common_3_0_0.xml 623B
Maven__io_springfox_springfox_spring_webflux_3_0_0.xml 623B
Maven__org_mockito_mockito_junit_jupiter_3_3_3.xml 622B
Maven__org_junit_jupiter_junit_jupiter_api_5_6_2.xml 618B
Maven__io_springfox_springfox_spring_webmvc_3_0_0.xml 616B
Maven__io_swagger_core_v3_swagger_annotations_2_1_2.xml 612B
Maven__io_swagger_swagger_annotations_1_5_20.xml 611B
Maven__io_springfox_springfox_boot_starter_3_0_0.xml 609B
Maven__net_bytebuddy_byte_buddy_agent_1_10_14.xml 609B
Maven__mysql_mysql_connector_java_8_0_21.xml 598B
Maven__org_apache_logging_log4j_log4j_api_2_13_3.xml 597B
Maven__org_apiguardian_apiguardian_api_1_1_0.xml 596B
Maven__io_springfox_springfox_spring_web_3_0_0.xml 595B
Maven__io_springfox_springfox_swagger_ui_3_0_0.xml 595B
Maven__ch_qos_logback_logback_classic_1_2_3.xml 592B
Maven__org_junit_jupiter_junit_jupiter_5_6_2.xml 590B
Maven__io_springfox_springfox_data_rest_3_0_0.xml 588B
Maven__io_springfox_springfox_swagger2_3_0_0.xml 581B
Maven__io_swagger_core_v3_swagger_models_2_1_2.xml 577B
Maven__io_swagger_swagger_models_1_5_20.xml 576B
Maven__org_mybatis_mybatis_spring_2_0_5.xml 573B
Maven__ch_qos_logback_logback_core_1_2_3.xml 571B
Maven__com_jayway_jsonpath_json_path_2_4_0.xml 570B
Maven__io_springfox_springfox_schema_3_0_0.xml 567B
Maven__net_bytebuddy_byte_buddy_1_10_14.xml 567B
共 125 条
- 1
- 2
资源评论
haojuntu
- 粉丝: 25
- 资源: 52
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 课程设计-基于SpringBoot + Mybatis+python爬虫NBA球员数据爬取可视化+源代码+文档+sql+效果图
- 软件品质管理系列二项目策划规范.doc
- 基于TensorFlow+PyQt+GUI的酒店评论情感分析,支持分析本地数据文件和网络爬取数据分析+源代码+文档说明+安装教程
- 软件定义无线电中的模拟电路测试技术.pptx
- 软件开发协议(作为技术开发合同附件).doc
- 软件开发和咨询行业技术趋势分析.pptx
- 软件测试题详解及答案.doc
- 软件漏洞生命周期管理策略.pptx
- 毕业设计-基于Python实现的的简易气温爬虫,可以爬取全国各市的近7日气温数据
- 软件系统测试报告(实用版).doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功