>builder()
46 | .id(String.valueOf(sequence))
47 | .event("states-list-event")
48 | .data(stateService.getListByDeviceId(id))
49 | .build());
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/mqtt-cli-fe/src/App.js:
--------------------------------------------------------------------------------
1 | import logo from "./logo.svg";
2 | import "./App.css";
3 | import { Home } from "./pages/Home";
4 | import { useEffect, useState } from "react";
5 | import { BASE_URL } from "./res/Constants";
6 | import DeviceSelectComponent from "./components/DeviceSelectComponent";
7 | import { ButtonComponent } from "./components/ButtonComponent";
8 |
9 | function App() {
10 | const [initialData, setInitialData] = useState();
11 | const [deviceIds, setDeviceIds] = useState([]);
12 | const [selectedDevice, setSelectedDevice] = useState();
13 | const [deviceSelected, setdeviceSelected] = useState(false);
14 |
15 | const fetchDeviceIds = () => {
16 | console.log("Base Url:", BASE_URL);
17 | fetch(`${BASE_URL}/data/devices`).then((response) => {
18 | return response
19 | .json()
20 | .then((data) => {
21 | setDeviceIds(data);
22 | })
23 | .catch((err) => {
24 | console.log(err);
25 | });
26 | });
27 | };
28 |
29 | const fetchInitialData = () => {
30 | console.log("Base Url:", BASE_URL);
31 | fetch(`${BASE_URL}/data/stored-data/${selectedDevice}`).then((response) => {
32 | return response
33 | .json()
34 | .then((data) => {
35 | setInitialData(data);
36 | })
37 | .catch((err) => {
38 | console.log(err);
39 | });
40 | });
41 | };
42 |
43 | useEffect(() => {
44 | if (deviceSelected == true) {
45 | fetchInitialData();
46 | } else {
47 | setSelectedDevice("");
48 | }
49 | }, [deviceSelected]);
50 |
51 | useEffect(() => {
52 | fetchDeviceIds();
53 | }, []);
54 |
55 | return (
56 |
57 | {!deviceSelected && (
58 | setSelectedDevice(e.target.value)}
61 | />
62 | )}
63 | {
65 | if (selectedDevice != "" && selectedDevice != undefined) {
66 | setdeviceSelected(!deviceSelected);
67 | }
68 | }}
69 | value={deviceSelected ? "Select another" : "View Location"}
70 | />
71 | {deviceSelected == true && initialData != undefined && (
72 |
73 | )}
74 |
75 | );
76 | }
77 |
78 | export default App;
79 |
--------------------------------------------------------------------------------
/mqtt-cli-fe/src/components/MapComponent.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useRef } from "react";
2 | import "leaflet/dist/leaflet.css";
3 | import L from "leaflet";
4 | import marker from "../res/marker2.png";
5 | import {
6 | CircleMarker,
7 | MapContainer,
8 | Marker,
9 | Polyline,
10 | Popup,
11 | TileLayer,
12 | } from "react-leaflet";
13 |
14 | export const MapComponent = (props) => {
15 | const { markers } = props;
16 |
17 | const myIcon = new L.Icon({
18 | iconUrl: marker,
19 | iconRetinaUrl: marker,
20 | popupAnchor: [-0, -0],
21 | iconSize: [48, 48],
22 | });
23 |
24 | const renderPositions = (positions) => {
25 | return (
26 | <>
27 |
28 | {positions.map((position, index) => (
29 |
36 |
37 | device: {position.deviceId}
38 | lat: {position.lat}
39 | lon: {position.lon}
40 |
41 |
42 | ))}
43 | >
44 | );
45 | };
46 |
47 | const putLastLocation = (markers) => {
48 | if (markers != undefined && markers.length != 0) {
49 | const location = markers[markers.length - 1];
50 | return (
51 | <>
52 |
57 |
58 | Current Location
59 |
60 |
61 | >
62 | );
63 | }
64 | };
65 |
66 | return (
67 |
68 |
74 |
78 | {renderPositions(markers)}
79 | {putLastLocation(markers)}
80 |
81 |
82 | );
83 | };
84 |
--------------------------------------------------------------------------------
/mqtt-cli-fe/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/mqtt-mobile/app/src/main/java/com/gucardev/mqttmobileclient/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.gucardev.mqttmobileclient
2 |
3 | import android.location.Location
4 | import android.os.Bundle
5 | import android.util.Log
6 | import androidx.appcompat.app.AppCompatActivity
7 | import com.gucardev.mqttmobileclient.databinding.ActivityMainBinding
8 |
9 | class MainActivity : AppCompatActivity() {
10 |
11 | private var _binding: ActivityMainBinding? = null
12 | private val binding get() = _binding!!
13 |
14 | private lateinit var mqttHandler: MqttHandler
15 |
16 | private lateinit var deviceId: String
17 | private var isConnected: Boolean = false
18 |
19 | private val locationPermissionManager = LocationPermissionManager(this)
20 | private lateinit var locationUpdater: LocationUpdater
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | _binding = ActivityMainBinding.inflate(layoutInflater)
25 | setContentView(binding.root)
26 | locationPermissionManager.requestLocationPermission()
27 |
28 | deviceId = "device1"
29 |
30 |
31 | binding.buttonSetDeviceId.setOnClickListener {
32 | deviceId = binding.deviceNameText.text.toString()
33 | Log.i("Info", "setDeviceId clicked, deviceId: $deviceId")
34 | }
35 |
36 | binding.buttonConnect.setOnClickListener {
37 |
38 | mqttHandler = MqttHandler(this, deviceId)
39 | mqttHandler.connect { isConnected ->
40 | this.isConnected = isConnected
41 | Log.i(
42 | "Info",
43 | "buttonConnect clicked, isConnected: $isConnected , deviceId: $deviceId"
44 | )
45 | }
46 | isConnected = mqttHandler.isConnected
47 | }
48 |
49 | binding.buttonSend.setOnClickListener {
50 | Log.i("Info", "btnSend clicked, isConnected: $isConnected")
51 | if (isConnected) {
52 | mqttHandler.sendMessage(deviceId, "myTopic", "hi from app!", "0.0", "0.0")
53 | }
54 | }
55 |
56 | locationUpdater = LocationUpdater(this) { location ->
57 | handleLocationChange(location)
58 | }
59 | locationUpdater.start()
60 |
61 |
62 | }
63 |
64 | private fun handleLocationChange(location: Location) {
65 | println(location)
66 | binding.locationText.text = "lat: ${location.latitude}, lon: ${location.longitude}"
67 | if (isConnected) {
68 | mqttHandler.sendMessage(
69 | deviceId,
70 | deviceId,
71 | "hi from app!",
72 | location.latitude.toString(),
73 | location.longitude.toString()
74 | )
75 | }
76 | }
77 |
78 | override fun onDestroy() {
79 | super.onDestroy()
80 | _binding = null
81 | }
82 |
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/mqtt-mobile/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/backend/src/main/java/com/gucardev/mqttpoc/config/MqttServerConfig.java:
--------------------------------------------------------------------------------
1 | package com.gucardev.mqttpoc.config;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 | import com.gucardev.mqttpoc.service.StateService;
5 | import com.gucardev.mqttpoc.service.impl.MqttMessageHandler;
6 | import lombok.RequiredArgsConstructor;
7 | import lombok.extern.slf4j.Slf4j;
8 | import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
9 | import org.springframework.beans.factory.annotation.Value;
10 | import org.springframework.context.annotation.Bean;
11 | import org.springframework.context.annotation.Configuration;
12 | import org.springframework.integration.annotation.ServiceActivator;
13 | import org.springframework.integration.channel.DirectChannel;
14 | import org.springframework.integration.core.MessageProducer;
15 | import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory;
16 | import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
17 | import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
18 | import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
19 | import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
20 | import org.springframework.messaging.MessageChannel;
21 | import org.springframework.messaging.MessageHandler;
22 |
23 | @Configuration
24 | @Slf4j
25 | @RequiredArgsConstructor
26 | public class MqttServerConfig {
27 |
28 | @Value("${mqqt-config.server-uri}")
29 | private String mqqtServerURI;
30 |
31 | @Bean
32 | public MqttPahoClientFactory mqttClientFactory() {
33 | DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
34 | MqttConnectOptions options = new MqttConnectOptions();
35 |
36 | options.setServerURIs(new String[] {mqqtServerURI});
37 | options.setUserName("admin");
38 | String pass = "12345678";
39 | options.setPassword(pass.toCharArray());
40 | options.setCleanSession(true);
41 |
42 | factory.setConnectionOptions(options);
43 |
44 | return factory;
45 | }
46 |
47 | @Bean
48 | public MessageChannel mqttInputChannel() {
49 | return new DirectChannel();
50 | }
51 |
52 | @Bean
53 | public MessageProducer inbound() {
54 | MqttPahoMessageDrivenChannelAdapter adapter =
55 | new MqttPahoMessageDrivenChannelAdapter("serverIn", mqttClientFactory(), "#");
56 |
57 | adapter.setCompletionTimeout(5000);
58 | adapter.setConverter(new DefaultPahoMessageConverter());
59 | adapter.setQos(2);
60 | adapter.setOutputChannel(mqttInputChannel());
61 | return adapter;
62 | }
63 |
64 | @Bean
65 | @ServiceActivator(inputChannel = "mqttInputChannel")
66 | public MessageHandler handler(StateService stateService, ObjectMapper mapper) {
67 | return new MqttMessageHandler(stateService, mapper);
68 | }
69 |
70 | @Bean
71 | public MessageChannel mqttOutboundChannel() {
72 | return new DirectChannel();
73 | }
74 |
75 | @Bean
76 | @ServiceActivator(inputChannel = "mqttOutboundChannel")
77 | public MessageHandler mqttOutbound() {
78 | // clientId is generated using a random number
79 | MqttPahoMessageHandler messageHandler =
80 | new MqttPahoMessageHandler("serverOut", mqttClientFactory());
81 | messageHandler.setAsync(true);
82 | messageHandler.setDefaultTopic("#");
83 | messageHandler.setDefaultRetained(false);
84 | return messageHandler;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/mqtt-mobile/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
45 |
46 |
55 |
56 |
65 |
66 |
75 |
76 |
--------------------------------------------------------------------------------
/doc.txt:
--------------------------------------------------------------------------------
1 | #broker.conf
2 | listener 1883
3 | password_file passFile
4 | allow_anonymous false
5 |
6 | #passFile
7 | admin:password
8 |
9 | mosquitto -v -c broker.conf
10 |
11 | mosquitto_passwd -U passFile
12 |
13 | mosquitto_sub -t myTopic -u admin -P 12345678
14 |
15 | mosquitto_pub -t myTopic -m "hello world!" -u admin -P 12345678
16 |
17 | mosquitto_pub -t myTopic -m "{\"deviceId\":\"device1\",\"lat\":\"41.63322\",\"lon\":\"26.62385\",\"message\":\"hifromapp!\",\"topic\":\"myTopic\"}" -u admin -P 12345678
18 |
19 | mosquitto_pub -t myTopic -m "{\"message\":\"Hello,MQTTfromclient!\",\"topic\":\"myTopic\"}" -u admin -P 12345678
20 |
21 |
22 | docker-compose -f docker-compose.yml up --build -d #run docker file
23 |
24 |
25 |
26 | QoS (Quality of Service):
27 | - QoS 0: At most once delivery - the message may not be delivered at all, or may be delivered more than once.
28 |
29 | - QoS 1: At least once delivery - the message will be delivered at least once, but may be delivered more than once in some cases.
30 |
31 | - QoS 2: Exactly once delivery - the message will be delivered exactly once, and there will be no duplicates. This level of QoS provides the highest level of reliability, but also requires the most overhead.
32 |
33 |
34 |
35 | mvn clean install -DskipTests
36 | mvn clean package -DskipTests
37 | docker-compose build --no-cache
38 | docker-compose up --force-recreate
39 |
40 | sudo docker-compose up
41 |
42 |
43 | redis-cli flushall
44 |
45 | docker-compose up -d --no-deps --build
46 |
47 | docker rmi $(docker images -q)
48 |
49 | docker stop $(docker ps -qa)
50 |
51 | find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
52 |
53 |
54 | docker logs --tail=50
55 |
56 | sudo service docker start
57 |
58 | npm install -D react-scripts
59 |
60 |
61 | ssh-keygen -t ed25519 -C "your_email@example.com"
62 | eval "$(ssh-agent -s)"
63 | ssh-add ~/.ssh/id_ed25519
64 |
65 | git config remote.origin.url "https://github.com/gurkanucar/mqtt-example.git"
66 | git remote set-url origin git@github.com:gurkanucar/mqtt-example.git
67 |
68 | cat ~/.ssh/id_ed25519.pub | pbcopy
69 |
70 | aws installitions:
71 |
72 | sudo amazon-linux-extras install epel -y
73 | sudo yum install xclip -y
74 |
75 | sudo yum install git -y
76 |
77 | sudo amazon-linux-extras install docker
78 | sudo service docker start
79 | sudo systemctl start docker
80 | sudo service docker status
81 | sudo groupadd docker
82 | sudo usermod -a -G docker ec2-user
83 | newgrp docker
84 | docker --version
85 |
86 | sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
87 |
88 | sudo chmod +x /usr/local/bin/docker-compose
89 | sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
90 | docker-compose --version
91 |
92 | sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
93 | sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
94 | sudo yum install -y apache-maven
95 | mvn --version
96 |
97 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
98 | . ~/.nvm/nvm.sh
99 | nvm install 16.15.1
100 |
101 | df -h
102 |
103 |
104 | docker system prune -a --volumes
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/mqtt-mobile/app/src/main/java/com/gucardev/mqttmobileclient/MqttHandler.kt:
--------------------------------------------------------------------------------
1 | package com.gucardev.mqttmobileclient
2 |
3 | import android.content.Context
4 | import android.util.Log
5 | import com.google.gson.Gson
6 | import org.eclipse.paho.android.service.MqttAndroidClient
7 | import org.eclipse.paho.client.mqttv3.*
8 |
9 | class MqttHandler(context: Context, private var clientId: String) {
10 | var isConnected: Boolean = false
11 |
12 | private var mqttClient: MqttAndroidClient? = null
13 |
14 | init {
15 | val serverURI = "tcp://192.168.0.27:1883"
16 | mqttClient = MqttAndroidClient(context, serverURI, clientId)
17 | }
18 |
19 | fun connect(callback: (Boolean) -> Unit) {
20 | mqttClient?.setCallback(object : MqttCallback {
21 | override fun messageArrived(topic: String?, message: MqttMessage?) {
22 | Log.i("Info", "Receive message: ${message.toString()} from topic: $topic")
23 | }
24 |
25 | override fun connectionLost(cause: Throwable?) {
26 | Log.i("Info", "Connection lost ${cause.toString()}")
27 | }
28 |
29 | override fun deliveryComplete(token: IMqttDeliveryToken?) {
30 |
31 | }
32 | })
33 | val options = MqttConnectOptions()
34 | options.userName = "admin"
35 | options.password = "12345678".toCharArray()
36 | try {
37 | mqttClient?.connect(options, null, object : IMqttActionListener {
38 | override fun onSuccess(asyncActionToken: IMqttToken?) {
39 | Log.i("Info", "Connection success")
40 | subscribeToTopic()
41 | isConnected = true
42 | callback(true)
43 | }
44 |
45 | override fun onFailure(asyncActionToken: IMqttToken?, exception: Throwable?) {
46 | Log.i("Info", "Connection failure")
47 | callback(false)
48 | }
49 | })
50 | } catch (e: MqttException) {
51 | e.printStackTrace()
52 | }
53 | }
54 |
55 | fun sendMessage(
56 | deviceName: String,
57 | topic: String,
58 | message: String,
59 | lat: String,
60 | lon: String
61 | ) {
62 | val gson = Gson()
63 | val message = gson.toJson(StateData(deviceName, topic, message, lat, lon))
64 | val qos = 1
65 | val retained = false
66 | Log.i("Info", "message sent ${message}")
67 | mqttClient?.publish(topic, message.toByteArray(), qos, retained)
68 | }
69 |
70 | private fun subscribeToTopic() {
71 | try {
72 | //must be same size topics and qos
73 | val topics = arrayOf("myTopic", this.clientId)
74 | val qos = intArrayOf(1, 1)
75 | mqttClient?.subscribe(topics, qos, null, object : IMqttActionListener {
76 | override fun onSuccess(asyncActionToken: IMqttToken?) {
77 | Log.i("Info", "Subscribed to multiple topics successfully")
78 | }
79 |
80 | override fun onFailure(asyncActionToken: IMqttToken?, exception: Throwable?) {
81 | Log.i("Info", "Failed to subscribe to multiple topics $exception")
82 | }
83 | })
84 | } catch (ex: MqttException) {
85 | ex.printStackTrace()
86 | } catch (ex: IllegalArgumentException) {
87 | ex.printStackTrace()
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/mqtt-cli-fe/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39 |
40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/backend/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.springframework.boot
8 | spring-boot-starter-parent
9 | 3.0.2
10 |
11 |
12 | com.gucardev
13 | mqtt-poc
14 | 0.0.1-SNAPSHOT
15 | mqtt-poc
16 | mqtt-poc
17 |
18 | 17
19 |
20 |
21 |
22 | org.springframework.boot
23 | spring-boot-starter-data-jpa
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-validation
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-starter-web
32 |
33 |
34 |
35 | org.springframework.integration
36 | spring-integration-mqtt
37 | 5.5.2
38 |
39 |
40 | com.google.code.gson
41 | gson
42 |
43 |
44 | com.h2database
45 | h2
46 | runtime
47 |
48 |
49 | org.projectlombok
50 | lombok
51 | true
52 |
53 |
54 | org.modelmapper
55 | modelmapper
56 | 2.4.4
57 |
58 |
59 | org.springframework.boot
60 | spring-boot-starter-test
61 | test
62 |
63 |
64 | org.springframework.boot
65 | spring-boot-starter-data-redis
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | org.apache.maven.plugins
83 | maven-surefire-plugin
84 | 2.22.2
85 |
86 | true
87 |
88 |
89 |
90 | org.springframework.boot
91 | spring-boot-maven-plugin
92 |
93 |
94 |
95 | org.projectlombok
96 | lombok
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
35 |
36 | # Logs
37 | logs
38 | *.log
39 | npm-debug.log*
40 | yarn-debug.log*
41 | yarn-error.log*
42 | lerna-debug.log*
43 | .pnpm-debug.log*
44 |
45 | # Exclude mosquitto.log from logs
46 | !/mosquitto/log/mosquitto.log
47 |
48 | # Diagnostic reports (https://nodejs.org/api/report.html)
49 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
50 |
51 | # Runtime data
52 | pids
53 | *.pid
54 | *.seed
55 | *.pid.lock
56 |
57 | # Directory for instrumented libs generated by jscoverage/JSCover
58 | lib-cov
59 |
60 | # Coverage directory used by tools like istanbul
61 | coverage
62 | *.lcov
63 |
64 | # nyc test coverage
65 | .nyc_output
66 |
67 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
68 | .grunt
69 |
70 | # Bower dependency directory (https://bower.io/)
71 | bower_components
72 |
73 | # node-waf configuration
74 | .lock-wscript
75 |
76 | # Compiled binary addons (https://nodejs.org/api/addons.html)
77 | build/Release
78 |
79 | # Dependency directories
80 | node_modules/
81 | jspm_packages/
82 |
83 | # Snowpack dependency directory (https://snowpack.dev/)
84 | web_modules/
85 |
86 | # TypeScript cache
87 | *.tsbuildinfo
88 |
89 | # Optional npm cache directory
90 | .npm
91 |
92 | # Optional eslint cache
93 | .eslintcache
94 |
95 | # Optional stylelint cache
96 | .stylelintcache
97 |
98 | # Microbundle cache
99 | .rpt2_cache/
100 | .rts2_cache_cjs/
101 | .rts2_cache_es/
102 | .rts2_cache_umd/
103 |
104 | # Optional REPL history
105 | .node_repl_history
106 |
107 | # Output of 'npm pack'
108 | *.tgz
109 |
110 | # Yarn Integrity file
111 | .yarn-integrity
112 |
113 | # dotenv environment variable files
114 | .env
115 | .env.development.local
116 | .env.test.local
117 | .env.production.local
118 | .env.local
119 |
120 | # parcel-bundler cache (https://parceljs.org/)
121 | .cache
122 | .parcel-cache
123 |
124 | # Next.js build output
125 | .next
126 | out
127 |
128 | # Nuxt.js build / generate output
129 | .nuxt
130 | dist
131 |
132 | # Gatsby files
133 | .cache/
134 | # Comment in the public line in if your project uses Gatsby and not Next.js
135 | # https://nextjs.org/blog/next-9-1#public-directory-support
136 | # public
137 |
138 | # vuepress build output
139 | .vuepress/dist
140 |
141 | # vuepress v2.x temp and cache directory
142 | .temp
143 | .cache
144 |
145 | # Docusaurus cache and generated files
146 | .docusaurus
147 |
148 | # Serverless directories
149 | .serverless/
150 |
151 | # FuseBox cache
152 | .fusebox/
153 |
154 | # DynamoDB Local files
155 | .dynamodb/
156 |
157 | # TernJS port file
158 | .tern-port
159 |
160 | # Stores VSCode versions used for testing VSCode extensions
161 | .vscode-test
162 |
163 | # yarn v2
164 | .yarn/cache
165 | .yarn/unplugged
166 | .yarn/build-state.yml
167 | .yarn/install-state.gz
168 | .pnp.*
169 |
170 |
171 |
172 | # Gradle files
173 | .gradle/
174 | build/
175 |
176 | # Local configuration file (sdk path, etc)
177 | local.properties
178 |
179 | # Log/OS Files
180 | *.log
181 |
182 | # Android Studio generated files and folders
183 | captures/
184 | .externalNativeBuild/
185 | .cxx/
186 | *.apk
187 | output.json
188 |
189 | # IntelliJ
190 | *.iml
191 | .idea/
192 | misc.xml
193 | deploymentTargetDropDown.xml
194 | render.experimental.xml
195 |
196 | # Keystore files
197 | *.jks
198 | *.keystore
199 |
200 | # Google Services (e.g. APIs or Firebase)
201 | google-services.json
202 |
203 | # Android Profiling
204 | *.hprof
205 |
206 |
207 |
--------------------------------------------------------------------------------
/mqtt-mobile/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/mqtt-mobile/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # 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, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/backend/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
124 |
125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127 | )
128 |
129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131 | if exist %WRAPPER_JAR% (
132 | if "%MVNW_VERBOSE%" == "true" (
133 | echo Found %WRAPPER_JAR%
134 | )
135 | ) else (
136 | if not "%MVNW_REPOURL%" == "" (
137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
138 | )
139 | if "%MVNW_VERBOSE%" == "true" (
140 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
141 | echo Downloading from: %DOWNLOAD_URL%
142 | )
143 |
144 | powershell -Command "&{"^
145 | "$webclient = new-object System.Net.WebClient;"^
146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148 | "}"^
149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150 | "}"
151 | if "%MVNW_VERBOSE%" == "true" (
152 | echo Finished downloading %WRAPPER_JAR%
153 | )
154 | )
155 | @REM End of extension
156 |
157 | @REM Provide a "standardized" way to retrieve the CLI args that will
158 | @REM work with both Windows and non-Windows executions.
159 | set MAVEN_CMD_LINE_ARGS=%*
160 |
161 | %MAVEN_JAVA_EXE% ^
162 | %JVM_CONFIG_MAVEN_PROPS% ^
163 | %MAVEN_OPTS% ^
164 | %MAVEN_DEBUG_OPTS% ^
165 | -classpath %WRAPPER_JAR% ^
166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
168 | if ERRORLEVEL 1 goto error
169 | goto end
170 |
171 | :error
172 | set ERROR_CODE=1
173 |
174 | :end
175 | @endlocal & set ERROR_CODE=%ERROR_CODE%
176 |
177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
181 | :skipRcPost
182 |
183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause
185 |
186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
187 |
188 | cmd /C exit /B %ERROR_CODE%
189 |
--------------------------------------------------------------------------------
/mqtt-cli-fe/src/res/exampleData.js:
--------------------------------------------------------------------------------
1 | export const exampleData = [
2 | {
3 | id: 1,
4 | deviceId: "device1",
5 | topic: "myTopic",
6 | message: "hi from app!",
7 | lat: "41.63322",
8 | lon: "26.62385",
9 | },
10 | {
11 | id: 3,
12 | deviceId: "device1",
13 | topic: "myTopic",
14 | message: "hi from app!",
15 | lat: "41.66938833333333",
16 | lon: "26.57602",
17 | },
18 | {
19 | id: 4,
20 | deviceId: "device1",
21 | topic: "myTopic",
22 | message: "hi from app!",
23 | lat: "41.669383333333336",
24 | lon: "26.575875",
25 | },
26 | {
27 | id: 5,
28 | deviceId: "device1",
29 | topic: "myTopic",
30 | message: "hi from app!",
31 | lat: "41.66938",
32 | lon: "26.57574",
33 | },
34 | {
35 | id: 6,
36 | deviceId: "device1",
37 | topic: "myTopic",
38 | message: "hi from app!",
39 | lat: "41.66935333333333",
40 | lon: "26.575616666666665",
41 | },
42 | {
43 | id: 7,
44 | deviceId: "device1",
45 | topic: "myTopic",
46 | message: "hi from app!",
47 | lat: "41.66934",
48 | lon: "26.57541",
49 | },
50 | {
51 | id: 8,
52 | deviceId: "device1",
53 | topic: "myTopic",
54 | message: "hi from app!",
55 | lat: "41.6693",
56 | lon: "26.57529",
57 | },
58 | {
59 | id: 9,
60 | deviceId: "device1",
61 | topic: "myTopic",
62 | message: "hi from app!",
63 | lat: "41.66923833333333",
64 | lon: "26.57527",
65 | },
66 | {
67 | id: 10,
68 | deviceId: "device1",
69 | topic: "myTopic",
70 | message: "hi from app!",
71 | lat: "41.669105",
72 | lon: "26.57527",
73 | },
74 | {
75 | id: 11,
76 | deviceId: "device1",
77 | topic: "myTopic",
78 | message: "hi from app!",
79 | lat: "41.669093333333336",
80 | lon: "26.57554",
81 | },
82 | {
83 | id: 12,
84 | deviceId: "device1",
85 | topic: "myTopic",
86 | message: "hi from app!",
87 | lat: "41.66906",
88 | lon: "26.57626",
89 | },
90 | {
91 | id: 13,
92 | deviceId: "device1",
93 | topic: "myTopic",
94 | message: "hi from app!",
95 | lat: "41.66865",
96 | lon: "26.57602",
97 | },
98 | {
99 | id: 14,
100 | deviceId: "device1",
101 | topic: "myTopic",
102 | message: "hi from app!",
103 | lat: "41.66817",
104 | lon: "26.57601",
105 | },
106 | {
107 | id: 15,
108 | deviceId: "device1",
109 | topic: "myTopic",
110 | message: "hi from app!",
111 | lat: "41.66794",
112 | lon: "26.57605",
113 | },
114 | {
115 | id: 16,
116 | deviceId: "device1",
117 | topic: "myTopic",
118 | message: "hi from app!",
119 | lat: "41.66752",
120 | lon: "26.575708333333335",
121 | },
122 | {
123 | id: 17,
124 | deviceId: "device1",
125 | topic: "myTopic",
126 | message: "hi from app!",
127 | lat: "41.66749",
128 | lon: "26.57545",
129 | },
130 | {
131 | id: 18,
132 | deviceId: "device1",
133 | topic: "myTopic",
134 | message: "hi from app!",
135 | lat: "41.667433333333335",
136 | lon: "26.57504",
137 | },
138 | {
139 | id: 19,
140 | deviceId: "device1",
141 | topic: "myTopic",
142 | message: "hi from app!",
143 | lat: "41.66735",
144 | lon: "26.57438",
145 | },
146 | {
147 | id: 20,
148 | deviceId: "device1",
149 | topic: "myTopic",
150 | message: "hi from app!",
151 | lat: "41.6673",
152 | lon: "26.57398",
153 | },
154 | {
155 | id: 22,
156 | deviceId: "device1",
157 | topic: "myTopic",
158 | message: "hi from app!",
159 | lat: "41.67719",
160 | lon: "26.55571",
161 | },
162 | {
163 | id: 23,
164 | deviceId: "device1",
165 | topic: "myTopic",
166 | message: "hi from app!",
167 | lat: "41.67707",
168 | lon: "26.55549",
169 | },
170 | {
171 | id: 24,
172 | deviceId: "device1",
173 | topic: "myTopic",
174 | message: "hi from app!",
175 | lat: "41.677",
176 | lon: "26.55577",
177 | },
178 | {
179 | id: 25,
180 | deviceId: "device1",
181 | topic: "myTopic",
182 | message: "hi from app!",
183 | lat: "41.676815",
184 | lon: "26.556088333333335",
185 | },
186 | {
187 | id: 26,
188 | deviceId: "device1",
189 | topic: "myTopic",
190 | message: "hi from app!",
191 | lat: "41.676678333333335",
192 | lon: "26.556251666666668",
193 | },
194 | {
195 | id: 27,
196 | deviceId: "device1",
197 | topic: "myTopic",
198 | message: "hi from app!",
199 | lat: "41.67638",
200 | lon: "26.55662",
201 | },
202 | {
203 | id: 28,
204 | deviceId: "device1",
205 | topic: "myTopic",
206 | message: "hi from app!",
207 | lat: "41.67669",
208 | lon: "26.55757",
209 | },
210 | {
211 | id: 29,
212 | deviceId: "device1",
213 | topic: "myTopic",
214 | message: "hi from app!",
215 | lat: "41.67692",
216 | lon: "26.55841",
217 | },
218 | {
219 | id: 30,
220 | deviceId: "device1",
221 | topic: "myTopic",
222 | message: "hi from app!",
223 | lat: "41.67704",
224 | lon: "26.55936",
225 | },
226 | {
227 | id: 31,
228 | deviceId: "device1",
229 | topic: "myTopic",
230 | message: "hi from app!",
231 | lat: "41.67706",
232 | lon: "26.56019",
233 | },
234 | {
235 | id: 32,
236 | deviceId: "device1",
237 | topic: "myTopic",
238 | message: "hi from app!",
239 | lat: "41.67705",
240 | lon: "26.56119",
241 | },
242 | {
243 | id: 33,
244 | deviceId: "device1",
245 | topic: "myTopic",
246 | message: "hi from app!",
247 | lat: "41.67697",
248 | lon: "26.56202",
249 | },
250 | {
251 | id: 34,
252 | deviceId: "device1",
253 | topic: "myTopic",
254 | message: "hi from app!",
255 | lat: "41.67677",
256 | lon: "26.56271",
257 | },
258 | {
259 | id: 35,
260 | deviceId: "device1",
261 | topic: "myTopic",
262 | message: "hi from app!",
263 | lat: "41.67684",
264 | lon: "26.56362",
265 | },
266 | {
267 | id: 36,
268 | deviceId: "device1",
269 | topic: "myTopic",
270 | message: "hi from app!",
271 | lat: "41.67704",
272 | lon: "26.5644",
273 | },
274 | {
275 | id: 37,
276 | deviceId: "device1",
277 | topic: "myTopic",
278 | message: "hi from app!",
279 | lat: "41.67732",
280 | lon: "26.56516",
281 | },
282 | {
283 | id: 38,
284 | deviceId: "device1",
285 | topic: "myTopic",
286 | message: "hi from app!",
287 | lat: "41.67749",
288 | lon: "26.56572",
289 | },
290 | {
291 | id: 39,
292 | deviceId: "device1",
293 | topic: "myTopic",
294 | message: "hi from app!",
295 | lat: "41.677835",
296 | lon: "26.56693",
297 | },
298 | {
299 | id: 40,
300 | deviceId: "device1",
301 | topic: "myTopic",
302 | message: "hi from app!",
303 | lat: "41.67811",
304 | lon: "26.56768",
305 | },
306 | {
307 | id: 41,
308 | deviceId: "device1",
309 | topic: "myTopic",
310 | message: "hi from app!",
311 | lat: "41.67836",
312 | lon: "26.56859",
313 | },
314 | {
315 | id: 42,
316 | deviceId: "device1",
317 | topic: "myTopic",
318 | message: "hi from app!",
319 | lat: "41.67854",
320 | lon: "26.56952",
321 | },
322 | {
323 | id: 43,
324 | deviceId: "device1",
325 | topic: "myTopic",
326 | message: "hi from app!",
327 | lat: "41.67865833333333",
328 | lon: "26.570551666666667",
329 | },
330 | {
331 | id: 44,
332 | deviceId: "device1",
333 | topic: "myTopic",
334 | message: "hi from app!",
335 | lat: "41.67873",
336 | lon: "26.57144",
337 | },
338 | {
339 | id: 45,
340 | deviceId: "device1",
341 | topic: "myTopic",
342 | message: "hi from app!",
343 | lat: "41.67875",
344 | lon: "26.57189",
345 | },
346 | {
347 | id: 46,
348 | deviceId: "device1",
349 | topic: "myTopic",
350 | message: "hi from app!",
351 | lat: "41.67889",
352 | lon: "26.57314",
353 | },
354 | {
355 | id: 47,
356 | deviceId: "device1",
357 | topic: "myTopic",
358 | message: "hi from app!",
359 | lat: "41.67892",
360 | lon: "26.57397",
361 | },
362 | {
363 | id: 48,
364 | deviceId: "device1",
365 | topic: "myTopic",
366 | message: "hi from app!",
367 | lat: "41.67892",
368 | lon: "26.57486",
369 | },
370 | {
371 | id: 49,
372 | deviceId: "device1",
373 | topic: "myTopic",
374 | message: "hi from app!",
375 | lat: "41.67893",
376 | lon: "26.57565",
377 | },
378 | {
379 | id: 50,
380 | deviceId: "device1",
381 | topic: "myTopic",
382 | message: "hi from app!",
383 | lat: "41.678960000000004",
384 | lon: "26.57649",
385 | },
386 | {
387 | id: 51,
388 | deviceId: "device1",
389 | topic: "myTopic",
390 | message: "hi from app!",
391 | lat: "41.67911",
392 | lon: "26.57742",
393 | },
394 | {
395 | id: 52,
396 | deviceId: "device1",
397 | topic: "myTopic",
398 | message: "hi from app!",
399 | lat: "41.67939",
400 | lon: "26.57813",
401 | },
402 | {
403 | id: 53,
404 | deviceId: "device1",
405 | topic: "myTopic",
406 | message: "hi from app!",
407 | lat: "41.6797",
408 | lon: "26.57911",
409 | },
410 | {
411 | id: 54,
412 | deviceId: "device1",
413 | topic: "myTopic",
414 | message: "hi from app!",
415 | lat: "41.67996",
416 | lon: "26.57986",
417 | },
418 | {
419 | id: 55,
420 | deviceId: "device1",
421 | topic: "myTopic",
422 | message: "hi from app!",
423 | lat: "41.68044",
424 | lon: "26.58076",
425 | },
426 | {
427 | id: 56,
428 | deviceId: "device1",
429 | topic: "myTopic",
430 | message: "hi from app!",
431 | lat: "41.68061",
432 | lon: "26.58127",
433 | },
434 | {
435 | id: 57,
436 | deviceId: "device1",
437 | topic: "myTopic",
438 | message: "hi from app!",
439 | lat: "41.68092",
440 | lon: "26.58165",
441 | },
442 | {
443 | id: 58,
444 | deviceId: "device1",
445 | topic: "myTopic",
446 | message: "hi from app!",
447 | lat: "41.68127",
448 | lon: "26.58231",
449 | },
450 | {
451 | id: 59,
452 | deviceId: "device1",
453 | topic: "myTopic",
454 | message: "hi from app!",
455 | lat: "41.68174166666667",
456 | lon: "26.583141666666666",
457 | },
458 | {
459 | id: 60,
460 | deviceId: "device1",
461 | topic: "myTopic",
462 | message: "hi from app!",
463 | lat: "41.68216",
464 | lon: "26.58391",
465 | },
466 | {
467 | id: 61,
468 | deviceId: "device1",
469 | topic: "myTopic",
470 | message: "hi from app!",
471 | lat: "41.68254",
472 | lon: "26.58449",
473 | },
474 | {
475 | id: 62,
476 | deviceId: "device1",
477 | topic: "myTopic",
478 | message: "hi from app!",
479 | lat: "41.68306833333333",
480 | lon: "26.58503",
481 | },
482 | {
483 | id: 63,
484 | deviceId: "device1",
485 | topic: "myTopic",
486 | message: "hi from app!",
487 | lat: "41.6837",
488 | lon: "26.58575",
489 | },
490 | {
491 | id: 64,
492 | deviceId: "device1",
493 | topic: "myTopic",
494 | message: "hi from app!",
495 | lat: "41.68423",
496 | lon: "26.58635",
497 | },
498 | {
499 | id: 65,
500 | deviceId: "device1",
501 | topic: "myTopic",
502 | message: "hi from app!",
503 | lat: "41.68476",
504 | lon: "26.58686",
505 | },
506 | ];
507 |
--------------------------------------------------------------------------------
/backend/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /usr/local/etc/mavenrc ] ; then
40 | . /usr/local/etc/mavenrc
41 | fi
42 |
43 | if [ -f /etc/mavenrc ] ; then
44 | . /etc/mavenrc
45 | fi
46 |
47 | if [ -f "$HOME/.mavenrc" ] ; then
48 | . "$HOME/.mavenrc"
49 | fi
50 |
51 | fi
52 |
53 | # OS specific support. $var _must_ be set to either true or false.
54 | cygwin=false;
55 | darwin=false;
56 | mingw=false
57 | case "`uname`" in
58 | CYGWIN*) cygwin=true ;;
59 | MINGW*) mingw=true;;
60 | Darwin*) darwin=true
61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
63 | if [ -z "$JAVA_HOME" ]; then
64 | if [ -x "/usr/libexec/java_home" ]; then
65 | export JAVA_HOME="`/usr/libexec/java_home`"
66 | else
67 | export JAVA_HOME="/Library/Java/Home"
68 | fi
69 | fi
70 | ;;
71 | esac
72 |
73 | if [ -z "$JAVA_HOME" ] ; then
74 | if [ -r /etc/gentoo-release ] ; then
75 | JAVA_HOME=`java-config --jre-home`
76 | fi
77 | fi
78 |
79 | if [ -z "$M2_HOME" ] ; then
80 | ## resolve links - $0 may be a link to maven's home
81 | PRG="$0"
82 |
83 | # need this for relative symlinks
84 | while [ -h "$PRG" ] ; do
85 | ls=`ls -ld "$PRG"`
86 | link=`expr "$ls" : '.*-> \(.*\)$'`
87 | if expr "$link" : '/.*' > /dev/null; then
88 | PRG="$link"
89 | else
90 | PRG="`dirname "$PRG"`/$link"
91 | fi
92 | done
93 |
94 | saveddir=`pwd`
95 |
96 | M2_HOME=`dirname "$PRG"`/..
97 |
98 | # make it fully qualified
99 | M2_HOME=`cd "$M2_HOME" && pwd`
100 |
101 | cd "$saveddir"
102 | # echo Using m2 at $M2_HOME
103 | fi
104 |
105 | # For Cygwin, ensure paths are in UNIX format before anything is touched
106 | if $cygwin ; then
107 | [ -n "$M2_HOME" ] &&
108 | M2_HOME=`cygpath --unix "$M2_HOME"`
109 | [ -n "$JAVA_HOME" ] &&
110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
111 | [ -n "$CLASSPATH" ] &&
112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
113 | fi
114 |
115 | # For Mingw, ensure paths are in UNIX format before anything is touched
116 | if $mingw ; then
117 | [ -n "$M2_HOME" ] &&
118 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
119 | [ -n "$JAVA_HOME" ] &&
120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
121 | fi
122 |
123 | if [ -z "$JAVA_HOME" ]; then
124 | javaExecutable="`which javac`"
125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
126 | # readlink(1) is not available as standard on Solaris 10.
127 | readLink=`which readlink`
128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
129 | if $darwin ; then
130 | javaHome="`dirname \"$javaExecutable\"`"
131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
132 | else
133 | javaExecutable="`readlink -f \"$javaExecutable\"`"
134 | fi
135 | javaHome="`dirname \"$javaExecutable\"`"
136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
137 | JAVA_HOME="$javaHome"
138 | export JAVA_HOME
139 | fi
140 | fi
141 | fi
142 |
143 | if [ -z "$JAVACMD" ] ; then
144 | if [ -n "$JAVA_HOME" ] ; then
145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
146 | # IBM's JDK on AIX uses strange locations for the executables
147 | JAVACMD="$JAVA_HOME/jre/sh/java"
148 | else
149 | JAVACMD="$JAVA_HOME/bin/java"
150 | fi
151 | else
152 | JAVACMD="`\\unset -f command; \\command -v java`"
153 | fi
154 | fi
155 |
156 | if [ ! -x "$JAVACMD" ] ; then
157 | echo "Error: JAVA_HOME is not defined correctly." >&2
158 | echo " We cannot execute $JAVACMD" >&2
159 | exit 1
160 | fi
161 |
162 | if [ -z "$JAVA_HOME" ] ; then
163 | echo "Warning: JAVA_HOME environment variable is not set."
164 | fi
165 |
166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
167 |
168 | # traverses directory structure from process work directory to filesystem root
169 | # first directory with .mvn subdirectory is considered project base directory
170 | find_maven_basedir() {
171 |
172 | if [ -z "$1" ]
173 | then
174 | echo "Path not specified to find_maven_basedir"
175 | return 1
176 | fi
177 |
178 | basedir="$1"
179 | wdir="$1"
180 | while [ "$wdir" != '/' ] ; do
181 | if [ -d "$wdir"/.mvn ] ; then
182 | basedir=$wdir
183 | break
184 | fi
185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
186 | if [ -d "${wdir}" ]; then
187 | wdir=`cd "$wdir/.."; pwd`
188 | fi
189 | # end of workaround
190 | done
191 | echo "${basedir}"
192 | }
193 |
194 | # concatenates all lines of a file
195 | concat_lines() {
196 | if [ -f "$1" ]; then
197 | echo "$(tr -s '\n' ' ' < "$1")"
198 | fi
199 | }
200 |
201 | BASE_DIR=`find_maven_basedir "$(pwd)"`
202 | if [ -z "$BASE_DIR" ]; then
203 | exit 1;
204 | fi
205 |
206 | ##########################################################################################
207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
208 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
209 | ##########################################################################################
210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
211 | if [ "$MVNW_VERBOSE" = true ]; then
212 | echo "Found .mvn/wrapper/maven-wrapper.jar"
213 | fi
214 | else
215 | if [ "$MVNW_VERBOSE" = true ]; then
216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
217 | fi
218 | if [ -n "$MVNW_REPOURL" ]; then
219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
220 | else
221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
222 | fi
223 | while IFS="=" read key value; do
224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
225 | esac
226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
227 | if [ "$MVNW_VERBOSE" = true ]; then
228 | echo "Downloading from: $jarUrl"
229 | fi
230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
231 | if $cygwin; then
232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
233 | fi
234 |
235 | if command -v wget > /dev/null; then
236 | if [ "$MVNW_VERBOSE" = true ]; then
237 | echo "Found wget ... using wget"
238 | fi
239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
241 | else
242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
243 | fi
244 | elif command -v curl > /dev/null; then
245 | if [ "$MVNW_VERBOSE" = true ]; then
246 | echo "Found curl ... using curl"
247 | fi
248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
249 | curl -o "$wrapperJarPath" "$jarUrl" -f
250 | else
251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
252 | fi
253 |
254 | else
255 | if [ "$MVNW_VERBOSE" = true ]; then
256 | echo "Falling back to using Java to download"
257 | fi
258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
259 | # For Cygwin, switch paths to Windows format before running javac
260 | if $cygwin; then
261 | javaClass=`cygpath --path --windows "$javaClass"`
262 | fi
263 | if [ -e "$javaClass" ]; then
264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
265 | if [ "$MVNW_VERBOSE" = true ]; then
266 | echo " - Compiling MavenWrapperDownloader.java ..."
267 | fi
268 | # Compiling the Java class
269 | ("$JAVA_HOME/bin/javac" "$javaClass")
270 | fi
271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
272 | # Running the downloader
273 | if [ "$MVNW_VERBOSE" = true ]; then
274 | echo " - Running MavenWrapperDownloader.java ..."
275 | fi
276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
277 | fi
278 | fi
279 | fi
280 | fi
281 | ##########################################################################################
282 | # End of extension
283 | ##########################################################################################
284 |
285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
286 | if [ "$MVNW_VERBOSE" = true ]; then
287 | echo $MAVEN_PROJECTBASEDIR
288 | fi
289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
290 |
291 | # For Cygwin, switch paths to Windows format before running java
292 | if $cygwin; then
293 | [ -n "$M2_HOME" ] &&
294 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
295 | [ -n "$JAVA_HOME" ] &&
296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
297 | [ -n "$CLASSPATH" ] &&
298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
299 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
301 | fi
302 |
303 | # Provide a "standardized" way to retrieve the CLI args that will
304 | # work with both Windows and non-Windows executions.
305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
306 | export MAVEN_CMD_LINE_ARGS
307 |
308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
309 |
310 | exec "$JAVACMD" \
311 | $MAVEN_OPTS \
312 | $MAVEN_DEBUG_OPTS \
313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
314 | "-Dmaven.home=${M2_HOME}" \
315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
317 |
--------------------------------------------------------------------------------