├── src ├── main │ ├── resources │ │ ├── .babelrc │ │ ├── app │ │ │ ├── config.js │ │ │ ├── home │ │ │ │ ├── home.controller.js │ │ │ │ ├── result │ │ │ │ │ ├── index.js │ │ │ │ │ ├── result.html │ │ │ │ │ └── result.controller.js │ │ │ │ ├── upload │ │ │ │ │ ├── upload.controller.js │ │ │ │ │ ├── upload.html │ │ │ │ │ ├── upload.service.js │ │ │ │ │ └── index.js │ │ │ │ ├── view │ │ │ │ │ ├── index.js │ │ │ │ │ ├── view.controller.js │ │ │ │ │ └── view.html │ │ │ │ ├── index.js │ │ │ │ └── home.routes.js │ │ │ ├── css │ │ │ │ └── custom.css │ │ │ ├── index.js │ │ │ └── index.html │ │ ├── application.properties │ │ ├── banner.txt │ │ ├── package.json │ │ └── webpack.config.js │ └── java │ │ └── schultz │ │ └── dustin │ │ └── io │ │ ├── services │ │ ├── VideoDecoderService.java │ │ ├── GifEncoderService.java │ │ └── ConverterService.java │ │ ├── JustGifItApplication.java │ │ └── controller │ │ └── UploadController.java └── test │ └── java │ └── schultz │ └── dustin │ └── io │ └── JustGifItTests.java ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .gitattributes ├── README.md ├── pom.xml ├── mvnw.cmd └── mvnw /src/main/resources/.babelrc: -------------------------------------------------------------------------------- 1 | { "presets": ["es2015"] } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .DS_Store 3 | .idea 4 | *.iml 5 | node_modules 6 | public 7 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dustinschultz/just-gif-it/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java linguist-language=Java 2 | *.properties linguist-language=Java 3 | mvnw linguist-vendored 4 | mvnw.cmd linguist-vendored 5 | .mvn/* linguist-vendored 6 | -------------------------------------------------------------------------------- /src/main/resources/app/config.js: -------------------------------------------------------------------------------- 1 | export default function config($urlRouterProvider) { 2 | $urlRouterProvider.otherwise('/'); 3 | }; 4 | 5 | config.$inject = ['$urlRouterProvider']; 6 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # configure auto-configured MultipartConfigElement 2 | multipart.maxFileSize=50MB 3 | multipart.maxRequestSize=50MB 4 | multipart.location=${java.io.tmpdir} 5 | -------------------------------------------------------------------------------- /src/main/resources/app/home/home.controller.js: -------------------------------------------------------------------------------- 1 | export default class HomeController { 2 | 3 | constructor($state) { 4 | $state.transitionTo('upload'); 5 | } 6 | } 7 | 8 | HomeController.$inject = ['$state']; 9 | -------------------------------------------------------------------------------- /src/main/resources/app/home/result/index.js: -------------------------------------------------------------------------------- 1 | import angular from 'angular'; 2 | import ResultController from './result.controller'; 3 | 4 | export default angular.module('result', []) 5 | .controller('ResultController', ResultController) 6 | .name; 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## About 2 | Start of Just-Gif-It for Pluralsight course Spring Boot: Efficient Development, Configuration, and Deployment 3 | 4 | UI: AngularJS + WebPack + ES6 (ES2015) 5 | Backend: Spring Boot + JavaCV + Animated-Gif-Lib 6 | 7 | ## License 8 | Version 2.0 of the Apache License 9 | -------------------------------------------------------------------------------- /src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | __ __ _______ ____ ______ 2 | / /_ _______/ /_ / ____(_) __/ / _/ /_ 3 | __ / / / / / ___/ __/ / / __/ / /_ / // __/ 4 | / /_/ / /_/ (__ ) /_ / /_/ / / __/ _/ // /_ 5 | \____/\__,_/____/\__/ \____/_/_/ /___/\__/ 6 | -------------------------------------------------------------------------------- /src/main/resources/app/home/result/result.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /src/main/resources/app/home/upload/upload.controller.js: -------------------------------------------------------------------------------- 1 | export default class UploadController { 2 | 3 | constructor($state) { 4 | this.$state = $state; 5 | } 6 | 7 | changed($files) { 8 | this.$state.go('view', {files: $files}); 9 | } 10 | } 11 | 12 | UploadController.$inject = ['$state']; 13 | -------------------------------------------------------------------------------- /src/main/resources/app/home/view/index.js: -------------------------------------------------------------------------------- 1 | import angular from 'angular'; 2 | import ngFileUpload from 'ng-file-upload'; 3 | import ViewController from './view.controller'; 4 | import upload from '../upload'; 5 | 6 | export default angular.module('view', [ngFileUpload, upload]) 7 | .controller('ViewController', ViewController) 8 | .name; 9 | -------------------------------------------------------------------------------- /src/main/resources/app/home/upload/upload.html: -------------------------------------------------------------------------------- 1 |
4 | Drop or click to upload video 5 |
-------------------------------------------------------------------------------- /src/main/resources/app/home/upload/upload.service.js: -------------------------------------------------------------------------------- 1 | export default class UploadService { 2 | 3 | constructor(Upload) { 4 | this.uploader = Upload; 5 | } 6 | 7 | upload(params) { 8 | return this.uploader.upload({ 9 | url: '/upload', 10 | data: params 11 | }); 12 | } 13 | }; 14 | 15 | UploadService.$inject = ['Upload']; -------------------------------------------------------------------------------- /src/main/resources/app/home/result/result.controller.js: -------------------------------------------------------------------------------- 1 | export default class ResultController { 2 | 3 | constructor($stateParams, $state) { 4 | this.animatedGif = $stateParams.animatedGif; 5 | this.$state = $state; 6 | } 7 | 8 | clear() { 9 | this.$state.go('home'); 10 | } 11 | 12 | } 13 | 14 | ResultController.$inject = ['$stateParams', '$state']; 15 | -------------------------------------------------------------------------------- /src/main/resources/app/css/custom.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | .drop-box { 7 | background: #F8F8F8; 8 | border: 5px dashed #DDD; 9 | height: 75px; 10 | text-align: center; 11 | padding-top: 25px; 12 | margin: 10px; 13 | } 14 | .dragover { 15 | border: 5px dashed blue; 16 | } 17 | 18 | .mt-1-em { 19 | margin-top: 1em; 20 | } 21 | 22 | video { 23 | background-color: black; 24 | } -------------------------------------------------------------------------------- /src/main/resources/app/index.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap/dist/css/bootstrap.css'; 2 | import 'angular-loading-bar/build/loading-bar.css'; 3 | import './css/custom.css'; 4 | import angular from 'angular'; 5 | import angular_ui_router from 'angular-ui-router'; 6 | import angular_loading_bar from 'angular-loading-bar'; 7 | import config from './config'; 8 | import home from './home'; 9 | 10 | angular.module('app', [angular_ui_router, angular_loading_bar, home]) 11 | .config(config); -------------------------------------------------------------------------------- /src/main/resources/app/home/upload/index.js: -------------------------------------------------------------------------------- 1 | import angular from 'angular'; 2 | import angularUiRouter from 'angular-ui-router'; 3 | import ngFileUpload from 'ng-file-upload'; 4 | import UploadController from './upload.controller'; 5 | import UploadService from './upload.service'; 6 | 7 | export default angular.module('upload', [angularUiRouter, ngFileUpload]) 8 | .controller('UploadController', UploadController) 9 | .service('UploadService', UploadService) 10 | .name; 11 | -------------------------------------------------------------------------------- /src/main/resources/app/home/index.js: -------------------------------------------------------------------------------- 1 | import angular from 'angular'; 2 | import angularUiRouter from 'angular-ui-router'; 3 | import ngFileUpload from 'ng-file-upload'; 4 | import routes from './home.routes'; 5 | import HomeController from './home.controller'; 6 | import upload from './upload'; 7 | import view from './view'; 8 | import result from './result'; 9 | 10 | export default angular.module('home', [angularUiRouter, ngFileUpload, upload, view, result]) 11 | .config(routes) 12 | .controller('HomeController', HomeController) 13 | .name; 14 | -------------------------------------------------------------------------------- /src/main/java/schultz/dustin/io/services/VideoDecoderService.java: -------------------------------------------------------------------------------- 1 | package schultz.dustin.io.services; 2 | 3 | import org.bytedeco.javacv.FFmpegFrameGrabber; 4 | import org.bytedeco.javacv.FrameGrabber; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.io.File; 8 | 9 | @Service 10 | public class VideoDecoderService { 11 | 12 | public FFmpegFrameGrabber read(File video) throws FrameGrabber.Exception { 13 | FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber(video); 14 | frameGrabber.start(); 15 | return frameGrabber; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/schultz/dustin/io/JustGifItTests.java: -------------------------------------------------------------------------------- 1 | package schultz.dustin.io; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = JustGifItApplication.class) 11 | @WebAppConfiguration 12 | public class JustGifItTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/schultz/dustin/io/services/GifEncoderService.java: -------------------------------------------------------------------------------- 1 | package schultz.dustin.io.services; 2 | 3 | import com.madgag.gif.fmsware.AnimatedGifEncoder; 4 | import org.springframework.stereotype.Service; 5 | 6 | import java.nio.file.Path; 7 | 8 | @Service 9 | public class GifEncoderService { 10 | 11 | public AnimatedGifEncoder getGifEncoder(boolean repeat, float frameRate, Path 12 | output) { 13 | AnimatedGifEncoder gifEncoder = new AnimatedGifEncoder(); 14 | 15 | if (repeat) { 16 | gifEncoder.setRepeat(0); 17 | } 18 | 19 | gifEncoder.setFrameRate(frameRate); 20 | gifEncoder.start(output.toString()); 21 | return gifEncoder; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/app/home/view/view.controller.js: -------------------------------------------------------------------------------- 1 | export default class ViewController { 2 | 3 | constructor(UploadService, $stateParams, $state) { 4 | this.uploadService = UploadService; 5 | this.file = $stateParams.files[0]; 6 | this.$state = $state; 7 | } 8 | 9 | submit() { 10 | this.uploadService.upload({ 11 | file: this.file, 12 | start: this.start, 13 | end: this.end, 14 | speed: this.speed, 15 | repeat: this.repeat ? true : false 16 | }) 17 | .then((response) => { 18 | this.$state.go('result', {animatedGif: response.data}); 19 | }); 20 | } 21 | } 22 | 23 | ViewController.$inject = ['UploadService', '$stateParams', '$state']; 24 | -------------------------------------------------------------------------------- /src/main/resources/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Just Gif It™ 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
Just Gif It™ 20 | Turn your videos into animated GIFs 21 |
22 |
23 |
24 | 25 |
26 |
27 |
28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/resources/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "just-gif-it", 3 | "version": "1.0.0", 4 | "description": "Just Gif It", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Dustin Schultz", 10 | "dependencies": { 11 | "angular": "^1.4.9", 12 | "angular-loading-bar": "^0.8.0", 13 | "angular-ui-router": "^0.2.18", 14 | "bootstrap": "^3.3.6", 15 | "ng-file-upload": "^11.2.3" 16 | }, 17 | "devDependencies": { 18 | "babel": "^6.3.26", 19 | "babel-core": "^6.4.5", 20 | "babel-loader": "^6.2.1", 21 | "babel-preset-es2015": "^6.3.13", 22 | "css-loader": "^0.23.1", 23 | "extract-text-webpack-plugin": "^1.0.1", 24 | "file-loader": "^0.8.5", 25 | "html-webpack-plugin": "^2.8.1", 26 | "ng-annotate-loader": "^0.1.0", 27 | "ng-file-upload": "^11.2.3", 28 | "raw-loader": "^0.5.1", 29 | "style-loader": "^0.13.0", 30 | "url-loader": "^0.5.7", 31 | "webpack": "^1.12.12", 32 | "webpack-dev-server": "^1.14.1" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/app/home/home.routes.js: -------------------------------------------------------------------------------- 1 | import uploadTemplate from './upload/upload.html'; 2 | import viewTemplate from './view/view.html'; 3 | import resultTemplate from './result/result.html'; 4 | 5 | export default function routes($stateProvider) { 6 | $stateProvider 7 | .state('home', { 8 | url: '/', 9 | controller: 'HomeController', 10 | }) 11 | .state('upload', { 12 | url: '/upload', 13 | template: uploadTemplate, 14 | controller: 'UploadController', 15 | controllerAs: 'upload' 16 | }) 17 | .state('view', { 18 | url: '/view', 19 | params: { 20 | files: null 21 | }, 22 | template: viewTemplate, 23 | controller: 'ViewController', 24 | controllerAs: 'view' 25 | }) 26 | .state('result', { 27 | url: '/result', 28 | params: { 29 | animatedGif: null 30 | }, 31 | template: resultTemplate, 32 | controller: 'ResultController', 33 | controllerAs: 'result' 34 | }); 35 | }; 36 | 37 | routes.$inject = ['$stateProvider']; 38 | -------------------------------------------------------------------------------- /src/main/java/schultz/dustin/io/services/ConverterService.java: -------------------------------------------------------------------------------- 1 | package schultz.dustin.io.services; 2 | 3 | import com.madgag.gif.fmsware.AnimatedGifEncoder; 4 | import org.bytedeco.javacv.FFmpegFrameGrabber; 5 | import org.bytedeco.javacv.FrameGrabber; 6 | import org.bytedeco.javacv.Java2DFrameConverter; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.awt.image.BufferedImage; 10 | 11 | @Service 12 | public class ConverterService { 13 | 14 | public void toAnimatedGif(FFmpegFrameGrabber frameGrabber, AnimatedGifEncoder 15 | gifEncoder, int start, int end, int speed) throws FrameGrabber.Exception { 16 | long startFrame = Math.round(start * frameGrabber.getFrameRate()); 17 | long endFrame = Math.round(end * frameGrabber.getFrameRate()); 18 | 19 | Java2DFrameConverter frameConverter = new Java2DFrameConverter(); 20 | 21 | for (long i = startFrame; i < endFrame; i++) { 22 | 23 | if (i % speed == 0) { 24 | 25 | // Bug if frameNumber is set to 0 26 | if (i > 0) { 27 | frameGrabber.setFrameNumber((int) i); 28 | } 29 | 30 | BufferedImage bufferedImage = frameConverter 31 | .convert(frameGrabber.grabImage()); 32 | gifEncoder.addFrame(bufferedImage); 33 | } 34 | 35 | } 36 | 37 | frameGrabber.stop(); 38 | gifEncoder.finish(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resources/webpack.config.js: -------------------------------------------------------------------------------- 1 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 2 | const ExtractTextPlugin = require("extract-text-webpack-plugin"); 3 | 4 | module.exports = { 5 | context: __dirname + '/app', 6 | entry: './index.js', 7 | output: { 8 | path: __dirname + '/public', 9 | filename: 'bundle.js' 10 | }, 11 | devtool: 'source-map', 12 | module: { 13 | loaders: [ 14 | {test: /\.jsx?$/, exclude: /(node_modules|bower_components)/, loader: 'ng-annotate!babel'}, 15 | {test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader")}, 16 | {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"}, 17 | {test: /\.(woff|woff2)$/, loader: "url?prefix=font/&limit=5000"}, 18 | {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"}, 19 | {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"}, 20 | {test: /\.html$/, loader: 'raw'} 21 | ] 22 | }, 23 | plugins: [ 24 | new ExtractTextPlugin('[name].[hash].css'), 25 | new HtmlWebpackPlugin({ 26 | template: 'index.html', 27 | inject: 'body' 28 | }) 29 | ], 30 | devServer: { 31 | port: 9000, 32 | proxy: { 33 | '/*': { 34 | target: 'http://localhost:8080', 35 | secure: false, 36 | prependPath: false 37 | }, 38 | }, 39 | publicPath: 'http://localhost:9000/' 40 | } 41 | }; -------------------------------------------------------------------------------- /src/main/resources/app/home/view/view.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 19 |
20 |
21 |
22 |
23 |
24 |
25 | 26 |
27 |
28 |
29 |
30 |
31 | 32 |
33 |
-------------------------------------------------------------------------------- /src/main/java/schultz/dustin/io/JustGifItApplication.java: -------------------------------------------------------------------------------- 1 | package schultz.dustin.io; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 10 | 11 | import javax.annotation.PostConstruct; 12 | import java.io.File; 13 | 14 | @SpringBootApplication 15 | public class JustGifItApplication { 16 | 17 | @Value("${multipart.location}/gif/") 18 | private String gifLocation; 19 | 20 | public static void main(String[] args) { 21 | SpringApplication.run(JustGifItApplication.class, args); 22 | } 23 | 24 | @PostConstruct 25 | private void init() { 26 | File gifFolder = new File(gifLocation); 27 | if (!gifFolder.exists()) { 28 | gifFolder.mkdir(); 29 | } 30 | } 31 | 32 | @Bean 33 | public WebMvcConfigurer webMvcConfigurer() { 34 | return new WebMvcConfigurerAdapter() { 35 | @Override 36 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 37 | registry.addResourceHandler("/gif/**") 38 | .addResourceLocations("file:" + gifLocation); 39 | super.addResourceHandlers(registry); 40 | } 41 | }; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/schultz/dustin/io/controller/UploadController.java: -------------------------------------------------------------------------------- 1 | package schultz.dustin.io.controller; 2 | 3 | import com.madgag.gif.fmsware.AnimatedGifEncoder; 4 | import org.bytedeco.javacv.FFmpegFrameGrabber; 5 | import org.bytedeco.javacv.FrameGrabber; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Value; 9 | import org.springframework.http.MediaType; 10 | import org.springframework.web.bind.annotation.*; 11 | import org.springframework.web.multipart.MultipartFile; 12 | import schultz.dustin.io.services.ConverterService; 13 | import schultz.dustin.io.services.GifEncoderService; 14 | import schultz.dustin.io.services.VideoDecoderService; 15 | 16 | import javax.inject.Inject; 17 | import java.io.File; 18 | import java.io.IOException; 19 | import java.lang.invoke.MethodHandles; 20 | import java.nio.file.Path; 21 | import java.nio.file.Paths; 22 | 23 | @RestController 24 | public class UploadController { 25 | 26 | private final static Logger log = LoggerFactory.getLogger(MethodHandles.lookup() 27 | .lookupClass()); 28 | 29 | @Value("${multipart.location}") 30 | private String location; 31 | 32 | @Inject 33 | private ConverterService converterService; 34 | 35 | @Inject 36 | private GifEncoderService gifEncoderService; 37 | 38 | @Inject 39 | private VideoDecoderService videoDecoderService; 40 | 41 | @RequestMapping(value = "/upload", method = RequestMethod.POST, produces = 42 | MediaType.IMAGE_GIF_VALUE) 43 | public String upload(@RequestPart("file") MultipartFile file, 44 | @RequestParam("start") int start, 45 | @RequestParam("end") int end, 46 | @RequestParam("speed") int speed, 47 | @RequestParam("repeat") boolean repeat) throws IOException, FrameGrabber.Exception { 48 | File videoFile = new File(location + "/" + System 49 | .currentTimeMillis() + ".mp4"); 50 | file.transferTo(videoFile); 51 | 52 | log.info("Saved video file to {}", videoFile.getAbsolutePath()); 53 | 54 | Path output = Paths.get(location + "/gif/" + System.currentTimeMillis() + ".gif"); 55 | 56 | FFmpegFrameGrabber frameGrabber = videoDecoderService.read(videoFile); 57 | AnimatedGifEncoder gifEncoder = gifEncoderService.getGifEncoder(repeat, 58 | (float) frameGrabber.getFrameRate(), output); 59 | converterService.toAnimatedGif(frameGrabber, gifEncoder, start, end, speed); 60 | 61 | log.info("Saved generated gif to {}", output.toString()); 62 | 63 | return output.getFileName().toString(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | io.schultz.dustin 8 | just-gif-it 9 | 1.0-SNAPSHOT 10 | 11 | Just Gif It 12 | Turn your videos into GIFs 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.3.0.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | 1.8 24 | 2.4 25 | 1 26 | 1.1 27 | 1.2 28 | v4.3.0 29 | 3.7.2 30 | 0.0.28 31 | 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-logging 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-actuator 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-devtools 45 | true 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-starter-web 50 | 51 | 52 | commons-io 53 | commons-io 54 | ${commons.io.version} 55 | 56 | 57 | javax.inject 58 | javax.inject 59 | ${javax.inject.version} 60 | 61 | 62 | org.bytedeco 63 | javacv 64 | ${javacv.version} 65 | 66 | 67 | com.madgag 68 | animated-gif-lib 69 | ${animated.gif.lib.version} 70 | 71 | 72 | org.springframework.boot 73 | spring-boot-starter-test 74 | test 75 | 76 | 77 | 78 | 79 | 80 | 81 | org.springframework.boot 82 | spring-boot-maven-plugin 83 | 84 | 85 | com.github.eirslett 86 | frontend-maven-plugin 87 | ${frontend.maven.plugin.version} 88 | 89 | ${node.version} 90 | ${npm.version} 91 | target 92 | src/main/resources 93 | 94 | 95 | 96 | install node and npm 97 | 98 | install-node-and-npm 99 | 100 | generate-resources 101 | 102 | 103 | npm install 104 | 105 | npm 106 | 107 | 108 | install 109 | 110 | 111 | 112 | webpack build 113 | 114 | webpack 115 | 116 | 117 | -p 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /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 http://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 Maven2 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 key stroke 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 enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 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 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /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 | # http://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 | # Maven2 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 /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # 58 | # Look for the Apple JDKs first to preserve the existing behaviour, and then look 59 | # for the new JDKs provided by Oracle. 60 | # 61 | if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then 62 | # 63 | # Apple JDKs 64 | # 65 | export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home 66 | fi 67 | 68 | if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then 69 | # 70 | # Apple JDKs 71 | # 72 | export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home 73 | fi 74 | 75 | if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then 76 | # 77 | # Oracle JDKs 78 | # 79 | export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home 80 | fi 81 | 82 | if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then 83 | # 84 | # Apple JDKs 85 | # 86 | export JAVA_HOME=`/usr/libexec/java_home` 87 | fi 88 | ;; 89 | esac 90 | 91 | if [ -z "$JAVA_HOME" ] ; then 92 | if [ -r /etc/gentoo-release ] ; then 93 | JAVA_HOME=`java-config --jre-home` 94 | fi 95 | fi 96 | 97 | if [ -z "$M2_HOME" ] ; then 98 | ## resolve links - $0 may be a link to maven's home 99 | PRG="$0" 100 | 101 | # need this for relative symlinks 102 | while [ -h "$PRG" ] ; do 103 | ls=`ls -ld "$PRG"` 104 | link=`expr "$ls" : '.*-> \(.*\)$'` 105 | if expr "$link" : '/.*' > /dev/null; then 106 | PRG="$link" 107 | else 108 | PRG="`dirname "$PRG"`/$link" 109 | fi 110 | done 111 | 112 | saveddir=`pwd` 113 | 114 | M2_HOME=`dirname "$PRG"`/.. 115 | 116 | # make it fully qualified 117 | M2_HOME=`cd "$M2_HOME" && pwd` 118 | 119 | cd "$saveddir" 120 | # echo Using m2 at $M2_HOME 121 | fi 122 | 123 | # For Cygwin, ensure paths are in UNIX format before anything is touched 124 | if $cygwin ; then 125 | [ -n "$M2_HOME" ] && 126 | M2_HOME=`cygpath --unix "$M2_HOME"` 127 | [ -n "$JAVA_HOME" ] && 128 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 129 | [ -n "$CLASSPATH" ] && 130 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 131 | fi 132 | 133 | # For Migwn, ensure paths are in UNIX format before anything is touched 134 | if $mingw ; then 135 | [ -n "$M2_HOME" ] && 136 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 137 | [ -n "$JAVA_HOME" ] && 138 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 139 | # TODO classpath? 140 | fi 141 | 142 | if [ -z "$JAVA_HOME" ]; then 143 | javaExecutable="`which javac`" 144 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 145 | # readlink(1) is not available as standard on Solaris 10. 146 | readLink=`which readlink` 147 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 148 | if $darwin ; then 149 | javaHome="`dirname \"$javaExecutable\"`" 150 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 151 | else 152 | javaExecutable="`readlink -f \"$javaExecutable\"`" 153 | fi 154 | javaHome="`dirname \"$javaExecutable\"`" 155 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 156 | JAVA_HOME="$javaHome" 157 | export JAVA_HOME 158 | fi 159 | fi 160 | fi 161 | 162 | if [ -z "$JAVACMD" ] ; then 163 | if [ -n "$JAVA_HOME" ] ; then 164 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 165 | # IBM's JDK on AIX uses strange locations for the executables 166 | JAVACMD="$JAVA_HOME/jre/sh/java" 167 | else 168 | JAVACMD="$JAVA_HOME/bin/java" 169 | fi 170 | else 171 | JAVACMD="`which java`" 172 | fi 173 | fi 174 | 175 | if [ ! -x "$JAVACMD" ] ; then 176 | echo "Error: JAVA_HOME is not defined correctly." >&2 177 | echo " We cannot execute $JAVACMD" >&2 178 | exit 1 179 | fi 180 | 181 | if [ -z "$JAVA_HOME" ] ; then 182 | echo "Warning: JAVA_HOME environment variable is not set." 183 | fi 184 | 185 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 186 | 187 | # For Cygwin, switch paths to Windows format before running java 188 | if $cygwin; then 189 | [ -n "$M2_HOME" ] && 190 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 191 | [ -n "$JAVA_HOME" ] && 192 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 193 | [ -n "$CLASSPATH" ] && 194 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 195 | fi 196 | 197 | # traverses directory structure from process work directory to filesystem root 198 | # first directory with .mvn subdirectory is considered project base directory 199 | find_maven_basedir() { 200 | local basedir=$(pwd) 201 | local wdir=$(pwd) 202 | while [ "$wdir" != '/' ] ; do 203 | if [ -d "$wdir"/.mvn ] ; then 204 | basedir=$wdir 205 | break 206 | fi 207 | wdir=$(cd "$wdir/.."; pwd) 208 | done 209 | echo "${basedir}" 210 | } 211 | 212 | # concatenates all lines of a file 213 | concat_lines() { 214 | if [ -f "$1" ]; then 215 | echo "$(tr -s '\n' ' ' < "$1")" 216 | fi 217 | } 218 | 219 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)} 220 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 221 | 222 | # Provide a "standardized" way to retrieve the CLI args that will 223 | # work with both Windows and non-Windows executions. 224 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 225 | export MAVEN_CMD_LINE_ARGS 226 | 227 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 228 | 229 | exec "$JAVACMD" \ 230 | $MAVEN_OPTS \ 231 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 232 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 233 | ${WRAPPER_LAUNCHER} "$@" 234 | --------------------------------------------------------------------------------