Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.75 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/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>musicstore</groupId>
  5. <artifactId>MVCMusicStore</artifactId>
  6. <packaging>war</packaging>
  7. <version>1.0</version>
  8. <name>MVCMusicStore Maven Webapp</name>
  9. <url>http://maven.apache.org</url>
  10.  
  11. <repositories>
  12.  
  13. <repository>
  14. <id>java.net2</id>
  15. <name>Repository hosting the jee6 artifacts</name>
  16. <url>http://download.java.net/maven/2</url>
  17. </repository>
  18.  
  19. <repository>
  20. <url>http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo</url>
  21. <id>eclipselink</id>
  22. <layout>default</layout>
  23. <name>Repository for library Library[eclipselink]</name>
  24. </repository>
  25.  
  26. <repository>
  27. <id>jboss-public-repository-group</id>
  28. <name>Jboss Public Maven Repository Group</name>
  29. <url>https://repository.jboss.org/nexus/content/groups/public</url>
  30. </repository>
  31.  
  32. <repository>
  33. <id>java.net.glassfish</id>
  34. <name>Repository hosting the jee6 artifacts</name>
  35. <url>http://download.java.net/maven/glassfish</url>
  36. </repository>
  37.  
  38. <repository>
  39. <id>mesir-repo</id>
  40. <name>Repository hosting the oracle ojdbc14.jar</name>
  41. <url>http://mesir.googlecode.com/svn/trunk/mavenrepo</url>
  42. </repository>
  43.  
  44. <repository>
  45. <id>maven2-repository.dev.java.net</id>
  46. <name>Java.net Repository for Maven</name>
  47. <url>http://download.java.net/maven/2/</url>
  48. <layout>default</layout>
  49. </repository>
  50.  
  51. </repositories>
  52.  
  53. <dependencies>
  54. <!-- <dependency> -->
  55. <!-- <groupId>junit</groupId> -->
  56. <!-- <artifactId>junit</artifactId> -->
  57. <!-- <version>3.8.1</version> -->
  58. <!-- <scope>test</scope> -->
  59. <!-- </dependency> -->
  60.  
  61. <!-- Prepare for Spring framework -->
  62. <dependency>
  63. <groupId>org.springframework</groupId>
  64. <artifactId>spring-webmvc</artifactId>
  65. <version>4.3.0.RELEASE</version>
  66. </dependency>
  67.  
  68. <dependency>
  69. <groupId>org.springframework</groupId>
  70. <artifactId>spring-web</artifactId>
  71. <version>4.3.0.RELEASE</version>
  72. <type>jar</type>
  73. <scope>compile</scope>
  74. </dependency>
  75.  
  76. <dependency>
  77. <groupId>org.springframework</groupId>
  78. <artifactId>spring-tx</artifactId>
  79. <version>4.3.0.RELEASE</version>
  80. </dependency>
  81.  
  82. <dependency>
  83. <groupId>org.springframework</groupId>
  84. <artifactId>spring-orm</artifactId>
  85. <version>4.3.0.RELEASE</version>
  86. </dependency>
  87.  
  88. <dependency>
  89. <groupId>org.springframework</groupId>
  90. <artifactId>spring-beans</artifactId>
  91. <version>4.3.0.RELEASE</version>
  92. <type>jar</type>
  93. <scope>compile</scope>
  94. </dependency>
  95.  
  96. <dependency>
  97. <groupId>org.springframework</groupId>
  98. <artifactId>spring-jdbc</artifactId>
  99. <version>4.3.0.RELEASE</version>
  100. <type>jar</type>
  101. <scope>compile</scope>
  102. </dependency>
  103.  
  104. <dependency>
  105. <groupId>org.springframework</groupId>
  106. <artifactId>spring-test</artifactId>
  107. <version>4.3.0.RELEASE</version>
  108. <type>jar</type>
  109. <scope>compile</scope>
  110. </dependency>
  111.  
  112. <dependency>
  113. <groupId>org.springframework.security</groupId>
  114. <artifactId>spring-security-core</artifactId>
  115. <version>4.1.0.RELEASE</version>
  116. <type>jar</type>
  117. <scope>compile</scope>
  118. </dependency>
  119.  
  120. <dependency>
  121. <groupId>org.springframework.security</groupId>
  122. <artifactId>spring-security-config</artifactId>
  123. <version>4.1.0.RELEASE</version>
  124. <type>jar</type>
  125. <scope>compile</scope>
  126. </dependency>
  127.  
  128. <dependency>
  129. <groupId>org.springframework.security</groupId>
  130. <artifactId>spring-security-web</artifactId>
  131. <version>4.1.0.RELEASE</version>
  132. <type>jar</type>
  133. <scope>compile</scope>
  134. </dependency>
  135.  
  136. <!-- Prepare for Hibernate -->
  137.  
  138. <dependency>
  139. <groupId>org.hibernate</groupId>
  140. <artifactId>hibernate</artifactId>
  141. <version>3.5.4-Final</version>
  142. <type>pom</type>
  143. </dependency>
  144.  
  145. <dependency>
  146. <groupId>org.hibernate</groupId>
  147. <artifactId>ejb3-persistence</artifactId>
  148. <version>1.0.2.GA</version>
  149. </dependency>
  150.  
  151. <dependency>
  152. <groupId>org.hibernate</groupId>
  153. <artifactId>hibernate-entitymanager</artifactId>
  154. <version>5.1.0.Final</version>
  155. </dependency>
  156.  
  157. <dependency>
  158. <groupId>commons-dbcp</groupId>
  159. <artifactId>commons-dbcp</artifactId>
  160. <version>1.4</version>
  161. </dependency>
  162.  
  163. <!-- prepare for database connection - Oracle - SQL - MySQL -->
  164.  
  165. <!-- <dependency> -->
  166. <!-- <groupId>ojdbc</groupId> -->
  167. <!-- <artifactId>ojdbc</artifactId> -->
  168. <!-- <version>14</version> -->
  169. <!-- </dependency> -->
  170.  
  171. <!-- <dependency> -->
  172. <!-- <groupId>javax.sql</groupId> -->
  173. <!-- <artifactId>jdbc-stdext</artifactId> -->
  174. <!-- <version>2.0</version> -->
  175. <!-- </dependency> -->
  176.  
  177. <dependency>
  178. <groupId>mysql</groupId>
  179. <artifactId>mysql-connector-java</artifactId>
  180. <version>6.0.2</version>
  181. <type>jar</type>
  182. <scope>compile</scope>
  183. </dependency>
  184.  
  185. <dependency>
  186. <groupId>javax.transaction</groupId>
  187. <artifactId>jta</artifactId>
  188. <version>1.1</version>
  189. <scope>provided</scope>
  190. </dependency>
  191.  
  192. <!-- prepare for Spring framwork -->
  193.  
  194. <dependency>
  195. <groupId>javax.annotation</groupId>
  196. <artifactId>jsr250-api</artifactId>
  197. <version>1.0</version>
  198. <scope>provided</scope>
  199. </dependency>
  200.  
  201. <dependency>
  202. <groupId>javax.servlet</groupId>
  203. <artifactId>servlet-api</artifactId>
  204. <version>2.5</version>
  205. <scope>provided</scope>
  206. </dependency>
  207.  
  208. <dependency>
  209. <groupId>javax.servlet.jsp</groupId>
  210. <artifactId>jsp-api</artifactId>
  211. <version>2.2</version>
  212. <scope>provided</scope>
  213. </dependency>
  214.  
  215. <dependency>
  216. <groupId>junit</groupId>
  217. <artifactId>junit</artifactId>
  218. <version>4.12</version>
  219. <scope>test</scope>
  220. </dependency>
  221.  
  222. <!-- AOP dependence -->
  223.  
  224. <dependency>
  225. <groupId>aopalliance</groupId>
  226. <artifactId>aopalliance</artifactId>
  227. <version>1.0</version>
  228. </dependency>
  229.  
  230. <dependency>
  231. <groupId>org.aspectj</groupId>
  232. <artifactId>aspectjweaver</artifactId>
  233. <version>1.8.9</version>
  234. </dependency>
  235.  
  236. <dependency>
  237. <groupId>cglib</groupId>
  238. <artifactId>cglib</artifactId>
  239. <version>3.2.3</version>
  240. </dependency>
  241.  
  242. <!-- Prepare for Spring Rest -->
  243.  
  244. <dependency>
  245. <groupId>org.mockito</groupId>
  246. <artifactId>mockito-core</artifactId>
  247. <version>1.10.19</version>
  248. </dependency>
  249.  
  250. <!-- Prepare for log system -->
  251.  
  252. <dependency>
  253. <groupId>log4j</groupId>
  254. <artifactId>log4j</artifactId>
  255. <version>1.2.17</version>
  256. <type>jar</type>
  257. <scope>compile</scope>
  258. </dependency>
  259.  
  260. <!-- This dependence is for Jsp configuration -->
  261.  
  262. <dependency>
  263. <groupId>org.codehaus.jackson</groupId>
  264. <artifactId>jackson-core-asl</artifactId>
  265. <version>1.9.13</version>
  266. <type>jar</type>
  267. <scope>compile</scope>
  268. </dependency>
  269.  
  270. <dependency>
  271. <groupId>jstl</groupId>
  272. <artifactId>jstl</artifactId>
  273. <version>1.2</version>
  274. <type>jar</type>
  275. <scope>compile</scope>
  276. </dependency>
  277.  
  278. <dependency>
  279. <groupId>taglibs</groupId>
  280. <artifactId>standard</artifactId>
  281. <version>1.1.2</version>
  282. <type>jar</type>
  283. <scope>compile</scope>
  284. </dependency>
  285.  
  286.  
  287. </dependencies>
  288. <build>
  289. <finalName>MVCMusicStore</finalName>
  290. <plugins>
  291. <plugin>
  292. <groupId>org.apache.maven.plugins</groupId>
  293. <artifactId>maven-compiler-plugin</artifactId>
  294. <version>2.3.2</version>
  295. <configuration>
  296. <source>1.7</source>
  297. <target>1.7</target>
  298. </configuration>
  299. </plugin>
  300. <plugin>
  301. <groupId>org.mortbay.jetty</groupId>
  302. <artifactId>maven-jetty-plugin</artifactId>
  303. <version>6.1.10</version>
  304. <configuration>
  305. <argLine>-javaagent D:/spring-agent.jar</argLine>
  306. <scanIntervalSeconds>10</scanIntervalSeconds>
  307. <stopKey>foo</stopKey>
  308. <stopPort>9999</stopPort>
  309. </configuration>
  310. <executions>
  311. <execution>
  312. <id>start-jetty</id>
  313. <phase>pre-integration-test</phase>
  314. <goals>
  315. <goal>run</goal>
  316. </goals>
  317. <configuration>
  318. <argLine>-javaagent D:/spring-agent.jar</argLine>
  319. <scanIntervalSeconds>0</scanIntervalSeconds>
  320. <daemon>true</daemon>
  321. </configuration>
  322. </execution>
  323. <execution>
  324. <id>stop-jetty</id>
  325. <phase>post-integration-test</phase>
  326. <goals>
  327. <goal>stop</goal>
  328. </goals>
  329. </execution>
  330. </executions>
  331. </plugin>
  332. </plugins>
  333. </build>
  334.  
  335. <?xml version="1.0" encoding="UTF-8"?>
  336.  
  337. <!-- Use @Component annotation for bean definitions -->
  338.  
  339. <context:component-scan base-package="com.MVCMusicStore" />
  340.  
  341. <!-- @Controller annotaitons for MVC controller definitions -->
  342.  
  343. <mvc:annotation-driven />
  344.  
  345. <!--Add JPA support -->
  346.  
  347. <bean id="emf"
  348. class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  349. <property name="persistenceUnitName" value="MVCMusicStorePU" />
  350. <property name="jpaDialect" ref="jpaDialect" />
  351. <property name="jpaVendorAdapter" ref="jpaAdapter" />
  352. </bean>
  353. <bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"
  354. lazy-init="true" />
  355. <bean id="jpaAdapter"
  356. class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
  357. lazy-init="true">
  358. <property name="databasePlatform" value="org.hibernate.dialect.MySQLInnoDBDialect" />
  359. <property name="database" value="MYSQL" />
  360. <property name="showSql" value="false" />
  361. </bean>
  362.  
  363. <bean
  364. class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
  365. lazy-init="true" />
  366.  
  367. <!-- Add Transaction support -->
  368. <bean id="myTxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  369. <property name="entityManagerFactory" ref="emf" />
  370. </bean>
  371.  
  372. <!-- Use @Transaction annotation for managing transactions -->
  373. <tx:annotation-driven transaction-manager="myTxManager"
  374. proxy-target-class="true" />
  375.  
  376. <!-- Declare a view resolver -->
  377. <bean id="viewResolever"
  378. class="org.springframework.web.servlet.view.InternalResourceViewResolver"
  379. p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />
  380.  
  381. <?xml version="1.0" encoding="UTF-8"?>
  382.  
  383. <!-- For MySQL -->
  384.  
  385. <properties>
  386. <property name="hibernate.connection.username" value="root" />
  387. <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
  388. <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
  389. <property name="hibernate.connection.password" value="" />
  390. <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/springMusic" />
  391. <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
  392. <property name="show_sql" value="true"/>
  393. </properties>
  394.  
  395. </persistence-unit>
  396.  
  397. log4j:WARN Please initialize the log4j system properly.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement