Advertisement
Guest User

Untitled

a guest
May 17th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  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/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>demo.tomek</groupId>
  5. <artifactId>SpringMVC</artifactId>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <parent>
  8. <groupId>org.springframework.boot</groupId>
  9. <artifactId>spring-boot-starter-parent</artifactId>
  10. <version>1.3.5.RELEASE</version>
  11. </parent>
  12.  
  13. <dependencies>
  14. <dependency>
  15. <groupId>org.springframework.boot</groupId>
  16. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  17. </dependency>
  18.  
  19. <dependency>
  20. <groupId>org.springframework.boot</groupId>
  21. <artifactId>spring-boot-starter-data-jpa</artifactId>
  22. </dependency>
  23. <dependency>
  24. <groupId>mysql</groupId>
  25. <artifactId>mysql-connector-java</artifactId>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.hibernate</groupId>
  29. <artifactId>hibernate-core</artifactId>
  30. </dependency>
  31. <dependency>
  32. <groupId>org.hibernate</groupId>
  33. <artifactId>hibernate-entitymanager</artifactId>
  34. </dependency>
  35.  
  36. <dependency>
  37. <groupId>org.springframework.boot</groupId>
  38. <artifactId>spring-boot-starter-test</artifactId>
  39. </dependency>
  40.  
  41.  
  42. </dependencies>
  43.  
  44. <properties>
  45. <java.version>1.8</java.version>
  46. <maven.compiler.source>1.8</maven.compiler.source>
  47. <maven.compiler.target>1.8</maven.compiler.target>
  48. </properties>
  49.  
  50. <repositories>
  51. <repository>
  52. <id>spring-releases</id>
  53. <name>Spring Releases</name>
  54. <url>https://repo.spring.io/libs-release</url>
  55. </repository>
  56. </repositories>
  57. <pluginRepositories>
  58. <pluginRepository>
  59. <id>spring-releases</id>
  60. <url>https://repo.spring.io/libs-release</url>
  61. </pluginRepository>
  62. </pluginRepositories>
  63.  
  64.  
  65. <build>
  66. <plugins>
  67. <plugin>
  68. <groupId>org.springframework.boot</groupId>
  69. <artifactId>spring-boot-maven-plugin</artifactId>
  70. </plugin>
  71. <plugin>
  72. <groupId>org.apache.maven.plugins</groupId>
  73. <artifactId>maven-compiler-plugin</artifactId>
  74. <version>2.1</version>
  75. <configuration>
  76. <source>1.8</source>
  77. <target>1.8</target>
  78. </configuration>
  79. </plugin>
  80. </plugins>
  81. </build>
  82.  
  83. spring.datasource.url = jdbc:mysql://localhost:3306/TEST?createIfNotExists=true
  84. spring.datasource.driverClassName = com.mysql.jdbc.Driver
  85. spring.datasource.username=root
  86. spring.datasource.password=but
  87.  
  88. spring.jpa.show-sql=true
  89.  
  90. # Enable spring data repos
  91. spring.data.jpa.repositories.enabled=true
  92. spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
  93. spring.jpa.hibernate.ddl-auto=update
  94.  
  95. spring.thymeleaf.cache=false
  96. spring.template.cache=false
  97.  
  98. @SpringBootApplication
  99. @ComponentScan("demo")
  100. @EnableJpaRepositories("demo")
  101. public class SpringBootTEST {
  102.  
  103. public static void main(String[] args) {
  104. ApplicationContext ctx = SpringApplication.run(SpringBootTEST.class, args);
  105.  
  106. ProductService pRepo = ctx.getBean("productService", ProductService.class);
  107. pRepo.addSomeProducts();
  108. CustomerService cRepo = ctx.getBean("customerService", CustomerService.class);
  109. cRepo.addSomeCustomers();
  110. }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement