-
大小: 93KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-06-16
- 语言: Java
- 标签: springboot spring
资源简介
该代码是基于springboot的开发方式,主要实现了springboot动态加载外部任意位置的jar文件(这个jar是根据具体的业务逻辑来的),jar可以是一个完整的spring类型的功能模块。暂时没有处理controller相关的实现。
代码片段和文件信息
/*
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
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.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) {
Syst
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-06-21 11:00 dynamicer\
文件 5811 2019-06-18 14:42 dynamicer\mvnw.cmd
文件 1580 2019-06-18 20:08 dynamicer\pom.xm
文件 532 2019-06-18 14:42 dynamicer\HELP.md
文件 333 2019-06-18 14:42 dynamicer\.gitignore
目录 0 2019-06-18 14:42 dynamicer\.mvn\
目录 0 2019-06-18 14:42 dynamicer\.mvn\wrapper\
文件 4629 2019-06-18 14:42 dynamicer\.mvn\wrapper\MavenWrapperDownloader.java
文件 116 2019-06-18 14:42 dynamicer\.mvn\wrapper\maven-wrapper.properties
文件 48337 2019-06-18 14:42 dynamicer\.mvn\wrapper\maven-wrapper.jar
文件 7470 2019-06-18 20:08 dynamicer\dynamicer.iml
文件 9114 2019-06-18 14:42 dynamicer\mvnw
目录 0 2019-06-21 11:00 dynamicer\.idea\
文件 172 2019-06-18 14:43 dynamicer\.idea\encodings.xm
目录 0 2019-06-18 14:43 dynamicer\.idea\libraries\
文件 771 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_springfr
文件 646 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_springfr
文件 750 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_springfr
文件 603 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_apache_logging_log4j_log4j_api_2_11_2.xm
文件 639 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_springfr
文件 759 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__com_fasterxm
文件 565 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_xm
文件 667 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_springfr
文件 674 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__com_fasterxm
文件 638 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xm
文件 718 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__com_fasterxm
文件 660 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_springfr
文件 566 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__net_bytebuddy_byte_buddy_1_9_12.xm
文件 711 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__org_hibernate_validator_hibernate_validator_6_0_16_Final.xm
文件 608 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__net_bytebuddy_byte_buddy_agent_1_9_12.xm
文件 552 2019-06-18 14:43 dynamicer\.idea\libraries\Maven__com_fasterxm
............此处省略61个文件信息
- 上一篇:JSP实现基本的注册功能
- 下一篇:基于android MP3播放器
相关资源
- spring-orm-4.3.2.RELEASE.jar
- SpriteSplit
- Springboot企业微信外卖系统JAVA+百度永
- springMVC + BootStrap + mybatis + maven
-
org.springfr
amework.context.support-3.0.5.R - Java Spring技术栈构建团购网站前后台
- Spring技术栈构建完整java前后台团购网
- java8+tomcat8+struts2.5+spring4.3+hibernate5.2框
- jersey-spring-1.18.jar
- spring boot+mybatis+spring mvc整合开发超市
- com.springsource.org.aopalliance-1.0.0.jar
- javax.annotation-api-1.3.jar
-
org.springfr
amework.context-3.2.2.RELEASE.j - springboot+shiro实现后端请求权限控制
- spring-web.jar
- spring-context.jar
- 基于SpringMVC的JAVA论坛(J2EE BBS 毕业设
- spring 定时器完整 demo
- NodeJsProject.zip
- SpringBoot集成Elasticsearch已实现各种ES操
- xssProject所需jar包
- springboot+maven+mybatis实现的项目增删改
- Spring Jdbc的jar包
- mybatis-spring-1.3.1.jar官方
- 用户登录Struts1.2+Spring2.5+Hibernate3.2
- Java Spring技术栈构建完整前后台团购网
- Spring Boot从前端到后台打造企业级博客
- Spring-boot+Mybatis+Maven+MySql搭建
- spring-context.jar jar包 上下文
- 小贝程序员生活\\jar\\lib\\com.springsou
评论
共有 条评论