spring-gen 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +3 -0
  5. data/Gemfile +9 -0
  6. data/LICENSE.txt +674 -0
  7. data/README.md +133 -0
  8. data/Rakefile +1 -0
  9. data/bin/setup +7 -0
  10. data/bin/spring-gen +8 -0
  11. data/lib/command_router.rb +15 -0
  12. data/lib/commands/resource.rb +129 -0
  13. data/lib/commands/service.rb +53 -0
  14. data/lib/spring-gen/version.rb +3 -0
  15. data/lib/spring-gen.rb +5 -0
  16. data/lib/templates/layout/.gitignore +36 -0
  17. data/lib/templates/layout/build.gradle.erb +105 -0
  18. data/lib/templates/layout/intellij/config/checkstyle/checkstyle.xml +199 -0
  19. data/lib/templates/layout/intellij/config/codestyle/Codestyle.xml +34 -0
  20. data/lib/templates/layout/intellij/config/copyright/gnu.xml +6 -0
  21. data/lib/templates/layout/intellij/config/copyright/profiles_settings.xml +10 -0
  22. data/lib/templates/layout/src/java/config/AppConfig.java.erb +54 -0
  23. data/lib/templates/layout/src/java/main/App.java.erb +41 -0
  24. data/lib/templates/layout/src/resources/application.yml.erb +108 -0
  25. data/lib/templates/layout/src/resources/bootstrap.yml.erb +3 -0
  26. data/lib/templates/resource/assembler/Assembler.java.erb +57 -0
  27. data/lib/templates/resource/assembler/BaseAssembler.java.erb +95 -0
  28. data/lib/templates/resource/controller/BaseController.java.erb +66 -0
  29. data/lib/templates/resource/controller/Controller.java.erb +106 -0
  30. data/lib/templates/resource/exception/NotCreatedException.java.erb +34 -0
  31. data/lib/templates/resource/model/JpaBaseEntity.java.erb +43 -0
  32. data/lib/templates/resource/model/Model.java.erb +51 -0
  33. data/lib/templates/resource/model/MongodbBaseEntity.java.erb +33 -0
  34. data/lib/templates/resource/model/Neo4jBaseEntity.java.erb +81 -0
  35. data/lib/templates/resource/repository/Repository.java.erb +30 -0
  36. data/lib/templates/resource/resource/Resource.java.erb +48 -0
  37. data/lib/templates/resource/test/TestUtil.java.erb +85 -0
  38. data/lib/templates/resource/test/integration/jpa/IntegrationTest.java.erb +123 -0
  39. data/lib/templates/resource/test/integration/jpa/IntegrationTestConfig.java.erb +47 -0
  40. data/lib/templates/resource/test/integration/jpa/sampleData.xml.erb +20 -0
  41. data/lib/templates/resource/test/integration/mongodb/IntegrationTest.java.erb +114 -0
  42. data/lib/templates/resource/test/integration/mongodb/IntegrationTestConfig.java.erb +60 -0
  43. data/lib/templates/resource/test/integration/mongodb/SampleData.java.erb +43 -0
  44. data/lib/templates/resource/test/integration/neo4j/IntegrationTest.java.erb +123 -0
  45. data/lib/templates/resource/test/integration/neo4j/IntegrationTestConfig.java.erb +47 -0
  46. data/lib/templates/resource/test/integration/neo4j/SampleData.java.erb +23 -0
  47. data/lib/templates/resource/test/unit/assembler/AssemblerUnitTest.java.erb +52 -0
  48. data/lib/templates/resource/test/unit/assembler/AssemblerUnitTestConfig.java.erb +43 -0
  49. data/lib/templates/resource/test/unit/controller/ControllerUnitTest.java.erb +115 -0
  50. data/lib/templates/resource/test/unit/controller/ControllerUnitTestConfig.java.erb +64 -0
  51. data/lib/templates/service.yml.erb +4 -0
  52. data/lib/util.rb +39 -0
  53. data/spring-gen.gemspec +25 -0
  54. metadata +153 -0
