Skip to content

Commit 3392d2a

Browse files
committed
Layout project modules
1 parent 21d4000 commit 3392d2a

File tree

19 files changed

+1309
-1
lines changed

19 files changed

+1309
-1
lines changed

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
target/
2+
pom.xml.tag
3+
pom.xml.releaseBackup
4+
pom.xml.versionsBackup
5+
pom.xml.next
6+
release.properties
7+
dependency-reduced-pom.xml
8+
buildNumber.properties
9+
.mvn/timing.properties
10+
.mvn/wrapper/maven-wrapper.jar
11+
.classpath
12+
.project
13+
.settings/
14+
.checkstyle
15+
.idea/
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.DS_Store
+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.5";
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.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar

COPYRIGHT-AklivityCommunity

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright ${copyrightYears} Aklivity
3+
*
4+
* Licensed under the Aklivity Community License (the "License"); you may not use
5+
* this file except in compliance with the License. You may obtain a copy of the
6+
* License at
7+
*
8+
* http://www.aklivity.io/aklivity-community-license
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, WITHOUT
12+
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
* specific language governing permissions and limitations under the License.
14+
*/
15+

COPYRIGHT-Apache

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright ${copyrightYears} Aklivity
2+
3+
Aklivity licenses this file to you under the Apache License,
4+
version 2.0 (the "License"); you may not use this file except in compliance
5+
with the License. You may obtain a copy of the License at:
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
License for the specific language governing permissions and limitations
13+
under the License.

LICENSE

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The project is licensed under the Aklivity Community License, except for selected
2+
components which are under the Apache 2.0 license.
3+
4+
See LICENSE file in each subfolder for detailed license agreement.

