/*
* 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();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
【源码+数据库】基于springboot+mysql实现的图书管理系统
共141个文件
html:30个
java:23个
class:22个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 151 浏览量
2024-11-05
11:05:37
上传
评论
收藏 30.45MB ZIP 举报
温馨提示
一、项目简介 本项目是一套基于springboot实现的图书管理系统,主要针对计算机相关专业的正在做bishe的学生和需要项目实战练习的Java学习者。 包含:项目源码、数据库脚本等,该项目可以直接作为bishe使用。 项目都经过严格调试,确保可以运行! 二、技术实现 数据库:mysql5.7 后端框架: SpringBoot HTML模板: ThymeLeaf 持久层: Mybatis UI: Bootstrap 登录验证和用户权限: SpringSecurity 三、系统划分与功能 系统包含两种角色:管理员、读者。主要功能如下: 登录、注销、修改密码 管理员对图书信息的增删改查、查看读者、查看借阅记录 读者对图书信息的查看查询、修改个人信息、查看借阅记录
资源推荐
资源详情
资源评论
收起资源包目录
【源码+数据库】基于springboot+mysql实现的图书管理系统 (141个子文件)
SecurityConfig.class 4KB
Book.class 4KB
SessionFilter.class 3KB
AdminBookController.class 3KB
UserBookController.class 2KB
Reader.class 2KB
UserController.class 2KB
UserService.class 2KB
UserReaderController.class 2KB
Record.class 2KB
UserRecordController.class 2KB
User.class 1KB
AdminRecordController.class 1KB
AdminReaderController.class 1KB
CustomPasswordEncoder.class 933B
LoginController.class 873B
BookmanagerApplication.class 871B
BookMapper.class 791B
ReaderMapper.class 660B
RecordMapper.class 568B
UserMapper.class 552B
BookmanagerApplicationTests.class 443B
bootstrap.css 194KB
bootstrap.css 194KB
bootstrap.min.css 157KB
bootstrap.min.css 157KB
bootstrap-grid.css 66KB
bootstrap-grid.css 66KB
bootstrap-grid.min.css 49KB
bootstrap-grid.min.css 49KB
bootstrap-reboot.css 5KB
bootstrap-reboot.css 5KB
bootstrap-reboot.min.css 4KB
bootstrap-reboot.min.css 4KB
password.html 7KB
password.html 7KB
book_edit.html 5KB
book_edit.html 5KB
book_add.html 5KB
book_add.html 5KB
book_search_result.html 4KB
book_search_result.html 4KB
reader_info.html 4KB
reader_info.html 4KB
books.html 4KB
books.html 4KB
book_info.html 4KB
book_info.html 4KB
book_info.html 4KB
book_info.html 4KB
index.html 4KB
index.html 4KB
book_search_result.html 4KB
book_search_result.html 4KB
books.html 4KB
books.html 4KB
readers.html 4KB
readers.html 4KB
login.html 3KB
login.html 3KB
records.html 3KB
records.html 3KB
ownRecord.html 3KB
ownRecord.html 3KB
MavenWrapperDownloader.java 5KB
Book.java 2KB
AdminBookController.java 2KB
SessionFilter.java 2KB
SecurityConfig.java 1KB
Reader.java 1KB
UserController.java 1KB
UserBookController.java 1KB
Record.java 1KB
UserService.java 1KB
UserReaderController.java 1001B
UserRecordController.java 873B
User.java 818B
AdminReaderController.java 730B
AdminRecordController.java 729B
LoginController.java 465B
BookmanagerApplication.java 456B
BookMapper.java 443B
CustomPasswordEncoder.java 424B
ReaderMapper.java 406B
UserMapper.java 371B
RecordMapper.java 332B
BookmanagerApplicationTests.java 297B
3.jpg 5.25MB
3.jpg 5.25MB
4.jpg 4.36MB
4.jpg 4.36MB
2.jpg 3.79MB
2.jpg 3.79MB
1.jpg 1.59MB
1.jpg 1.59MB
bootstrap.bundle.js 231KB
bootstrap.bundle.js 231KB
bootstrap.js 140KB
bootstrap.js 140KB
bootstrap.bundle.min.js 82KB
共 141 条
- 1
- 2
资源评论
程序猿小D
- 粉丝: 3908
- 资源: 318
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功