vraptor-scaffold 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.travis.yml +7 -0
  2. data/CHANGELOG.rdoc +164 -0
  3. data/Gemfile.lock +5 -8
  4. data/README.textile +20 -7
  5. data/bin/vraptor +1 -1
  6. data/index.sample.html +169 -0
  7. data/lib/vraptor-scaffold.rb +10 -29
  8. data/lib/vraptor-scaffold/configuration.rb +27 -4
  9. data/lib/vraptor-scaffold/execution.rb +24 -0
  10. data/lib/vraptor-scaffold/generators/app/app_generator.rb +196 -0
  11. data/lib/vraptor-scaffold/generators/{app_generator → app}/dependency.rb +0 -0
  12. data/lib/vraptor-scaffold/generators/app/dependency_manager.rb +53 -0
  13. data/lib/vraptor-scaffold/generators/{app_generator → app}/freemarker_template_engine.rb +0 -0
  14. data/lib/vraptor-scaffold/generators/{app_generator → app}/jsp_template_engine.rb +0 -0
  15. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/build.gradle.erb +19 -1
  16. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/build.properties.erb +0 -0
  17. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/build.xml +6 -2
  18. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/decorators.erb +0 -0
  19. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/classpath.erb +0 -5
  20. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/project.erb +0 -0
  21. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.jdt.core.prefs +0 -0
  22. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.common.component.tt +0 -0
  23. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.common.project.facet.core.xml +0 -0
  24. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.container +0 -0
  25. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.name +0 -0
  26. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/freemarker-web.xml +0 -0
  27. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/infrastructure/FreemarkerPathResolver.java.tt +0 -0
  28. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/macros/html.ftl +0 -0
  29. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker/main.ftl +0 -0
  30. data/lib/vraptor-scaffold/generators/app/templates/heroku/Main.java +21 -0
  31. data/lib/vraptor-scaffold/generators/app/templates/heroku/Procfile +1 -0
  32. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/ivy-2.2.0.jar +0 -0
  33. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/ivy.erb +1 -1
  34. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/jsp/jsp-web.xml +0 -0
  35. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/jsp/main.jsp +2 -2
  36. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/jsp/prelude.jspf +0 -0
  37. data/lib/vraptor-scaffold/generators/{app_generator/templates/src/models/Entity.java.tt → app/templates/models/Entity.erb} +1 -1
  38. data/lib/vraptor-scaffold/generators/app/templates/orm/Repository-hibernate.java.tt +50 -0
  39. data/lib/vraptor-scaffold/generators/{app_generator/templates/src/repositories/Repository.java.tt → app/templates/orm/Repository-jpa.java.tt} +3 -3
  40. data/lib/vraptor-scaffold/generators/app/templates/orm/hibernate.cfg.xml +7 -0
  41. data/lib/vraptor-scaffold/generators/app/templates/orm/persistence.xml +10 -0
  42. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/pom.erb +29 -13
  43. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/resources-test/.empty_directory +0 -0
  44. data/lib/vraptor-scaffold/generators/app/templates/resources/hibernate.properties +16 -0
  45. data/lib/vraptor-scaffold/generators/app/templates/resources/log4j.properties +4 -0
  46. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/resources/messages.properties +0 -0
  47. data/lib/vraptor-scaffold/generators/app/templates/vraptor-scaffold.erb +7 -0
  48. data/lib/vraptor-scaffold/generators/{app_generator/templates/webapp/WEB-INF/web.xml → app/templates/webapp/WEB-INF/web.xml.tt} +2 -2
  49. data/lib/vraptor-scaffold/generators/{app_generator/templates/src-test/controllers → app/templates/webapp/images}/.empty_directory +0 -0
  50. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/index.jsp +0 -0
  51. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/stylesheets/common.css +0 -0
  52. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/stylesheets/scaffold.css +0 -0
  53. data/lib/vraptor-scaffold/generators/{app_generator → app}/templates/webapp/stylesheets/stylesheets.css +0 -0
  54. data/lib/vraptor-scaffold/generators/plugin/plugin_generator.rb +42 -0
  55. data/lib/vraptor-scaffold/generators/plugin/vraptor_gem.rb +36 -0
  56. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/attribute.rb +1 -1
  57. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/base_scaffold.rb +6 -2
  58. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/controller_generator.rb +3 -3
  59. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/templates/controller.erb +3 -3
  60. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/templates/controller_test.erb +1 -1
  61. data/lib/vraptor-scaffold/generators/scaffold/model_generator/model_generator.rb +20 -0
  62. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/model_generator/templates/model.erb +3 -3
  63. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/model_generator/templates/model_test.erb +1 -1
  64. data/lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb +27 -0
  65. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/repository.erb +3 -3
  66. data/lib/vraptor-scaffold/generators/scaffold/repository_generator/templates/repository_impl.erb +16 -0
  67. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/repository_test.erb +1 -1
  68. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold}/scaffold_generator.rb +0 -0
  69. data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/freemarker_generator.rb +18 -0
  70. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/freemarker_generator/templates/edit.erb +0 -0
  71. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/freemarker_generator/templates/form.erb +4 -4
  72. data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/templates/index.erb +36 -0
  73. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/freemarker_generator/templates/new.erb +0 -0
  74. data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/freemarker_generator/templates/show.erb +14 -0
  75. data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/jsp_generator/jsp_generator.rb +18 -0
  76. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/edit.erb +0 -0
  77. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/form.erb +4 -4
  78. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/index.erb +6 -6
  79. data/lib/vraptor-scaffold/generators/{scaffold_generator → scaffold/template_engine_generator}/jsp_generator/templates/new.erb +0 -0
  80. data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/jsp_generator/templates/show.erb +14 -0
  81. data/lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb +21 -0
  82. data/lib/vraptor-scaffold/load_paths.rb +13 -21
  83. data/lib/vraptor-scaffold/runner.rb +11 -0
  84. data/lib/vraptor-scaffold/runner/commands_help.rb +13 -0
  85. data/lib/vraptor-scaffold/runner/configure.rb +21 -0
  86. data/lib/vraptor-scaffold/runner/generator.rb +15 -0
  87. data/lib/vraptor-scaffold/runner/help.rb +12 -0
  88. data/lib/vraptor-scaffold/runner/plugin.rb +19 -0
  89. data/lib/vraptor-scaffold/runner/scaffold.rb +16 -0
  90. data/lib/vraptor-scaffold/version.rb +1 -1
  91. data/spec/resources/vraptor-scaffold.properties +5 -0
  92. data/spec/simple_custom_plugin.rb +10 -0
  93. data/spec/spec_helper.rb +5 -6
  94. data/spec/vraptor-scaffold/configuration_spec.rb +88 -4
  95. data/spec/vraptor-scaffold/execution_spec.rb +47 -0
  96. data/spec/vraptor-scaffold/generators/{app_generator → app}/app_generator_spec.rb +136 -54
  97. data/spec/vraptor-scaffold/generators/{app_generator → app}/dependency_manager_spec.rb +1 -1
  98. data/spec/vraptor-scaffold/generators/{app_generator → app}/dependency_spec.rb +0 -0
  99. data/spec/vraptor-scaffold/generators/{app_generator → app}/freemarker_template_engine_spec.rb +1 -1
  100. data/spec/vraptor-scaffold/generators/{app_generator → app}/jsp_template_engine_spec.rb +0 -0
  101. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/Entity.java +1 -1
  102. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/FreemarkerPathResolver.java +0 -0
  103. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/Repository.java +3 -3
  104. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/build.gradle +24 -5
  105. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/build.properties +0 -0
  106. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/decorators-jsp.xml +0 -0
  107. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/decorators.xml +0 -0
  108. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/freemarker-web.xml +2 -2
  109. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/ivy.xml +6 -5
  110. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/jsp-web.xml +1 -1
  111. data/spec/vraptor-scaffold/generators/app/templates/pom-heroku.xml +168 -0
  112. data/spec/vraptor-scaffold/generators/{app_generator → app}/templates/pom.xml +11 -14
  113. data/spec/vraptor-scaffold/generators/app/templates/vraptor-scaffold.properties +7 -0
  114. data/spec/vraptor-scaffold/generators/plugin/expected_configs/build.gradle +61 -0
  115. data/spec/vraptor-scaffold/generators/plugin/expected_configs/default_org_build.gradle +61 -0
  116. data/spec/vraptor-scaffold/generators/plugin/expected_configs/default_org_ivy.xml +40 -0
  117. data/spec/vraptor-scaffold/generators/plugin/expected_configs/default_org_pom.xml +147 -0
  118. data/spec/vraptor-scaffold/generators/plugin/expected_configs/ivy.xml +40 -0
  119. data/spec/vraptor-scaffold/generators/plugin/expected_configs/pom.xml +147 -0
  120. data/spec/vraptor-scaffold/generators/plugin/plugin_generator_spec.rb +130 -0
  121. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/attribute_spec.rb +13 -9
  122. data/spec/vraptor-scaffold/generators/scaffold/base_scaffold_spec.rb +73 -0
  123. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/controller_generator_spec.rb +18 -9
  124. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/controller_generator/templates/ProductController.java +3 -3
  125. data/spec/vraptor-scaffold/generators/scaffold/freemarker_generator/freemarker_generator_spec.rb +74 -0
  126. data/spec/vraptor-scaffold/generators/scaffold/jsp_generator/jsp_generator_spec.rb +75 -0
  127. data/spec/vraptor-scaffold/generators/scaffold/model_generator/model_generator_spec.rb +50 -0
  128. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/model_generator/templates/Product.java +6 -6
  129. data/spec/vraptor-scaffold/generators/scaffold/model_generator/templates/hibernate.cfg.xml +8 -0
  130. data/spec/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator_spec.rb +60 -0
  131. data/spec/vraptor-scaffold/generators/scaffold/repository_generator/templates/ClientRepository.java +22 -0
  132. data/spec/vraptor-scaffold/generators/scaffold/repository_generator/templates/ClientRepositoryImpl.java +16 -0
  133. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/ProductRepository.java +3 -3
  134. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/repository_generator/templates/ProductRepositoryImpl.java +3 -3
  135. data/spec/vraptor-scaffold/generators/{scaffold_generator → scaffold}/scaffold_generator_spec.rb +0 -0
  136. data/spec/vraptor-scaffold/runner/commands_help_spec.rb +12 -0
  137. data/spec/vraptor-scaffold/runner/configure_spec.rb +12 -0
  138. data/spec/vraptor-scaffold/runner/generator_spec.rb +31 -0
  139. data/spec/vraptor-scaffold/runner/help_spec.rb +29 -0
  140. data/spec/vraptor-scaffold/runner/plugin_spec.rb +45 -0
  141. data/spec/vraptor-scaffold/runner/scaffold_spec.rb +35 -0
  142. data/spec/vraptor-scaffold_spec.rb +1 -94
  143. data/vraptor-scaffold.gemspec +3 -3
  144. metadata +137 -140
  145. data/History.txt +0 -128
  146. data/lib/vraptor-scaffold/generators/app_generator/app_generator.rb +0 -102
  147. data/lib/vraptor-scaffold/generators/app_generator/dependency_manager.rb +0 -37
  148. data/lib/vraptor-scaffold/generators/app_generator/templates/ivysettings.xml +0 -9
  149. data/lib/vraptor-scaffold/generators/app_generator/templates/resources/META-INF/persistence.xml +0 -20
  150. data/lib/vraptor-scaffold/generators/app_generator/templates/resources/log4j.properties +0 -4
  151. data/lib/vraptor-scaffold/generators/app_generator/templates/src-test/models/.empty_directory +0 -0
  152. data/lib/vraptor-scaffold/generators/app_generator/templates/src-test/repositories/.empty_directory +0 -0
  153. data/lib/vraptor-scaffold/generators/app_generator/templates/src/controllers/.empty_directory +0 -0
  154. data/lib/vraptor-scaffold/generators/app_generator/templates/vraptor-scaffold.erb +0 -2
  155. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/images/.empty_directory +0 -0
  156. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/javascripts/application.js +0 -0
  157. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/javascripts/jquery.min.js +0 -16
  158. data/lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb +0 -22
  159. data/lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/templates/index.erb +0 -36
  160. data/lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/templates/show.erb +0 -14
  161. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/jsp_generator.rb +0 -22
  162. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/show.erb +0 -14
  163. data/lib/vraptor-scaffold/generators/scaffold_generator/model_generator/model_generator.rb +0 -11
  164. data/lib/vraptor-scaffold/generators/scaffold_generator/repository_generator/repository_generator.rb +0 -12
  165. data/lib/vraptor-scaffold/generators/scaffold_generator/repository_generator/templates/repository_impl.erb +0 -16
  166. data/spec/vraptor-scaffold/generators/scaffold_generator/base_scaffold_spec.rb +0 -41
  167. data/spec/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/freemarker_generator_spec.rb +0 -36
  168. data/spec/vraptor-scaffold/generators/scaffold_generator/jsp_generator/jsp_generator_spec.rb +0 -34
  169. data/spec/vraptor-scaffold/generators/scaffold_generator/model_generator/model_generator_spec.rb +0 -25
  170. data/spec/vraptor-scaffold/generators/scaffold_generator/repository_generator/repository_generator_spec.rb +0 -31
