Skip to content

Commit 71464d2

Browse files
committed
Updating Documentation
1 parent 3ae5d68 commit 71464d2

150 files changed

Lines changed: 61074 additions & 1 deletion

File tree

Some content is hidden

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

‎.DS_Store‎

6 KB
Binary file not shown.

‎README.md‎

Lines changed: 2355 additions & 1 deletion
Large diffs are not rendered by default.

‎usermodel/.DS_Store‎

6 KB
Binary file not shown.

‎usermodel/.gitignore‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
HELP.md
2+
/target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
5+
### STS ###
6+
.apt_generated
7+
.classpath
8+
.factorypath
9+
.project
10+
.settings
11+
.springBeans
12+
.sts4-cache
13+
14+
### IntelliJ IDEA ###
15+
.idea
16+
*.iws
17+
*.iml
18+
*.ipr
19+
20+
### NetBeans ###
21+
/nbproject/private/
22+
/nbbuild/
23+
/dist/
24+
/nbdist/
25+
/.nb-gradle/
26+
/build/
27+
28+
### VS Code ###
29+
.vscode/
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
20+
import java.io.File;
21+
import java.io.FileInputStream;
22+
import java.io.FileOutputStream;
23+
import java.io.IOException;
24+
import java.net.URL;
25+
import java.nio.channels.Channels;
26+
import java.nio.channels.ReadableByteChannel;
27+
import java.util.Properties;
28+
29+
public class MavenWrapperDownloader
30+
{
31+
32+
/**
33+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
34+
*/
35+
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";
36+
37+
/**
38+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
39+
* use instead of the default one.
40+
*/
41+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";
42+
43+
/**
44+
* Path where the maven-wrapper.jar will be saved to.
45+
*/
46+
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";
47+
48+
/**
49+
* Name of the property which should be used to override the default download url for the wrapper.
50+
*/
51+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
52+
53+
public static void main(String args[])
54+
{
55+
System.out.println("- Downloader started");
56+
File baseDirectory = new File(args[0]);
57+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
58+
59+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
60+
// wrapperUrl parameter.
61+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
62+
String url = DEFAULT_DOWNLOAD_URL;
63+
if (mavenWrapperPropertyFile.exists())
64+
{
65+
FileInputStream mavenWrapperPropertyFileInputStream = null;
66+
try
67+
{
68+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
69+
Properties mavenWrapperProperties = new Properties();
70+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
71+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
72+
}
73+
catch (IOException e)
74+
{
75+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
76+
}
77+
finally
78+
{
79+
try
80+
{
81+
if (mavenWrapperPropertyFileInputStream != null)
82+
{
83+
mavenWrapperPropertyFileInputStream.close();
84+
}
85+
}
86+
catch (IOException e)
87+
{
88+
// Ignore ...
89+
}
90+
}
91+
}
92+
System.out.println("- Downloading from: : " + url);
93+
94+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
95+
if (!outputFile.getParentFile().exists())
96+
{
97+
if (!outputFile.getParentFile().mkdirs())
98+
{
99+
System.out.println("- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
100+
}
101+
}
102+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
103+
try
104+
{
105+
downloadFileFromURL(url, outputFile);
106+
System.out.println("Done");
107+
System.exit(0);
108+
}
109+
catch (Throwable e)
110+
{
111+
System.out.println("- Error downloading");
112+
e.printStackTrace();
113+
System.exit(1);
114+
}
115+
}
116+
117+
private static void downloadFileFromURL(String urlString, File destination) throws Exception
118+
{
119+
URL website = new URL(urlString);
120+
ReadableByteChannel rbc;
121+
rbc = Channels.newChannel(website.openStream());
122+
FileOutputStream fos = new FileOutputStream(destination);
123+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
124+
fos.close();
125+
rbc.close();
126+
}
127+
128+
}
47.2 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip

0 commit comments

Comments
 (0)