Skip to content

Commit 115220b

Browse files
authored
Merge pull request eugenp#687 from lor6/custom-userservice-new-project
Custom userservice new project
2 parents 2688cb9 + d12d4e6 commit 115220b

20 files changed

Lines changed: 1131 additions & 0 deletions

File tree

‎spring-userservice/.springBeans‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beansProjectDescription>
3+
<version>1</version>
4+
<pluginVersion><![CDATA[3.7.3.201602250914-RELEASE]]></pluginVersion>
5+
<configSuffixes>
6+
<configSuffix><![CDATA[xml]]></configSuffix>
7+
</configSuffixes>
8+
<enableImports><![CDATA[false]]></enableImports>
9+
<configs>
10+
</configs>
11+
<autoconfigs>
12+
</autoconfigs>
13+
<configSets>
14+
</configSets>
15+
</beansProjectDescription>

‎spring-userservice/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring-userservice is using a in memory derby db. Right click -> run on server to run the project

‎spring-userservice/pom.xml‎

Lines changed: 320 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,320 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>spring-userservice</groupId>
4+
<artifactId>spring-userservice</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<packaging>war</packaging>
7+
8+
<dependencies>
9+
10+
<!-- Spring -->
11+
12+
<dependency>
13+
<groupId>org.springframework</groupId>
14+
<artifactId>spring-orm</artifactId>
15+
<version>${org.springframework.version}</version>
16+
</dependency>
17+
<dependency>
18+
<groupId>org.springframework</groupId>
19+
<artifactId>spring-context</artifactId>
20+
<version>${org.springframework.version}</version>
21+
</dependency>
22+
23+
<!-- persistence -->
24+
25+
<dependency>
26+
<groupId>org.hibernate</groupId>
27+
<artifactId>hibernate-entitymanager</artifactId>
28+
<version>${hibernate.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.hibernate</groupId>
32+
<artifactId>hibernate-ehcache</artifactId>
33+
<version>${hibernate.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>xml-apis</groupId>
37+
<artifactId>xml-apis</artifactId>
38+
<version>1.4.01</version>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.javassist</groupId>
42+
<artifactId>javassist</artifactId>
43+
<version>${javassist.version}</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>mysql</groupId>
47+
<artifactId>mysql-connector-java</artifactId>
48+
<version>${mysql-connector-java.version}</version>
49+
<scope>runtime</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.springframework.data</groupId>
53+
<artifactId>spring-data-jpa</artifactId>
54+
<version>${spring-data-jpa.version}</version>
55+
</dependency>
56+
<dependency>
57+
<groupId>com.h2database</groupId>
58+
<artifactId>h2</artifactId>
59+
<version>${h2.version}</version>
60+
</dependency>
61+
62+
<!-- validation -->
63+
64+
<dependency>
65+
<groupId>org.hibernate</groupId>
66+
<artifactId>hibernate-validator</artifactId>
67+
<version>${hibernate-validator.version}</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>javax.el</groupId>
71+
<artifactId>javax.el-api</artifactId>
72+
<version>2.2.5</version>
73+
</dependency>
74+
75+
<!-- utils -->
76+
77+
<dependency>
78+
<groupId>com.google.guava</groupId>
79+
<artifactId>guava</artifactId>
80+
<version>${guava.version}</version>
81+
</dependency>
82+
83+
<!-- test scoped -->
84+
85+
<dependency>
86+
<groupId>org.apache.commons</groupId>
87+
<artifactId>commons-lang3</artifactId>
88+
<version>${commons-lang3.version}</version>
89+
<scope>test</scope>
90+
</dependency>
91+
92+
<dependency>
93+
<groupId>org.springframework</groupId>
94+
<artifactId>spring-test</artifactId>
95+
<version>${org.springframework.version}</version>
96+
<scope>test</scope>
97+
</dependency>
98+
99+
<dependency>
100+
<groupId>junit</groupId>
101+
<artifactId>junit</artifactId>
102+
<version>${junit.version}</version>
103+
<scope>test</scope>
104+
</dependency>
105+
106+
<dependency>
107+
<groupId>org.hamcrest</groupId>
108+
<artifactId>hamcrest-core</artifactId>
109+
<version>${org.hamcrest.version}</version>
110+
<scope>test</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.hamcrest</groupId>
114+
<artifactId>hamcrest-library</artifactId>
115+
<version>${org.hamcrest.version}</version>
116+
<scope>test</scope>
117+
</dependency>
118+
119+
<dependency>
120+
<groupId>org.mockito</groupId>
121+
<artifactId>mockito-core</artifactId>
122+
<version>${mockito.version}</version>
123+
<scope>test</scope>
124+
</dependency>
125+
126+
<dependency>
127+
<groupId>org.springframework</groupId>
128+
<artifactId>spring-core</artifactId>
129+
<version>${org.springframework.version}</version>
130+
</dependency>
131+
<dependency>
132+
<groupId>org.springframework</groupId>
133+
<artifactId>spring-web</artifactId>
134+
<version>${org.springframework.version}</version>
135+
</dependency>
136+
<dependency>
137+
<groupId>org.springframework</groupId>
138+
<artifactId>spring-webmvc</artifactId>
139+
<version>${org.springframework.version}</version>
140+
</dependency>
141+
142+
<dependency>
143+
<groupId>org.springframework.security</groupId>
144+
<artifactId>spring-security-core</artifactId>
145+
<version>${org.springframework.security.version}</version>
146+
</dependency>
147+
<dependency>
148+
<groupId>org.springframework.security</groupId>
149+
<artifactId>spring-security-web</artifactId>
150+
<version>${org.springframework.security.version}</version>
151+
</dependency>
152+
<dependency>
153+
<groupId>org.springframework.security</groupId>
154+
<artifactId>spring-security-config</artifactId>
155+
<version>${org.springframework.security.version}</version>
156+
</dependency>
157+
158+
<dependency>
159+
<groupId>org.apache.derby</groupId>
160+
<artifactId>derby</artifactId>
161+
<version>10.12.1.1</version>
162+
</dependency>
163+
<dependency>
164+
<groupId>org.apache.derby</groupId>
165+
<artifactId>derbyclient</artifactId>
166+
<version>10.12.1.1</version>
167+
</dependency>
168+
<dependency>
169+
<groupId>org.apache.derby</groupId>
170+
<artifactId>derbynet</artifactId>
171+
<version>10.12.1.1</version>
172+
</dependency>
173+
<dependency>
174+
<groupId>org.apache.derby</groupId>
175+
<artifactId>derbytools</artifactId>
176+
<version>10.12.1.1</version>
177+
</dependency>
178+
<dependency>
179+
<groupId>taglibs</groupId>
180+
<artifactId>standard</artifactId>
181+
<version>1.1.2</version>
182+
</dependency>
183+
<dependency>
184+
<groupId>org.springframework.security</groupId>
185+
<artifactId>spring-security-taglibs</artifactId>
186+
<version>4.1.3.RELEASE</version>
187+
</dependency>
188+
<dependency>
189+
<groupId>javax.servlet.jsp.jstl</groupId>
190+
<artifactId>jstl-api</artifactId>
191+
<version>1.2</version>
192+
</dependency>
193+
<dependency>
194+
<groupId>org.springframework.boot</groupId>
195+
<artifactId>spring-boot-test</artifactId>
196+
<version>1.4.1.RELEASE</version>
197+
</dependency>
198+
<dependency>
199+
<groupId>org.springframework.boot</groupId>
200+
<artifactId>spring-boot</artifactId>
201+
<version>1.4.1.RELEASE</version>
202+
</dependency>
203+
<dependency>
204+
<groupId>javax.servlet</groupId>
205+
<artifactId>javax.servlet-api</artifactId>
206+
<version>3.1.0</version>
207+
</dependency>
208+
</dependencies>
209+
210+
<build>
211+
<finalName>spring-userservice</finalName>
212+
<resources>
213+
<resource>
214+
<directory>src/main/resources</directory>
215+
<filtering>true</filtering>
216+
</resource>
217+
</resources>
218+
219+
<plugins>
220+
221+
<plugin>
222+
<groupId>org.apache.maven.plugins</groupId>
223+
<artifactId>maven-compiler-plugin</artifactId>
224+
<version>${maven-compiler-plugin.version}</version>
225+
<configuration>
226+
<source>1.8</source>
227+
<target>1.8</target>
228+
</configuration>
229+
</plugin>
230+
231+
<plugin>
232+
<groupId>org.apache.maven.plugins</groupId>
233+
<artifactId>maven-war-plugin</artifactId>
234+
<version>${maven-war-plugin.version}</version>
235+
</plugin>
236+
237+
<plugin>
238+
<groupId>org.apache.maven.plugins</groupId>
239+
<artifactId>maven-surefire-plugin</artifactId>
240+
<version>${maven-surefire-plugin.version}</version>
241+
<configuration>
242+
<excludes>
243+
<!-- <exclude>**/*ProductionTest.java</exclude> -->
244+
</excludes>
245+
<systemPropertyVariables>
246+
<!-- <provPersistenceTarget>h2</provPersistenceTarget> -->
247+
</systemPropertyVariables>
248+
</configuration>
249+
</plugin>
250+
251+
<plugin>
252+
<groupId>org.codehaus.cargo</groupId>
253+
<artifactId>cargo-maven2-plugin</artifactId>
254+
<version>${cargo-maven2-plugin.version}</version>
255+
<configuration>
256+
<wait>true</wait>
257+
<container>
258+
<containerId>jetty8x</containerId>
259+
<type>embedded</type>
260+
<systemProperties>
261+
<!-- <provPersistenceTarget>cargo</provPersistenceTarget> -->
262+
</systemProperties>
263+
</container>
264+
<configuration>
265+
<properties>
266+
<cargo.servlet.port>8082</cargo.servlet.port>
267+
</properties>
268+
</configuration>
269+
</configuration>
270+
</plugin>
271+
272+
</plugins>
273+
274+
</build>
275+
276+
<properties>
277+
<!-- Spring -->
278+
<org.springframework.security.version>4.1.3.RELEASE</org.springframework.security.version>
279+
<org.springframework.version>4.3.2.RELEASE</org.springframework.version>
280+
<javassist.version>3.20.0-GA</javassist.version>
281+
282+
<!-- persistence -->
283+
<hibernate.version>5.2.2.Final</hibernate.version>
284+
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
285+
<spring-data-jpa.version>1.10.2.RELEASE</spring-data-jpa.version>
286+
<h2.version>1.4.192</h2.version>
287+
288+
<!-- logging -->
289+
<org.slf4j.version>1.7.13</org.slf4j.version>
290+
<logback.version>1.1.3</logback.version>
291+
292+
<!-- various -->
293+
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version>
294+
295+
<!-- util -->
296+
<guava.version>19.0</guava.version>
297+
<commons-lang3.version>3.4</commons-lang3.version>
298+
299+
<!-- testing -->
300+
<org.hamcrest.version>1.3</org.hamcrest.version>
301+
<junit.version>4.12</junit.version>
302+
<mockito.version>1.10.19</mockito.version>
303+
304+
<httpcore.version>4.4.1</httpcore.version>
305+
<httpclient.version>4.5</httpclient.version>
306+
307+
<rest-assured.version>2.9.0</rest-assured.version>
308+
309+
<!-- maven plugins -->
310+
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
311+
<maven-war-plugin.version>2.6</maven-war-plugin.version>
312+
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
313+
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
314+
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
315+
<!-- <maven-war-plugin.version>2.6</maven-war-plugin.version> -->
316+
317+
</properties>
318+
319+
320+
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.baeldung.custom.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.ComponentScan;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.web.servlet.ViewResolver;
7+
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
8+
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
9+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
10+
import org.springframework.web.servlet.view.InternalResourceViewResolver;
11+
import org.springframework.web.servlet.view.JstlView;
12+
13+
@EnableWebMvc
14+
@Configuration
15+
@ComponentScan(basePackages = { "org.baeldung.security" })
16+
public class MvcConfig extends WebMvcConfigurerAdapter {
17+
18+
public MvcConfig() {
19+
super();
20+
}
21+
22+
@Override
23+
public void addViewControllers(final ViewControllerRegistry registry) {
24+
super.addViewControllers(registry);
25+
26+
registry.addViewController("/");
27+
registry.addViewController("/index");
28+
registry.addViewController("/login");
29+
registry.addViewController("/register");
30+
}
31+
32+
@Bean
33+
public ViewResolver viewResolver() {
34+
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
35+
36+
bean.setViewClass(JstlView.class);
37+
bean.setPrefix("/WEB-INF/view/");
38+
bean.setSuffix(".jsp");
39+
40+
return bean;
41+
}
42+
}

0 commit comments

Comments
 (0)