@@ -0,0 +1,61 @@
1
+ repositories {
2
+ mavenCentral()
3
+ }
4
+
5
+ apply plugin: 'java'
6
+ apply plugin: 'war'
7
+ apply plugin: 'jetty'
8
+ apply plugin: 'eclipse'
9
+ apply plugin: 'project-report'
10
+
11
+ sourceCompatibility = 1.6
12
+ targetCompatibility = 1.6
13
+ version = '1.0'
14
+
15
+ sourceSets {
16
+ main {
17
+ java {
18
+ srcDir 'src/main/java'
19
+ }
20
+ resources {
21
+ srcDir 'src/main/resources'
22
+ }
23
+ }
24
+ test {
25
+ java {
26
+ srcDir 'src/test/java'
27
+ }
28
+ resources {
29
+ srcDir 'src/test/resources'
30
+ }
31
+ }
32
+ }
33
+
34
+ sourceSets.main.classesDir = new File('src/main/webapp/WEB-INF/classes')
35
+
36
+ jettyRun.scanIntervalSeconds=3
37
+ jettyRun.contextPath = '/'
38
+ [jettyRunWar,jettyStop]*.stopPort = 8081
39
+ [jettyRunWar,jettyStop]*.stopKey = 'stopKey'
40
+
41
+ dependencies {
42
+ compile group: 'br.com.caelum.vraptor', name: 'vraptor-environment', version: '0.0.8'
43
+
44
+ compile group: 'br.com.caelum', name: 'vraptor', version: '3.3.1'
45
+ compile group: 'org.hsqldb', name: 'hsqldb', version: '2.2.4'
46
+ compile group: 'opensymphony', name: 'sitemesh', version: '2.4.2'
47
+ compile group: 'javax.servlet', name: 'jstl', version: '1.2'
48
+ compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '3.6.7.Final'
49
+ compile group: 'org.hibernate', name: 'hibernate-c3p0', version: '3.6.7.Final'
50
+ compile group: 'org.hibernate', name: 'hibernate-validator', version: '4.2.0.Final'
51
+ compile group: 'joda-time', name: 'joda-time', version: '2.0'
52
+
53
+ //Provided dependencies
54
+ providedCompile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
55
+ providedCompile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.1'
56
+
57
+ //Test dependencies
58
+ testCompile group: 'junit', name: 'junit', version: '4.8.2'
59
+ testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.1'
60
+ testCompile group: 'org.mockito', name: 'mockito-all', version: '1.8.5'
61
+ }
@@ -0,0 +1,40 @@
1
+ <ivy-module version="2.0">
2
+ <info organisation="ant" module="ant" />
3
+
4
+ <configurations>
5
+ <conf name="default" description="dependencies used for compile" />
6
+ <conf name="provided" description="dependencies used for compile but is not packaged" visibility="public" />
7
+ <conf name="test" description="dependencies used for tests" visibility="public" />
8
+ <conf name="jetty" description="dependencies used for jetty" visibility="public" />
9
+ <conf name="minify" description="dependencies used to minify js and css" visibility="public" />
10
+ </configurations>
11
+
12
+ <dependencies>
13
+ <dependency org="br.com.caelum.vraptor" name="vraptor-environment" rev="0.0.8" conf="default" />
14
+ <dependency org="br.com.caelum" name="vraptor" rev="3.3.1" conf="default" />
15
+ <dependency org="org.hsqldb" name="hsqldb" rev="2.2.4" conf="default" />
16
+ <dependency org="opensymphony" name="sitemesh" rev="2.4.2" conf="default" />
17
+ <dependency org="javax.servlet" name="jstl" rev="1.2" conf="default" />
18
+ <dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.6.7.Final" conf="default" />
19
+ <dependency org="org.hibernate" name="hibernate-c3p0" rev="3.6.7.Final" conf="default" />
20
+ <dependency org="org.hibernate" name="hibernate-validator" rev="4.2.0.Final" conf="default" />
21
+ <dependency org="joda-time" name="joda-time" rev="2.0" conf="default" />
22
+
23
+ <!-- Provided dependencies -->
24
+ <dependency org="javax.servlet" name="servlet-api" rev="2.5" conf="provided->default" />
25
+ <dependency org="javax.servlet.jsp" name="jsp-api" rev="2.1" conf="provided->default" />
26
+
27
+ <!-- Test dependencies -->
28
+ <dependency org="junit" name="junit" rev="4.8.2" conf="test->default" />
29
+ <dependency org="org.hamcrest" name="hamcrest-all" rev="1.1" conf="test->default" />
30
+ <dependency org="org.mockito" name="mockito-all" rev="1.8.5" conf="test->default" />
31
+
32
+ <!-- Jetty dependencies -->
33
+ <dependency org="org.mortbay.jetty" name="jsp-api-2.1" rev="6.1.14" conf="jetty->default" />
34
+ <dependency org="org.mortbay.jetty" name="jsp-2.1" rev="6.1.14" conf="jetty->default" />
35
+ <dependency org="org.mortbay.jetty" name="jetty-ant" rev="6.1.14" conf="jetty->default" />
36
+
37
+ <!-- Minify dependencies -->
38
+ <dependency org="com.yahoo.platform.yui" name="yuicompressor" rev="2.3.6" conf="minify->default" />
39
+ </dependencies>
40
+ </ivy-module>
@@ -0,0 +1,147 @@
1
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>maven</groupId>
5
+ <artifactId>maven</artifactId>
6
+ <packaging>war</packaging>
7
+ <version>0.0.1-SNAPSHOT</version>
8
+ <name>maven</name>
9
+
10
+ <properties>
11
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12
+ </properties>
13
+
14
+ <build>
15
+ <outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory>
16
+ <plugins>
17
+ <plugin>
18
+ <artifactId>maven-compiler-plugin</artifactId>
19
+ <version>2.3.2</version>
20
+ <configuration>
21
+ <source>1.6</source>
22
+ <target>1.6</target>
23
+ <encoding>UTF-8</encoding>
24
+ </configuration>
25
+ </plugin>
26
+ <plugin>
27
+ <artifactId>maven-eclipse-plugin</artifactId>
28
+ <version>2.8</version>
29
+ <configuration>
30
+ <downloadSources>true</downloadSources>
31
+ <downloadJavadocs>true</downloadJavadocs>
32
+ <wtpversion>2.0</wtpversion>
33
+ </configuration>
34
+ </plugin>
35
+ <plugin>
36
+ <groupId>org.apache.maven.plugins</groupId>
37
+ <artifactId>maven-war-plugin</artifactId>
38
+ <version>2.1.1</version>
39
+ </plugin>
40
+ <plugin>
41
+ <groupId>org.mortbay.jetty</groupId>
42
+ <artifactId>maven-jetty-plugin</artifactId>
43
+ <version>6.1.14</version>
44
+ <configuration>
45
+ <scanIntervalSeconds>3</scanIntervalSeconds>
46
+ <stopKey>foo</stopKey>
47
+ <stopPort>9999</stopPort>
48
+ <webAppConfig>
49
+ <contextPath>/</contextPath>
50
+ </webAppConfig>
51
+ </configuration>
52
+ </plugin>
53
+ </plugins>
54
+ </build>
55
+
56
+ <dependencies>
57
+ <dependency>
58
+ <groupId>br.com.caelum.vraptor</groupId>
59
+ <artifactId>vraptor-environment</artifactId>
60
+ <version>0.0.8</version>
61
+ </dependency>
62
+ <dependency>
63
+ <groupId>br.com.caelum</groupId>
64
+ <artifactId>vraptor</artifactId>
65
+ <version>3.3.1</version>
66
+ </dependency>
67
+ <dependency>
68
+ <groupId>org.hsqldb</groupId>
69
+ <artifactId>hsqldb</artifactId>
70
+ <version>2.2.4</version>
71
+ </dependency>
72
+ <dependency>
73
+ <groupId>opensymphony</groupId>
74
+ <artifactId>sitemesh</artifactId>
75
+ <version>2.4.2</version>
76
+ </dependency>
77
+ <dependency>
78
+ <groupId>javax.servlet</groupId>
79
+ <artifactId>jstl</artifactId>
80
+ <version>1.2</version>
81
+ </dependency>
82
+ <dependency>
83
+ <groupId>org.hibernate</groupId>
84
+ <artifactId>hibernate-entitymanager</artifactId>
85
+ <version>3.6.7.Final</version>
86
+ </dependency>
87
+ <dependency>
88
+ <groupId>org.hibernate</groupId>
89
+ <artifactId>hibernate-c3p0</artifactId>
90
+ <version>3.6.7.Final</version>
91
+ </dependency>
92
+ <dependency>
93
+ <groupId>org.hibernate</groupId>
94
+ <artifactId>hibernate-validator</artifactId>
95
+ <version>4.2.0.Final</version>
96
+ </dependency>
97
+ <dependency>
98
+ <groupId>joda-time</groupId>
99
+ <artifactId>joda-time</artifactId>
100
+ <version>2.0</version>
101
+ </dependency>
102
+
103
+ <!-- Test dependencies -->
104
+ <dependency>
105
+ <groupId>junit</groupId>
106
+ <artifactId>junit</artifactId>
107
+ <version>4.8.2</version>
108
+ <scope>test</scope>
109
+ </dependency>
110
+ <dependency>
111
+ <groupId>org.hamcrest</groupId>
112
+ <artifactId>hamcrest-all</artifactId>
113
+ <version>1.1</version>
114
+ <scope>test</scope>
115
+ </dependency>
116
+ <dependency>
117
+ <groupId>org.mockito</groupId>
118
+ <artifactId>mockito-all</artifactId>
119
+ <version>1.8.5</version>
120
+ <scope>test</scope>
121
+ </dependency>
122
+
123
+ <!-- Provided dependencies -->
124
+ <dependency>
125
+ <groupId>javax.servlet</groupId>
126
+ <artifactId>servlet-api</artifactId>
127
+ <version>2.5</version>
128
+ <scope>provided</scope>
129
+ </dependency>
130
+ <dependency>
131
+ <groupId>javax.servlet.jsp</groupId>
132
+ <artifactId>jsp-api</artifactId>
133
+ <version>2.1</version>
134
+ <scope>provided</scope>
135
+ </dependency>
136
+ </dependencies>
137
+
138
+ <reporting>
139
+ <plugins>
140
+ <plugin>
141
+ <groupId>org.codehaus.mojo</groupId>
142
+ <artifactId>cobertura-maven-plugin</artifactId>
143
+ <version>2.5.1</version>
144
+ </plugin>
145
+ </plugins>
146
+ </reporting>
147
+ </project>
@@ -0,0 +1,40 @@
1
+ <ivy-module version="2.0">
2
+ <info organisation="ant" module="ant" />
3
+
4
+ <configurations>
5
+ <conf name="default" description="dependencies used for compile" />
6
+ <conf name="provided" description="dependencies used for compile but is not packaged" visibility="public" />
7
+ <conf name="test" description="dependencies used for tests" visibility="public" />
8
+ <conf name="jetty" description="dependencies used for jetty" visibility="public" />
9
+ <conf name="minify" description="dependencies used to minify js and css" visibility="public" />
10
+ </configurations>
11
+
12
+ <dependencies>
13
+ <dependency org="br.com.caelum.vraptor.plugin" name="vraptor-environment" rev="0.0.8" conf="default" />
14
+ <dependency org="br.com.caelum" name="vraptor" rev="3.3.1" conf="default" />
15
+ <dependency org="org.hsqldb" name="hsqldb" rev="2.2.4" conf="default" />
16
+ <dependency org="opensymphony" name="sitemesh" rev="2.4.2" conf="default" />
17
+ <dependency org="javax.servlet" name="jstl" rev="1.2" conf="default" />
18
+ <dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.6.7.Final" conf="default" />
19
+ <dependency org="org.hibernate" name="hibernate-c3p0" rev="3.6.7.Final" conf="default" />
20
+ <dependency org="org.hibernate" name="hibernate-validator" rev="4.2.0.Final" conf="default" />
21
+ <dependency org="joda-time" name="joda-time" rev="2.0" conf="default" />
22
+
23
+ <!-- Provided dependencies -->
24
+ <dependency org="javax.servlet" name="servlet-api" rev="2.5" conf="provided->default" />
25
+ <dependency org="javax.servlet.jsp" name="jsp-api" rev="2.1" conf="provided->default" />
26
+
27
+ <!-- Test dependencies -->
28
+ <dependency org="junit" name="junit" rev="4.8.2" conf="test->default" />
29
+ <dependency org="org.hamcrest" name="hamcrest-all" rev="1.1" conf="test->default" />
30
+ <dependency org="org.mockito" name="mockito-all" rev="1.8.5" conf="test->default" />
31
+
32
+ <!-- Jetty dependencies -->
33
+ <dependency org="org.mortbay.jetty" name="jsp-api-2.1" rev="6.1.14" conf="jetty->default" />
34
+ <dependency org="org.mortbay.jetty" name="jsp-2.1" rev="6.1.14" conf="jetty->default" />
35
+ <dependency org="org.mortbay.jetty" name="jetty-ant" rev="6.1.14" conf="jetty->default" />
36
+
37
+ <!-- Minify dependencies -->
38
+ <dependency org="com.yahoo.platform.yui" name="yuicompressor" rev="2.3.6" conf="minify->default" />
39
+ </dependencies>
40
+ </ivy-module>
@@ -0,0 +1,147 @@
1
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>maven</groupId>
5
+ <artifactId>maven</artifactId>
6
+ <packaging>war</packaging>
7
+ <version>0.0.1-SNAPSHOT</version>
8
+ <name>maven</name>
9
+
10
+ <properties>
11
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12
+ </properties>
13
+
14
+ <build>
15
+ <outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory>
16
+ <plugins>
17
+ <plugin>
18
+ <artifactId>maven-compiler-plugin</artifactId>
19
+ <version>2.3.2</version>
20
+ <configuration>
21
+ <source>1.6</source>
22
+ <target>1.6</target>
23
+ <encoding>UTF-8</encoding>
24
+ </configuration>
25
+ </plugin>
26
+ <plugin>
27
+ <artifactId>maven-eclipse-plugin</artifactId>
28
+ <version>2.8</version>
29
+ <configuration>
30
+ <downloadSources>true</downloadSources>
31
+ <downloadJavadocs>true</downloadJavadocs>
32
+ <wtpversion>2.0</wtpversion>
33
+ </configuration>
34
+ </plugin>
35
+ <plugin>
36
+ <groupId>org.apache.maven.plugins</groupId>
37
+ <artifactId>maven-war-plugin</artifactId>
38
+ <version>2.1.1</version>
39
+ </plugin>
40
+ <plugin>
41
+ <groupId>org.mortbay.jetty</groupId>
42
+ <artifactId>maven-jetty-plugin</artifactId>
43
+ <version>6.1.14</version>
44
+ <configuration>
45
+ <scanIntervalSeconds>3</scanIntervalSeconds>
46
+ <stopKey>foo</stopKey>
47
+ <stopPort>9999</stopPort>
48
+ <webAppConfig>
49
+ <contextPath>/</contextPath>
50
+ </webAppConfig>
51
+ </configuration>
52
+ </plugin>
53
+ </plugins>
54
+ </build>
55
+
56
+ <dependencies>
57
+ <dependency>
58
+ <groupId>br.com.caelum.vraptor.plugin</groupId>
59
+ <artifactId>vraptor-environment</artifactId>
60
+ <version>0.0.8</version>
61
+ </dependency>
62
+ <dependency>
63
+ <groupId>br.com.caelum</groupId>
64
+ <artifactId>vraptor</artifactId>
65
+ <version>3.3.1</version>
66
+ </dependency>
67
+ <dependency>
68
+ <groupId>org.hsqldb</groupId>
69
+ <artifactId>hsqldb</artifactId>
70
+ <version>2.2.4</version>
71
+ </dependency>
72
+ <dependency>
73
+ <groupId>opensymphony</groupId>
74
+ <artifactId>sitemesh</artifactId>
75
+ <version>2.4.2</version>
76
+ </dependency>
77
+ <dependency>
78
+ <groupId>javax.servlet</groupId>
79
+ <artifactId>jstl</artifactId>
80
+ <version>1.2</version>
81
+ </dependency>
82
+ <dependency>
83
+ <groupId>org.hibernate</groupId>
84
+ <artifactId>hibernate-entitymanager</artifactId>
85
+ <version>3.6.7.Final</version>
86
+ </dependency>
87
+ <dependency>
88
+ <groupId>org.hibernate</groupId>
89
+ <artifactId>hibernate-c3p0</artifactId>
90
+ <version>3.6.7.Final</version>
91
+ </dependency>
92
+ <dependency>
93
+ <groupId>org.hibernate</groupId>
94
+ <artifactId>hibernate-validator</artifactId>
95
+ <version>4.2.0.Final</version>
96
+ </dependency>
97
+ <dependency>
98
+ <groupId>joda-time</groupId>
99
+ <artifactId>joda-time</artifactId>
100
+ <version>2.0</version>
101
+ </dependency>
102
+
103
+ <!-- Test dependencies -->
104
+ <dependency>
105
+ <groupId>junit</groupId>
106
+ <artifactId>junit</artifactId>
107
+ <version>4.8.2</version>
108
+ <scope>test</scope>
109
+ </dependency>
110
+ <dependency>
111
+ <groupId>org.hamcrest</groupId>
112
+ <artifactId>hamcrest-all</artifactId>
113
+ <version>1.1</version>
114
+ <scope>test</scope>
115
+ </dependency>
116
+ <dependency>
117
+ <groupId>org.mockito</groupId>
118
+ <artifactId>mockito-all</artifactId>
119
+ <version>1.8.5</version>
120
+ <scope>test</scope>
121
+ </dependency>
122
+
123
+ <!-- Provided dependencies -->
124
+ <dependency>
125
+ <groupId>javax.servlet</groupId>
126
+ <artifactId>servlet-api</artifactId>
127
+ <version>2.5</version>
128
+ <scope>provided</scope>
129
+ </dependency>
130
+ <dependency>
131
+ <groupId>javax.servlet.jsp</groupId>
132
+ <artifactId>jsp-api</artifactId>
133
+ <version>2.1</version>
134
+ <scope>provided</scope>
135
+ </dependency>
136
+ </dependencies>
137
+
138
+ <reporting>
139
+ <plugins>
140
+ <plugin>
141
+ <groupId>org.codehaus.mojo</groupId>
142
+ <artifactId>cobertura-maven-plugin</artifactId>
143
+ <version>2.5.1</version>
144
+ </plugin>
145
+ </plugins>
146
+ </reporting>
147
+ </project>
@@ -0,0 +1,130 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")
2
+
3
+ describe PluginGenerator do
4
+
5
+ before :all do
6
+ @project_path = "test_for_plugins"
7
+
8
+ @maven_projet = "#{@project_path}/maven"
9
+ @gradle_projet = "#{@project_path}/gradle"
10
+ @ant_projet = "#{@project_path}/ant"
11
+
12
+ AppGenerator.new(@maven_projet, ["-b=mvn"]).invoke_all
13
+ AppGenerator.new(@gradle_projet, ["-b=gradle"]).invoke_all
14
+ AppGenerator.new(@ant_projet, ["-b=ant"]).invoke_all
15
+ end
16
+
17
+ after :all do
18
+ FileUtils.rm_rf(@project_path)
19
+ end
20
+
21
+ def expected_for(name)
22
+ File.join File.dirname(__FILE__), "expected_configs", name
23
+ end
24
+
25
+ it "should configure banner" do
26
+ PluginGenerator.banner.should == "vraptor plugin NAME [options]"
27
+ end
28
+
29
+ context "maven project" do
30
+
31
+ before :each do
32
+ FileUtils.chdir(@maven_projet)
33
+ @generator = PluginGenerator.new("vraptor-environment", ["-v=0.0.8"])
34
+ @generator.build
35
+ back
36
+ end
37
+
38
+ it "should inject dependency into pom.xml" do
39
+ source = expected_for "default_org_pom.xml"
40
+ destination = "#{@maven_projet}/pom.xml"
41
+ exists_and_identical?(source, destination)
42
+ end
43
+ end
44
+
45
+ context "maven project with plugin org" do
46
+
47
+ before :each do
48
+ FileUtils.chdir(@maven_projet)
49
+ @generator = PluginGenerator.new("vraptor-environment", ["-v=0.0.8", "-g=br.com.caelum.vraptor.plugin"])
50
+ @generator.build
51
+ back
52
+ end
53
+
54
+ it "should inject dependency into pom.xml" do
55
+ source = expected_for "pom.xml"
56
+ destination = "#{@maven_projet}/pom.xml"
57
+ exists_and_identical?(source, destination)
58
+ end
59
+ end
60
+
61
+ context "ant project" do
62
+
63
+ before :each do
64
+ FileUtils.chdir(@ant_projet)
65
+ @generator = PluginGenerator.new("vraptor-environment", ["-v=0.0.8"])
66
+ @generator.build
67
+ back
68
+ end
69
+
70
+ it "should inject dependency into ivy.xml" do
71
+ source = expected_for "default_org_ivy.xml"
72
+ destination = "#{@ant_projet}/ivy.xml"
73
+ exists_and_identical?(source, destination)
74
+ end
75
+ end
76
+
77
+ context "ant project with plugin org" do
78
+
79
+ before :each do
80
+ FileUtils.chdir(@ant_projet)
81
+ @generator = PluginGenerator.new("vraptor-environment", ["-v=0.0.8", "-g=br.com.caelum.vraptor.plugin"])
82
+ @generator.build
83
+ back
84
+ end
85
+
86
+ it "should inject dependency into ivy.xml" do
87
+ source = expected_for "ivy.xml"
88
+ destination = "#{@ant_projet}/ivy.xml"
89
+ exists_and_identical?(source, destination)
90
+ end
91
+ end
92
+
93
+ context "gradle project" do
94
+
95
+ before :each do
96
+ FileUtils.chdir(@gradle_projet)
97
+ @generator = PluginGenerator.new("vraptor-environment", ["-v=0.0.8"])
98
+ @generator.build
99
+ back
100
+ end
101
+
102
+ it "should inject dependency into build.gradle" do
103
+ source = expected_for "default_org_build.gradle"
104
+ destination = "#{@gradle_projet}/build.gradle"
105
+ exists_and_identical?(source, destination)
106
+ end
107
+ end
108
+
109
+ context "gradle project with plugin org" do
110
+
111
+ before :each do
112
+ FileUtils.chdir(@gradle_projet)
113
+ @generator = PluginGenerator.new("vraptor-environment", ["-v=0.0.8", "-g=br.com.caelum.vraptor.plugin"])
114
+ @generator.build
115
+ back
116
+ end
117
+
118
+ it "should inject dependency into build.gradle" do
119
+ source = expected_for "build.gradle"
120
+ destination = "#{@gradle_projet}/build.gradle"
121
+ exists_and_identical?(source, destination)
122
+ end
123
+ end
124
+
125
+ def back
126
+ FileUtils.chdir("..")
127
+ FileUtils.chdir("..")
128
+ end
129
+
130
+ end