Skip to content

Commit e3c5596

Browse files
Priteela AngumPriteela Angum
authored andcommitted
Initial commit
0 parents  commit e3c5596

File tree

20 files changed

+1288
-0
lines changed

20 files changed

+1288
-0
lines changed

.circleci/config.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Java Maven CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-java/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# specify the version you desire here
10+
- image: circleci/openjdk:11-browsers-legacy
11+
12+
# Specify service dependencies here if necessary
13+
# CircleCI maintains a library of pre-built images
14+
# documented at https://circleci.com/docs/2.0/circleci-images/
15+
# - image: circleci/postgres:9.4
16+
17+
working_directory: ~/repo
18+
19+
environment:
20+
# Customize the JVM maximum heap limit
21+
MAVEN_OPTS: -Xmx3200m
22+
23+
steps:
24+
- checkout
25+
26+
# Download and cache dependencies
27+
- restore_cache:
28+
keys:
29+
- v1-dependencies-{{ checksum "pom.xml" }}
30+
# fallback to using the latest cache if no exact match is found
31+
- v1-dependencies-
32+
33+
- run: mvn dependency:go-offline
34+
35+
- save_cache:
36+
paths:
37+
- ~/.m2
38+
key: v1-dependencies-{{ checksum "pom.xml" }}
39+
40+
# run tests!
41+
- run: mvn integration-test

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
######################
2+
# Project Specific
3+
######################
4+
/build/www/**
5+
/src/test/javascript/coverage/
6+
/src/test/javascript/PhantomJS*/
7+
8+
######################
9+
# Node
10+
######################
11+
/node/
12+
node_tmp/
13+
node_modules/
14+
npm-debug.log.*
15+
16+
######################
17+
# SASS
18+
######################
19+
.sass-cache/
20+
21+
######################
22+
# Eclipse
23+
######################
24+
*.pydevproject
25+
.project
26+
.metadata
27+
tmp/
28+
tmp/**/*
29+
*.tmp
30+
*.bak
31+
*.swp
32+
*~.nib
33+
local.properties
34+
.classpath
35+
.settings/
36+
.loadpath
37+
.factorypath
38+
/src/main/resources/rebel.xml
39+
40+
# External tool builders
41+
.externalToolBuilders/**
42+
43+
# Locally stored "Eclipse launch configurations"
44+
*.launch
45+
46+
# CDT-specific
47+
.cproject
48+
49+
# PDT-specific
50+
.buildpath
51+
52+
######################
53+
# Intellij
54+
######################
55+
.idea/
56+
*.iml
57+
*.iws
58+
*.ipr
59+
*.ids
60+
*.orig
61+
62+
######################
63+
# Visual Studio Code
64+
######################
65+
.vscode/
66+
67+
######################
68+
# Maven
69+
######################
70+
/log/
71+
*/target/**
72+
######################
73+
# Gradle
74+
######################
75+
.gradle/
76+
/build/
77+
78+
######################
79+
# Package Files
80+
######################
81+
*.jar
82+
*.war
83+
*.ear
84+
*.db
85+
86+
######################
87+
# Windows
88+
######################
89+
# Windows image file caches
90+
Thumbs.db
91+
92+
# Folder config file
93+
Desktop.ini
94+
95+
######################
96+
# Mac OSX
97+
######################
98+
.DS_Store
99+
.svn
100+
101+
# Thumbnails
102+
._*
103+
104+
# Files that might appear on external disk
105+
.Spotlight-V100
106+
.Trashes
107+
108+
######################
109+
# Directories
110+
######################
111+
/bin/
112+
/deploy/
113+
114+
######################
115+
# Logs
116+
######################
117+
*.log
118+
119+
######################
120+
# Others
121+
######################
122+
*.class
123+
*.*~
124+
*~
125+
.merge_file*
126+
127+
######################
128+
# Gradle Wrapper
129+
######################
130+
!gradle/wrapper/gradle-wrapper.jar
131+
132+
######################
133+
# Maven Wrapper
134+
######################
135+
!.mvn/wrapper/maven-wrapper.jar
136+
137+
######################
138+
# ESLint
139+
######################
140+
.eslintcache
141+
/.idea/
142+
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
33+
*/
34+
private static final String DEFAULT_DOWNLOAD_URL =
35+
"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 =
42+
".mvn/wrapper/maven-wrapper.properties";
43+
44+
/**
45+
* Path where the maven-wrapper.jar will be saved to.
46+
*/
47+
private static final String MAVEN_WRAPPER_JAR_PATH =
48+
".mvn/wrapper/maven-wrapper.jar";
49+
50+
/**
51+
* Name of the property which should be used to override the default download url for the wrapper.
52+
*/
53+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
54+
55+
public static void main(String args[]) {
56+
System.out.println("- Downloader started");
57+
File baseDirectory = new File(args[0]);
58+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
59+
60+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
61+
// wrapperUrl parameter.
62+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
63+
String url = DEFAULT_DOWNLOAD_URL;
64+
if (mavenWrapperPropertyFile.exists()) {
65+
FileInputStream mavenWrapperPropertyFileInputStream = null;
66+
try {
67+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
68+
Properties mavenWrapperProperties = new Properties();
69+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
70+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
71+
} catch (IOException e) {
72+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
73+
} finally {
74+
try {
75+
if (mavenWrapperPropertyFileInputStream != null) {
76+
mavenWrapperPropertyFileInputStream.close();
77+
}
78+
} catch (IOException e) {
79+
// Ignore ...
80+
}
81+
}
82+
}
83+
System.out.println("- Downloading from: : " + url);
84+
85+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
86+
if (!outputFile.getParentFile().exists()) {
87+
if (!outputFile.getParentFile().mkdirs()) {
88+
System.out.println(
89+
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
90+
}
91+
}
92+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
93+
try {
94+
downloadFileFromURL(url, outputFile);
95+
System.out.println("Done");
96+
System.exit(0);
97+
} catch (Throwable e) {
98+
System.out.println("- Error downloading");
99+
e.printStackTrace();
100+
System.exit(1);
101+
}
102+
}
103+
104+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
105+
URL website = new URL(urlString);
106+
ReadableByteChannel rbc;
107+
rbc = Channels.newChannel(website.openStream());
108+
FileOutputStream fos = new FileOutputStream(destination);
109+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
110+
fos.close();
111+
rbc.close();
112+
}
113+
114+
}

.mvn/wrapper/maven-wrapper.jar

47.2 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

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

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[![CircleCI](https://circleci.com/gh/springframeworkguru/mssc-beer-inventory-service.svg?style=svg)](https://circleci.com/gh/springframeworkguru/mssc-beer-inventory-service)
2+
# MSSC Beer Inventory Service
3+
4+
This repository contains source code examples used to support my on-line courses about the Spring Framework.
5+
6+
You can learn more about the courses here:
7+
* [Spring Boot Microservices with Spring Cloud](https://www.udemy.com/spring-boot-microservices-with-spring-cloud-beginner-to-guru/?couponCode=GIT_HUB2)
8+
* [Spring Framework 5: Beginner to Guru](https://www.udemy.com/course/spring-framework-5-beginner-to-guru/?couponCode=GITHUB_SFGPETCLINIC)
9+
* [Testing Spring Boot: Beginner to Guru](https://www.udemy.com/testing-spring-boot-beginner-to-guru/?couponCode=GITHUB_REPO_SF5B2G)

0 commit comments

Comments
 (0)