/*
* 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();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
intellij idea 中调用kettle9.2.0.0-290样例
共271个文件
xml:246个
lst:4个
java:4个
5星 · 超过95%的资源 需积分: 50 3 下载量 63 浏览量
2022-01-13
17:14:19
上传
评论
收藏 118.27MB ZIP 举报
温馨提示
1、kettle-password-encoder-plugins.xml这个文件放在src/main/resources/下边 2、执行main函数即可
资源详情
资源评论
资源推荐
收起资源包目录
intellij idea 中调用kettle9.2.0.0-290样例 (271个子文件)
KettleTest.class 3KB
KettleApplication.class 727B
KettleApplicationTests.class 525B
mvnw.cmd 6KB
.gitignore 395B
.gitignore 208B
kettle.iml 25KB
kettle-0.0.1-SNAPSHOT.jar 135.45MB
maven-wrapper.jar 50KB
MavenWrapperDownloader.java 5KB
KettleTest.java 4KB
KettleApplication.java 315B
KettleApplicationTests.java 211B
inputFiles.lst 109B
createdFiles.lst 63B
inputFiles.lst 63B
createdFiles.lst 40B
HELP.md 893B
mvnw 10KB
kettle-0.0.1-SNAPSHOT.jar.original 5KB
maven-wrapper.properties 218B
pom.properties 63B
application.properties 1B
application.properties 1B
com.kettle.KettleApplicationTests.txt 318B
TEST-com.kettle.KettleApplicationTests.xml 55KB
workspace.xml 5KB
pom.xml 5KB
jarRepositories.xml 2KB
Maven__org_eclipse_core_commands_3_3_0_I20070605_0010.xml 1KB
Maven__ch_qos_logback_logback_classic_1_2_9.xml 843B
compiler.xml 809B
Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_13_1.xml 736B
Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_6_2.xml 713B
Maven__org_hibernate_hibernate_commons_annotations_3_2_0_Final.xml 704B
Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml 700B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_13_1.xml 695B
Maven__org_springframework_boot_spring_boot_starter_logging_2_6_2.xml 692B
Maven__org_eclipse_platform_org_eclipse_equinox_common_3_15_100.xml 690B
Maven__org_springframework_boot_spring_boot_starter_tomcat_2_6_2.xml 685B
Maven__org_eclipse_platform_org_eclipse_core_commands_3_10_100.xml 683B
Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_13_1.xml 681B
Maven__org_springframework_boot_spring_boot_autoconfigure_2_6_2.xml 678B
Maven__org_eclipse_swt_org_eclipse_swt_gtk_linux_x86_64_4_6.xml 677B
Maven__org_pentaho_pentaho_encryption_support_9_2_0_0_290.xml 675B
Maven__org_springframework_boot_spring_boot_starter_test_2_6_2.xml 671B
Maven__org_springframework_boot_spring_boot_starter_json_2_6_2.xml 671B
Maven__pentaho_pentaho_service_coordinator_9_2_0_0_290.xml 666B
Maven__org_springframework_boot_spring_boot_starter_web_2_6_2.xml 664B
Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_56.xml 660B
Maven__pentaho_pentaho_capability_manager_9_2_0_0_290.xml 659B
Maven__org_springframework_security_spring_security_core_5_6_1.xml 659B
Maven__org_pentaho_reporting_library_libserializer_9_2_0_0_290.xml 656B
Maven__org_pentaho_reporting_library_librepository_9_2_0_0_290.xml 656B
Maven__com_sun_jersey_contribs_jersey_apache_client4_1_19_1.xml 653B
Maven__com_fasterxml_jackson_core_jackson_annotations_2_13_1.xml 651B
Maven__org_pentaho_reporting_library_libdocbundle_9_2_0_0_290.xml 649B
Maven__org_pentaho_commons_database_model_9_2_0_0_290.xml 647B
Maven__org_pentaho_reporting_engine_classic_core_9_2_0_0_290.xml 645B
Maven__org_springframework_boot_spring_boot_starter_2_6_2.xml 636B
Maven__org_pentaho_reporting_library_libformula_9_2_0_0_290.xml 635B
Maven__jakarta_activation_jakarta_activation_api_1_2_2.xml 633B
Maven__org_junit_platform_junit_platform_commons_1_8_2.xml 633B
Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml 633B
Maven__com_fasterxml_jackson_core_jackson_databind_2_13_1.xml 630B
Maven__org_pentaho_reporting_library_libformat_9_2_0_0_290.xml 628B
Maven__org_pentaho_reporting_library_libloader_9_2_0_0_290.xml 628B
Maven__org_junit_platform_junit_platform_engine_1_8_2.xml 626B
Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_56.xml 625B
Maven__org_eclipse_jetty_jetty_util_9_4_44_v20210927.xml 622B
Maven__org_eclipse_jetty_jetty_jaas_9_4_44_v20210927.xml 622B
Maven__org_pentaho_reporting_library_libswing_9_2_0_0_290.xml 621B
Maven__org_pentaho_reporting_library_libpixie_9_2_0_0_290.xml 621B
Maven__org_pentaho_reporting_library_libfonts_9_2_0_0_290.xml 621B
Maven__org_hibernate_hibernate_ehcache_5_6_3_Final.xml 620B
Maven__org_pentaho_actionsequence_dom_9_2_0_0_290.xml 619B
Maven__pentaho_pentaho_platform_api_9_2_0_0_290.xml 617B
Maven__commons_collections_commons_collections_3_2_2.xml 616B
Maven__org_junit_jupiter_junit_jupiter_params_5_8_2.xml 615B
Maven__org_springframework_boot_spring_boot_test_2_6_2.xml 615B
Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml 615B
Maven__org_pentaho_reporting_library_libbase_9_2_0_0_290.xml 614B
Maven__org_apache_xmlgraphics_xmlgraphics_commons_2_2.xml 614B
Maven__org_eclipse_platform_org_eclipse_jface_3_22_0.xml 613B
Maven__org_pentaho_commons_xul_swing_9_2_0_0_290.xml 612B
Maven__javax_validation_validation_api_2_0_1_Final.xml 611B
Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_56.xml 611B
Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_3.xml 611B
Maven__pentaho_pentaho_connections_9_2_0_0_290.xml 610B
Maven__pentaho_pentaho_vfs_browser_9_2_0_0_290.xml 610B
Maven__pentaho_kettle_kettle_dbdialog_9_2_0_0_290.xml 610B
Maven__org_springframework_spring_expression_5_3_14.xml 609B
Maven__org_apache_logging_log4j_log4j_to_slf4j_2_17_0.xml 608B
Maven__org_apache_xmlgraphics_batik_transcoder_1_9_1.xml 607B
Maven__org_pentaho_reporting_library_libxml_9_2_0_0_290.xml 607B
Maven__org_eclipse_platform_org_eclipse_swt_3_118_0.xml 606B
Maven__org_pentaho_pentaho_registry_9_2_0_0_290.xml 605B
Maven__org_apache_commons_commons_collections4_4_4.xml 605B
Maven__org_pentaho_commons_xul_core_9_2_0_0_290.xml 605B
Maven__com_fasterxml_jackson_core_jackson_core_2_13_1.xml 602B
共 271 条
- 1
- 2
- 3
shz418
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论10