LICENSE-AklivityCommunity

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
Aklivity Community License Agreement
2+
Version 1.0
3+
4+
This Aklivity Community License Agreement Version 1.0 (the “Agreement”) sets
5+
forth the terms on which Aklivity, Inc. (“Aklivity”) makes available certain
6+
software made available by Aklivity under this Agreement (the “Software”). BY
7+
INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE,
8+
YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO
9+
SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. IF YOU ARE RECEIVING
10+
THE SOFTWARE ON BEHALF OF A LEGAL ENTITY, YOU REPRESENT AND WARRANT THAT YOU
11+
HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND CONDITIONS OF THIS
12+
AGREEMENT ON BEHALF OF SUCH ENTITY. “Licensee” means you, an individual, or
13+
the entity on whose behalf you are receiving the Software.
14+
15+
1. LICENSE GRANT AND CONDITIONS.
16+
17+
1.1 License. Subject to the terms and conditions of this Agreement,
18+
Aklivity hereby grants to Licensee a non-exclusive, royalty-free,
19+
worldwide, non-transferable, non-sublicenseable license during the term
20+
of this Agreement to: (a) use the Software; (b) prepare modifications and
21+
derivative works of the Software; (c) distribute the Software (including
22+
without limitation in source code or object code form); and (d) reproduce
23+
copies of the Software (the “License”). Licensee is not granted the
24+
right to, and Licensee shall not, exercise the License for an Excluded
25+
Purpose. For purposes of this Agreement, “Excluded Purpose” means making
26+
available any software-as-a-service, platform-as-a-service,
27+
infrastructure-as-a-service or other similar online service that competes
28+
with Aklivity products or services that provide the Software.
29+
30+
1.2 Conditions. In consideration of the License, Licensee’s distribution
31+
of the Software is subject to the following conditions:
32+
33+
(a) Licensee must cause any Software modified by Licensee to carry
34+
prominent notices stating that Licensee modified the Software.
35+
36+
(b) On each Software copy, Licensee shall reproduce and not remove or
37+
alter all Aklivity or third party copyright or other proprietary
38+
notices contained in the Software, and Licensee must provide the
39+
notice below with each copy.
40+
41+
“This software is made available by Aklivity, Inc., under the
42+
terms of the Aklivity Community License Agreement, Version 1.0
43+
located at http://www.Aklivity.io/Aklivity-community-license. BY
44+
INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF
45+
THE SOFTWARE, YOU AGREE TO THE TERMS OF SUCH LICENSE AGREEMENT.”
46+
47+
1.3 Licensee Modifications. Licensee may add its own copyright notices
48+
to modifications made by Licensee and may provide additional or different
49+
license terms and conditions for use, reproduction, or distribution of
50+
Licensee’s modifications. While redistributing the Software or
51+
modifications thereof, Licensee may choose to offer, for a fee or free of
52+
charge, support, warranty, indemnity, or other obligations. Licensee, and
53+
not Aklivity, will be responsible for any such obligations.
54+
55+
1.4 No Sublicensing. The License does not include the right to
56+
sublicense the Software, however, each recipient to which Licensee
57+
provides the Software may exercise the Licenses so long as such recipient
58+
agrees to the terms and conditions of this Agreement.
59+
60+
2. TERM AND TERMINATION. This Agreement will continue unless and until
61+
earlier terminated as set forth herein. If Licensee breaches any of its
62+
conditions or obligations under this Agreement, this Agreement will
63+
terminate automatically and the License will terminate automatically and
64+
permanently.
65+
66+
3. INTELLECTUAL PROPERTY. As between the parties, Aklivity will retain all
67+
right, title, and interest in the Software, and all intellectual property
68+
rights therein. Aklivity hereby reserves all rights not expressly granted
69+
to Licensee in this Agreement. Aklivity hereby reserves all rights in its
70+
trademarks and service marks, and no licenses therein are granted in this
71+
Agreement.
72+
73+
4. DISCLAIMER. Aklivity HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND
74+
CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY
75+
DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
76+
PURPOSE, WITH RESPECT TO THE SOFTWARE.
77+
78+
5. LIMITATION OF LIABILITY. Aklivity WILL NOT BE LIABLE FOR ANY DAMAGES OF
79+
ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL,
80+
SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY
81+
THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL
82+
APPLY TO THE EXTENT PERMITTED BY APPLICABLE LAW.
83+
84+
6.GENERAL.
85+
86+
6.1 Governing Law. This Agreement will be governed by and interpreted in
87+
accordance with the laws of the state of California, without reference to
88+
its conflict of laws principles. If Licensee is located within the
89+
United States, all disputes arising out of this Agreement are subject to
90+
the exclusive jurisdiction of courts located in Santa Clara County,
91+
California. USA. If Licensee is located outside of the United States,
92+
any dispute, controversy or claim arising out of or relating to this
93+
Agreement will be referred to and finally determined by arbitration in
94+
accordance with the JAMS International Arbitration Rules. The tribunal
95+
will consist of one arbitrator. The place of arbitration will be Palo
96+
Alto, California. The language to be used in the arbitral proceedings
97+
will be English. Judgment upon the award rendered by the arbitrator may
98+
be entered in any court having jurisdiction thereof.
99+
100+
6.2 Assignment. Licensee is not authorized to assign its rights under
101+
this Agreement to any third party. Aklivity may freely assign its rights
102+
under this Agreement to any third party.
103+
104+
6.3 Other. This Agreement is the entire agreement between the parties
105+
regarding the subject matter hereof. No amendment or modification of
106+
this Agreement will be valid or binding upon the parties unless made in
107+
writing and signed by the duly authorized representatives of both
108+
parties. In the event that any provision, including without limitation
109+
any condition, of this Agreement is held to be unenforceable, this
110+
Agreement and all licenses and rights granted hereunder will immediately
111+
terminate. Waiver by Aklivity of a breach of any provision of this
112+
Agreement or the failure by Aklivity to exercise any right hereunder
113+
will not be construed as a waiver of any subsequent breach of that right
114+
or as a waiver of any other right.

0 commit comments

Comments
 (0)