data/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # spring-gen
2
+
3
+ spring-gen is a rails-like generator for spring microservices.
4
+
5
+ ## Installation
6
+ Open a terminal and type
7
+ ```bash
8
+ gem install lectureGen
9
+ ```
10
+
11
+
12
+
13
+ ## Usage
14
+
15
+ First, create a new microservice:
16
+
17
+ ```bash
18
+ spring-gen service com.mycompany.MyService
19
+ #output
20
+ create MyService/config
21
+ create MyService/config/checkstyle/checkstyle.xml
22
+ create MyService/config/codestyle/Codestyle.xml
23
+ create MyService/config/copyright/gnu.xml
24
+ create MyService/config/copyright/profiles_settings.xml
25
+ create MyService/src/main/java/com/mycompany/main/App.java
26
+ create MyService/src/main/java/com/mycompany/config/AppConfig.java
27
+ create MyService/.gitignore
28
+ create MyService/src/main/resources/application.yml
29
+ create MyService/src/main/resources/bootstrap.yml
30
+ create MyService/build.gradle
31
+ create MyService/service.yml
32
+ ```
33
+ This will create a jpa based microservice. The service command expects an argument in the form `groupId.artifactId`.
34
+ So the argument `com.mycompany.MyService` will get interpreted as groupId: com.mycompany and artifactId: MyService.
35
+
36
+ You can specify a different spring-data backend with the `r` option:
37
+
38
+ ```bash
39
+ spring-gen service com.mycompany.MyService -r mongodb
40
+ #output
41
+ create MyService/config
42
+ create MyService/config/checkstyle/checkstyle.xml
43
+ create MyService/config/codestyle/Codestyle.xml
44
+ create MyService/config/copyright/gnu.xml
45
+ create MyService/config/copyright/profiles_settings.xml
46
+ create MyService/src/main/java/com/mycompany/main/App.java
47
+ create MyService/src/main/java/com/mycompany/config/AppConfig.java
48
+ create MyService/.gitignore
49
+ create MyService/src/main/resources/application.yml
50
+ create MyService/src/main/resources/bootstrap.yml
51
+ create MyService/build.gradle
52
+ create MyService/service.yml
53
+ ```
54
+
55
+ with mongodb as a backend, different classes will be generated. spring-gen currently supports
56
+ jpa, mongodb and neo4j.
57
+
58
+ After creating the project layout, enter the project-root and generate some resources:
59
+
60
+ ```bash
61
+ cd MyService
62
+ spring-gen resource User firstname:String lastname:String
63
+ #output
64
+ create src/test/resources/sampledata/userSampleData.xml
65
+ create src/main/java/com/mycompany/model/BaseEntity.java
66
+ create src/main/java/com/mycompany/model/User.java
67
+ create src/main/java/com/mycompany/repository/UserRepository.java
68
+ create src/test/java/com/mycompany/integration/user/UserIntegrationTestConfig.java
69
+ create src/test/java/com/mycompany/integration/user/UserIntegrationTest.java
70
+ create src/test/java/util/TestUtil.java
71
+ ```
72
+ This will generate a new user-model (containing string attributes for firstname and lastname)
73
+ as well as a repository that matches your spring-data choice. spring-gen will assume that you use
74
+ spring-data-rest. If you don't want to use spring-data-rest you can set the --full option,
75
+ which will generate additional classes like REST-controllers:
76
+
77
+ ```bash
78
+ spring-gen resource User firstname:String lastname:String --full
79
+ # output
80
+ create src/test/resources/sampledata/userSampleData.xml
81
+ create src/main/java/com/mycompany/model/BaseEntity.java
82
+ create src/main/java/com/mycompany/model/User.java
83
+ create src/main/java/com/mycompany/repository/UserRepository.java
84
+ create src/test/java/com/mycompany/integration/user/UserIntegrationTestConfig.java
85
+ create src/test/java/com/mycompany/integration/user/UserIntegrationTest.java
86
+ create src/test/java/util/TestUtil.java
87
+ create src/test/java/com/mycompany/unit/user/controller/UserControllerUnitTestConfig.java
88
+ create src/test/java/com/mycompany/unit/user/controller/UserControllerUnitTest.java
89
+ create src/test/java/com/mycompany/unit/user/assembler/UserAssemblerUnitTestConfig.java
90
+ create src/test/java/com/mycompany/unit/user/assembler/UserAssemblerUnitTest.java
91
+ create src/main/java/com/mycompany/controller/BaseController.java
92
+ create src/main/java/com/mycompany/controller/UserController.java
93
+ create src/main/java/com/mycompany/assembler/BaseAssembler.java
94
+ create src/main/java/com/mycompany/assembler/UserAssembler.java
95
+ create src/main/java/com/mycompany/resource/UserResource.java
96
+ create src/main/java/com/mycompany/exception/NotCreatedException.java
97
+ ```
98
+
99
+
100
+
101
+
102
+ ## Issues
103
+
104
+ Neo4j is not really working right now. This will get resolved after SDN4 hits the spot.
105
+
106
+ ## Development
107
+
108
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
109
+
110
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
111
+
112
+ ## Contributing
113
+
114
+ 1. Fork it ( https://github.com/Richterrettich/spring-gen/fork )
115
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
116
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
117
+ 4. Push to the branch (`git push origin my-new-feature`)
118
+ 5. Create a new Pull Request
119
+
120
+
121
+ ## Copyright
122
+ Copyright (c) 2015 Rene Richter.
123
+ slidemgr is free software; you can redistribute it and/or modify
124
+ it under the terms of the GNU General Public License as published by
125
+ the Free Software Foundation; either version 3 of the License, or
126
+ (at your option) any later version.
127
+ This program is distributed in the hope that it will be useful,
128
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
129
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130
+ GNU General Public License for more details.
131
+ You should have received a copy of the GNU General Public License
132
+ along with this program; if not, write to the Free Software Foundation,
133
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/bin/spring-gen ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'command_router'
5
+ require 'thor'
6
+
7
+
8
+ CommandRouter::Main.start ARGV
@@ -0,0 +1,15 @@
1
+ require 'commands/resource'
2
+ require "commands/service"
3
+ require 'thor'
4
+
5
+ module CommandRouter
6
+ include Util
7
+
8
+ class Main < Thor
9
+
10
+ register(Service, 'service', 'service [service_name]', 'Creates a new microservice.')
11
+ register(Resource, 'resource', 'resource [resource_name]', 'Creates a new resource')
12
+
13
+ end
14
+
15
+ end
@@ -0,0 +1,129 @@
1
+ require 'thor'
2
+ require 'thor/group'
3
+ require 'util'
4
+
5
+ Attribute = Struct.new(:name,:data_type)
6
+ class Resource < Thor::Group
7
+ include Util
8
+ include Thor::Actions
9
+
10
+ argument :model_name, :type => :string, :desc => 'Name of the model'
11
+ argument :attributes,
12
+ :type => :hash,
13
+ :desc => 'attributes',
14
+ :default => {}
15
+
16
+ class_option :full,
17
+ :type => :boolean,
18
+ :desc => 'invoke all templates',
19
+ :aliases => 'f',
20
+ :default => false
21
+
22
+ def self.source_root
23
+ File.expand_path('../',__dir__)
24
+ end
25
+
26
+ def prepare_attributes
27
+ @attributes = @attributes.map{|k,v| Attribute.new k,v}
28
+ end
29
+
30
+ def create_model
31
+ @user_name = user_name
32
+ @user_email = user_email
33
+ @group_id = config.group_id
34
+ @artifact_id = config.artifact_id
35
+ @full = options['full']
36
+
37
+
38
+ case config.repository_technique
39
+ when "jpa"
40
+ @repository_import = "jpa.repository.JpaRepository"
41
+ @repository_type = "JpaRepository<#{@model_name},Long>"
42
+ @entity_annotation = "@Entity"
43
+ @annotation_import = "import javax.persistence.Entity;"
44
+ template "templates/resource/test/integration/#{config.repository_technique}/sampleData.xml.erb",
45
+ "#{content_root}/src/test/resources/sampledata/#{@model_name.downcase}SampleData.xml"
46
+ when "mongodb"
47
+ @repository_import = "mongodb.repository.MongoRepository"
48
+ @repository_type = "MongoRepository<#{@model_name},Long>"
49
+ @annotation_import = 'import org.springframework.data.mongodb.core.mapping.Document;'
50
+ @entity_annotation = "@Document"
51
+ template "templates/resource/test/integration/#{config.repository_technique}/SampleData.java.erb",
52
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/integration/#{@model_name.downcase}/#{@model_name}SampleData.java"
53
+ when "neo4j"
54
+ @repository_import = "neo4j.repository.GraphRepository"
55
+ @repository_type = "GraphRepository<#{@model_name}>"
56
+ @entity_annotation = "@NodeEntity"
57
+ template "templates/resource/test/integration/#{config.repository_technique}/SampleData.java.erb",
58
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/integration/#{@model_name.downcase}/#{@model_name}SampleData.java"
59
+ else
60
+ raise ("not a suitable repository-technique.")
61
+ end
62
+
63
+
64
+ template "templates/resource/model/#{config.repository_technique.capitalize}BaseEntity.java.erb",
65
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/model/BaseEntity.java"
66
+ template(
67
+ 'templates/resource/model/Model.java.erb',
68
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/model/#{@model_name}.java")
69
+
70
+ template(
71
+ 'templates/resource/repository/Repository.java.erb',
72
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/repository/#{@model_name}Repository.java")
73
+
74
+ template(
75
+ "templates/resource/test/integration/#{config.repository_technique}/IntegrationTestConfig.java.erb",
76
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/integration/#{@model_name.downcase}/#{@model_name}IntegrationTestConfig.java")
77
+
78
+ template(
79
+ "templates/resource/test/integration/#{config.repository_technique}/IntegrationTest.java.erb",
80
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/integration/#{@model_name.downcase}/#{@model_name}IntegrationTest.java")
81
+
82
+
83
+ template(
84
+ 'templates/resource/test/TestUtil.java.erb',
85
+ "#{content_root}/src/test/java/util/TestUtil.java") unless File.exist?("#{content_root}/src/test/java/util/TestUtil.java")
86
+
87
+ if @full
88
+
89
+ template(
90
+ 'templates/resource/test/unit/controller/ControllerUnitTestConfig.java.erb',
91
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/unit/#{@model_name.downcase}/controller/#{@model_name}ControllerUnitTestConfig.java")
92
+
93
+ template(
94
+ 'templates/resource/test/unit/controller/ControllerUnitTest.java.erb',
95
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/unit/#{@model_name.downcase}/controller/#{@model_name}ControllerUnitTest.java")
96
+
97
+ template(
98
+ 'templates/resource/test/unit/assembler/AssemblerUnitTestConfig.java.erb',
99
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/unit/#{@model_name.downcase}/assembler/#{@model_name}AssemblerUnitTestConfig.java")
100
+
101
+ template(
102
+ 'templates/resource/test/unit/assembler/AssemblerUnitTest.java.erb',
103
+ "#{content_root}/src/test/java/#{@group_id.gsub(".","/")}/unit/#{@model_name.downcase}/assembler/#{@model_name}AssemblerUnitTest.java")
104
+
105
+
106
+ template 'templates/resource/controller/BaseController.java.erb',
107
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/controller/BaseController.java" unless File.exist?("#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/controller/BaseController.java")
108
+
109
+ template(
110
+ 'templates/resource/controller/Controller.java.erb',
111
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/controller/#{@model_name}Controller.java")
112
+
113
+ template 'templates/resource/assembler/BaseAssembler.java.erb',
114
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/assembler/BaseAssembler.java" unless File.exist?("#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/assembler/BaseAssembler.java")
115
+ template(
116
+ 'templates/resource/assembler/Assembler.java.erb',
117
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/assembler/#{@model_name}Assembler.java")
118
+
119
+ template(
120
+ 'templates/resource/resource/Resource.java.erb',
121
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/resource/#{@model_name}Resource.java")
122
+
123
+ template 'templates/resource/exception/NotCreatedException.java.erb',
124
+ "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/exception/NotCreatedException.java" unless File.exist? "#{content_root}/src/main/java/#{@group_id.gsub(".","/")}/exception/NotCreatedException.java"
125
+
126
+ end
127
+ end
128
+
129
+ end
@@ -0,0 +1,53 @@
1
+ require 'thor/group'
2
+ require 'thor'
3
+ require 'git'
4
+
5
+
6
+ class Service < Thor::Group
7
+ include Thor::Actions
8
+
9
+ argument :name, :type => :string, :desc => 'Microservice name'
10
+
11
+ class_option :repository_technique,
12
+ :type => :string,
13
+ :desc => 'repository technique',
14
+ :aliases => 'r',
15
+ :required => false
16
+
17
+ def self.source_root
18
+ File.expand_path('../',__dir__)
19
+ end
20
+
21
+ def prepare_artifact
22
+ parts = @name.split(".")
23
+ @name = @artifact_id = parts.pop
24
+ @group_id = parts.length > 0 ? parts.join('.') : @name
25
+ end
26
+
27
+ def init_git
28
+ g = Git.init @name
29
+ @user_name = g.config['user.name']
30
+ @user_email = g.config['user.email']
31
+ end
32
+
33
+ # TODO evtl. für andere entwicklugnsumgebungen erweitern.
34
+
35
+ def create_layout
36
+
37
+ @repository_technique = options['repository_technique'] || 'jpa'
38
+
39
+ #TODO templates vervollständigen.
40
+ directory 'templates/layout/intellij/config',"#{@name}/config"
41
+
42
+ template 'templates/layout/src/java/main/App.java.erb',"#{@name}/src/main/java/#{@group_id.gsub(".","/")}/main/App.java"
43
+ template 'templates/layout/src/java/config/AppConfig.java.erb',"#{@name}/src/main/java/#{@group_id.gsub(".","/")}/config/AppConfig.java"
44
+ copy_file 'templates/layout/.gitignore',"#{@name}/.gitignore"
45
+ template 'templates/layout/src/resources/application.yml.erb',"#{@name}/src/main/resources/application.yml"
46
+ template 'templates/layout/src/resources/bootstrap.yml.erb',"#{@name}/src/main/resources/bootstrap.yml"
47
+ template 'templates/layout/build.gradle.erb',"#{@name}/build.gradle"
48
+ template 'templates/service.yml.erb',"#{@name}/service.yml"
49
+ end
50
+
51
+
52
+
53
+ end
@@ -0,0 +1,3 @@
1
+ module SpringGen
2
+ VERSION = "0.1.0"
3
+ end
data/lib/spring-gen.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "spring-gen/version"
2
+
3
+ module SpringGen
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,36 @@
1
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
2
+ *.iml
3
+ ## Directory-based project format:
4
+ .idea/
5
+ # if you remove the above rule, at least ignore the following:
6
+
7
+ **/.DS_store
8
+
9
+ build/*
10
+
11
+ .gradle
12
+
13
+ testdb/*
14
+
15
+ **/testdb/*
16
+
17
+
18
+ ## File-based project format:
19
+ *.ipr
20
+ *.iws
21
+
22
+ ## Plugin-specific files:
23
+
24
+ # IntelliJ
25
+ /out/
26
+
27
+ # mpeltonen/sbt-idea plugin
28
+ .idea_modules/
29
+
30
+ # JIRA plugin
31
+ atlassian-ide-plugin.xml
32
+
33
+ # Crashlytics plugin (for Android Studio and IntelliJ)
34
+ com_crashlytics_export_strings.xml
35
+ crashlytics.properties
36
+ crashlytics-build.properties
@@ -0,0 +1,105 @@
1
+ /*
2
+ * Copyright (c) 2015 <%=@user_name%>.
3
+ * This program is free software; you can redistribute it and/or modify
4
+ * it under the terms of the GNU General Public License as published by
5
+ * the Free Software Foundation; either version 3 of the License, or
6
+ * (at your option) any later version.
7
+ * This program is distributed in the hope that it will be useful,
8
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ * GNU General Public License for more details.
11
+ * You should have received a copy of the GNU General Public License
12
+ * along with this program; if not, write to the Free Software Foundation,
13
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
+ */
15
+
16
+ buildscript {
17
+ repositories {
18
+ mavenCentral()
19
+ }
20
+ dependencies {
21
+ classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE")
22
+ }
23
+ }
24
+
25
+ repositories {
26
+ mavenCentral()
27
+
28
+ maven {
29
+ url 'http://repo.spring.io/libs-snapshot-continuous-local'
30
+ }
31
+ maven {
32
+ url 'http://maven.springframework.org/milestone/'
33
+ }
34
+
35
+ maven {
36
+ url 'http://repo.spring.io/libs-snapshot'
37
+ }
38
+
39
+
40
+
41
+ }
42
+
43
+
44
+ apply plugin: 'java'
45
+ apply plugin: 'idea'
46
+ apply plugin: 'spring-boot'
47
+ apply plugin: "checkstyle"
48
+
49
+ checkstyle{
50
+ checkstyle {
51
+ toolVersion = "6.6"
52
+ }
53
+ }
54
+
55
+ task checkstyle(type: Checkstyle) {
56
+ configFile file("config/checkstyle/checkstyle.xml")
57
+ source './'
58
+ include '**/*.java'
59
+ classpath = files()
60
+ }
61
+
62
+
63
+
64
+ sourceCompatibility = 1.8
65
+ targetCompatibility = 1.8
66
+
67
+ dependencies {
68
+ compile("org.springframework.boot:spring-boot-starter-web")
69
+ compile("org.springframework.boot:spring-boot-starter-tomcat")
70
+ compile("org.springframework.boot:spring-boot-starter-data-rest")
71
+ compile("org.springframework.boot:spring-boot-starter-data-<%=@repository_technique%>")
72
+
73
+
74
+ compile("org.springframework.amqp:spring-rabbit")
75
+
76
+ compile 'org.springframework.cloud:spring-cloud-starter-eureka:1.0.1.RELEASE'
77
+
78
+ compile 'org.springframework.hateoas:spring-hateoas'
79
+
80
+ compile 'org.apache.commons:commons-lang3:3.4'
81
+
82
+ <%if @repository_technique == "jpa"%>
83
+ compile 'com.h2database:h2:1.4.187'
84
+ testCompile "org.dbunit:dbunit:2.5.0"
85
+ testCompile "com.github.springtestdbunit:spring-test-dbunit:1.2.1"
86
+ <%elsif @repository_technique == "mongodb"%>
87
+ testCompile 'com.github.fakemongo:fongo:1.6.2'
88
+ <%elsif @repository_technique == "neo4j"%>
89
+
90
+ <%end%>
91
+
92
+
93
+ testCompile "org.springframework:spring-test:4.1.6.RELEASE"
94
+ testCompile "org.mockito:mockito-core:1.9.5"
95
+ testCompile "org.hamcrest:hamcrest-all:1.3"
96
+ testCompile "com.jayway.jsonpath:json-path-assert:2.0.0"
97
+ testCompile("junit:junit")
98
+
99
+
100
+
101
+ }
102
+
103
+ task wrapper(type: Wrapper) {
104
+ gradleVersion = '2.3'
105
+ }