/*
* 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();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
图书管理系统 web课程设计 springboot mybatis.zip
共75个文件
java:23个
html:15个
map:10个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 87 浏览量
2023-06-28
10:13:28
上传
评论 1
收藏 15.38MB ZIP 举报
温馨提示
本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!! 本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!! 本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!!
资源推荐
资源详情
资源评论
收起资源包目录
图书管理系统 web课程设计 springboot mybatis.zip (75个子文件)
bookmanager-master
pom.xml 3KB
src
test
java
com
lyx
bookmanager
BookmanagerApplicationTests.java 386B
main
resources
mapper
BookMapper.xml 1KB
UserMapper.xml 610B
ReaderMapper.xml 824B
RecordMapper.xml 458B
application.properties 1B
templates
admin
book_edit.html 5KB
book_search_result.html 4KB
books.html 4KB
records.html 3KB
readers.html 4KB
book_info.html 4KB
book_add.html 5KB
password.html 7KB
user
book_search_result.html 4KB
ownRecord.html 3KB
books.html 4KB
reader_info.html 4KB
book_info.html 4KB
login.html 3KB
index.html 4KB
static
bootstrap
js
bootstrap.js 140KB
bootstrap.bundle.js.map 399KB
bootstrap.bundle.min.js.map 308KB
bootstrap.min.js 62KB
bootstrap.bundle.min.js 82KB
bootstrap.bundle.js 231KB
bootstrap.js.map 247KB
jquery.js 67KB
bootstrap.min.js.map 187KB
css
bootstrap-grid.css.map 154KB
bootstrap.min.css 157KB
bootstrap-grid.css 66KB
bootstrap-grid.min.css.map 112KB
bootstrap-reboot.min.css.map 32KB
bootstrap.css.map 497KB
bootstrap.css 194KB
bootstrap-reboot.css 5KB
bootstrap-reboot.css.map 75KB
bootstrap-grid.min.css 49KB
bootstrap.min.css.map 632KB
bootstrap-reboot.min.css 4KB
img
2.jpg 3.79MB
1.jpg 1.59MB
3.jpg 5.25MB
4.jpg 4.36MB
application.yml 407B
java
com
lyx
bookmanager
mapper
RecordMapper.java 332B
UserMapper.java 371B
BookMapper.java 443B
ReaderMapper.java 406B
controller
admin
AdminReaderController.java 730B
AdminBookController.java 2KB
AdminRecordController.java 729B
UserController.java 1KB
user
UserReaderController.java 1001B
UserBookController.java 1KB
UserRecordController.java 873B
LoginController.java 764B
BookmanagerApplication.java 452B
pojo
Reader.java 476B
Book.java 695B
Record.java 495B
User.java 293B
config
UserService.java 1KB
SecurityConfig.java 1KB
CustomPasswordEncoder.java 424B
SessionFilter.java 1KB
.mvn
wrapper
maven-wrapper.properties 218B
maven-wrapper.jar 50KB
MavenWrapperDownloader.java 5KB
REA1DME.md 2KB
library.sql 16KB
.gitignore 395B
共 75 条
- 1
资源评论
白话机器学习
- 粉丝: 9135
- 资源: 7681
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功