Skip to content

Commit 96abad9

Browse files
committed
initial commit
0 parents  commit 96abad9

File tree

291 files changed

+18428
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+18428
-0
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
*.tmp
2+
*.swp
3+
**/*.log
4+
*.iml
5+
**/target/
6+
build
7+
!**/src/main/**/build/
8+
!**/src/test/**/build/
9+
bin/
10+
internal/
11+
out/
12+
.settings/
13+
.idea/
14+
.gradle/
15+
.DS_Store
16+
.classpath
17+
.project
18+
.factorypath
19+
pom.xml.versionsBackup
20+
**/src/generated/java/META-INF
21+
**.java-version
22+
**/.rewrite-cache
+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import java.net.*;
17+
import java.io.*;
18+
import java.nio.channels.*;
19+
import java.util.Properties;
20+
21+
public class MavenWrapperDownloader {
22+
23+
private static final String WRAPPER_VERSION = "0.5.6";
24+
/**
25+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26+
*/
27+
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29+
30+
/**
31+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32+
* use instead of the default one.
33+
*/
34+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35+
".mvn/wrapper/maven-wrapper.properties";
36+
37+
/**
38+
* Path where the maven-wrapper.jar will be saved to.
39+
*/
40+
private static final String MAVEN_WRAPPER_JAR_PATH =
41+
".mvn/wrapper/maven-wrapper.jar";
42+
43+
/**
44+
* Name of the property which should be used to override the default download url for the wrapper.
45+
*/
46+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47+
48+
public static void main(String args[]) {
49+
System.out.println("- Downloader started");
50+
File baseDirectory = new File(args[0]);
51+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52+
53+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
54+
// wrapperUrl parameter.
55+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56+
String url = DEFAULT_DOWNLOAD_URL;
57+
if(mavenWrapperPropertyFile.exists()) {
58+
FileInputStream mavenWrapperPropertyFileInputStream = null;
59+
try {
60+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61+
Properties mavenWrapperProperties = new Properties();
62+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64+
} catch (IOException e) {
65+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66+
} finally {
67+
try {
68+
if(mavenWrapperPropertyFileInputStream != null) {
69+
mavenWrapperPropertyFileInputStream.close();
70+
}
71+
} catch (IOException e) {
72+
// Ignore ...
73+
}
74+
}
75+
}
76+
System.out.println("- Downloading from: " + url);
77+
78+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79+
if(!outputFile.getParentFile().exists()) {
80+
if(!outputFile.getParentFile().mkdirs()) {
81+
System.out.println(
82+
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83+
}
84+
}
85+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86+
try {
87+
downloadFileFromURL(url, outputFile);
88+
System.out.println("Done");
89+
System.exit(0);
90+
} catch (Throwable e) {
91+
System.out.println("- Error downloading");
92+
e.printStackTrace();
93+
System.exit(1);
94+
}
95+
}
96+
97+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99+
String username = System.getenv("MVNW_USERNAME");
100+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101+
Authenticator.setDefault(new Authenticator() {
102+
@Override
103+
protected PasswordAuthentication getPasswordAuthentication() {
104+
return new PasswordAuthentication(username, password);
105+
}
106+
});
107+
}
108+
URL website = new URL(urlString);
109+
ReadableByteChannel rbc;
110+
rbc = Channels.newChannel(website.openStream());
111+
FileOutputStream fos = new FileOutputStream(destination);
112+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113+
fos.close();
114+
rbc.close();
115+
}
116+
117+
}

.mvn/wrapper/maven-wrapper.jar

49.5 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright 2021 - 2022 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

CODE_OF_CONDUCT.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open
4+
and welcoming community, we pledge to respect all people who contribute through reporting
5+
issues, posting feature requests, updating documentation, submitting pull requests or
6+
patches, and other activities.
7+
8+
We are committed to making participation in this project a harassment-free experience for
9+
everyone, regardless of level of experience, gender, gender identity and expression,
10+
sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
11+
religion, or nationality.
12+
13+
Examples of unacceptable behavior by participants include:
14+
15+
* The use of sexualized language or imagery
16+
* Personal attacks
17+
* Trolling or insulting/derogatory comments
18+
* Public or private harassment
19+
* Publishing other's private information, such as physical or electronic addresses,
20+
without explicit permission
21+
* Other unethical or unprofessional conduct
22+
23+
Project maintainers have the right and responsibility to remove, edit, or reject comments,
24+
commits, code, wiki edits, issues, and other contributions that are not aligned to this
25+
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
26+
that they deem inappropriate, threatening, offensive, or harmful.
27+
28+
By adopting this Code of Conduct, project maintainers commit themselves to fairly and
29+
consistently applying these principles to every aspect of managing this project. Project
30+
maintainers who do not follow or enforce the Code of Conduct may be permanently removed
31+
from the project team.
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an
34+
individual is representing the project or its community.
35+
36+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
37+
contacting a project maintainer at [email protected] . All complaints will
38+
be reviewed and investigated and will result in a response that is deemed necessary and
39+
appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
40+
with regard to the reporter of an incident.
41+
42+
This Code of Conduct is adapted from the
43+
[Contributor Covenant](https://contributor-covenant.org), version 1.3.0, available at
44+
[contributor-covenant.org/version/1/3/0/](https://contributor-covenant.org/version/1/3/0/)

CONTRIBUTING.adoc

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
= Contributing to Spring Boot Migrator
2+
3+
Spring Boot Migrator is released under the Apache 2.0 license.
4+
If you would like to contribute something, or want to hack on the code this document should help you get started.
5+
6+
7+
8+
== Code of Conduct
9+
This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.md[code of conduct].
10+
By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
11+
12+
13+
14+
== Using GitHub Issues
15+
We use GitHub issues to track bugs and enhancements.
16+
17+
If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible.
18+
Ideally, that would include a small sample project that reproduces the problem.
19+
20+
21+
== Reporting Security Vulnerabilities
22+
If you think you have found a security vulnerability in Spring Boot please *DO NOT* disclose it publicly until we've had a chance to fix it.
23+
Please don't report security vulnerabilities using GitHub issues, instead head over to https://spring.io/security-policy and learn how to disclose them responsibly.
24+
25+
26+
27+
== Sign the Contributor License Agreement
28+
Before we accept a non-trivial patch or pull request we will need you to https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement].
29+
Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do.
30+
Active contributors might be asked to join the core team, and given the ability to merge pull requests.
31+
32+
33+
34+
== Code Conventions and Housekeeping
35+
None of these is essential for a pull request, but they will all help. They can also be
36+
added after the original pull request but before a merge.
37+
38+
* Make sure all new `.java` files have a Javadoc class comment with at least an `@author` tag identifying you, and preferably at least a paragraph on what the class is for.
39+
* Add the ASF license header comment to all new `.java` files (copy from existing files in the project). +
40+
The license headers can be generated using the license plugin: `mvn license:format`
41+
* Add yourself as an `@author` to the `.java` files that you modify substantially (more than cosmetic changes).
42+
* Add some Javadocs.
43+
* A few unit tests would help a lot as well -- someone has to do it.
44+
* If no-one else is using your branch, please rebase it against the current main branch (or other target branch in the project).
45+
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions].

0 commit comments

Comments
 (0)