Skip to content

Commit c40e925

Browse files
author
Manish Baxi
committed
Upgraded Maven dependencies to latest available versions.
1 parent 168f3f1 commit c40e925

File tree

16 files changed

+182
-115
lines changed

16 files changed

+182
-115
lines changed

.gitignore

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.classpath
22
.project
3+
.idea/
34
.settings/
45
target/
56
api/.classpath
@@ -14,11 +15,11 @@ data/.classpath
1415
data/.project
1516
data/.settings/
1617
data/target/
17-
domain/.classpath
18-
domain/.project
19-
domain/.settings/
20-
domain/src/main/webapp/WEB-INF/classes/
21-
domain/target/
18+
domain/.classpath
19+
domain/.project
20+
domain/.settings/
21+
domain/src/main/webapp/WEB-INF/classes/
22+
domain/target/
2223
service/.classpath
2324
service/.project
2425
service/.settings/
@@ -33,4 +34,8 @@ web/.settings/
3334
web/src/main/webapp/WEB-INF/classes/
3435
web/target/
3536
*~
36-
*.tmp
37+
*.iml
38+
*.lck
39+
*.log
40+
*.tlog
41+
*.tmp

api/pom.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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">
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">
23
<modelVersion>4.0.0</modelVersion>
34
<parent>
45
<groupId>org.example</groupId>
@@ -8,18 +9,28 @@
89
</parent>
910
<artifactId>spring-security-rest-api</artifactId>
1011
<packaging>war</packaging>
12+
1113
<build>
1214
<finalName>spring-security-rest-api</finalName>
1315
<plugins>
16+
<plugin>
17+
<groupId>org.apache.maven.plugins</groupId>
18+
<artifactId>maven-compiler-plugin</artifactId>
19+
</plugin>
1420
<plugin>
1521
<groupId>org.apache.tomcat.maven</groupId>
1622
<artifactId>tomcat7-maven-plugin</artifactId>
1723
<configuration>
1824
<port>9999</port>
1925
</configuration>
2026
</plugin>
27+
<plugin>
28+
<groupId>org.scala-tools</groupId>
29+
<artifactId>maven-scala-plugin</artifactId>
30+
</plugin>
2131
</plugins>
2232
</build>
33+
2334
<dependencies>
2435
<dependency>
2536
<groupId>${project.groupId}</groupId>
@@ -76,11 +87,7 @@
7687
</dependency>
7788
<dependency>
7889
<groupId>net.sf.ehcache</groupId>
79-
<artifactId>ehcache-core</artifactId>
80-
</dependency>
81-
<dependency>
82-
<groupId>org.mockito</groupId>
83-
<artifactId>mockito-core</artifactId>
90+
<artifactId>ehcache</artifactId>
8491
</dependency>
8592
<dependency>
8693
<groupId>org.springframework</groupId>

api/src/main/scala/org/example/api/UserAuthenticationController.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
44
import org.example.transfer.Response
55
import org.springframework.beans.factory.annotation.{ Autowired, Qualifier }
66
import org.springframework.security.authentication.{ AuthenticationManager, InternalAuthenticationServiceException, UsernamePasswordAuthenticationToken }
7-
import org.springframework.security.core.{ Authentication, AuthenticationException }
7+
import org.springframework.security.core.AuthenticationException
88
import org.springframework.security.core.context.SecurityContextHolder
99
import org.springframework.security.web.context.SecurityContextRepository
10-
import org.springframework.web.bind.annotation.{ RequestMapping, ResponseBody, RestController, RequestParam, RequestMethod }
10+
import org.springframework.web.bind.annotation.{ RequestMapping, RestController, RequestParam, RequestMethod }
1111
import scala.beans.BeanProperty
1212

1313
/**
@@ -24,8 +24,8 @@ class UserAuthenticationController {
2424
/**
2525
* Authenticates an API user using username and password information included in API call headers.
2626
*
27-
* @param request The {@link HttpServletRequest} for the API call.
28-
* @param response The {@link HttpServletResponse} for the API call.
27+
* @param request The [[HttpServletRequest]] for the API call.
28+
* @param response The [[HttpServletResponse]] for the API call.
2929
*/
3030
@RequestMapping(method = Array(RequestMethod.POST), value = Array("/authenticate"))
3131
def authenticate(@RequestParam username: String, @RequestParam password: String, request: HttpServletRequest, response: HttpServletResponse): UserAuthenticationResponse = {
@@ -65,7 +65,7 @@ class UserAuthenticationController {
6565
}
6666
}
6767

68-
return authenticationResponse
68+
authenticationResponse
6969
}
7070
}
7171

common/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@
88
</parent>
99
<artifactId>spring-security-rest-common</artifactId>
1010
<packaging>jar</packaging>
11+
12+
<build>
13+
<plugins>
14+
<plugin>
15+
<groupId>org.apache.maven.plugins</groupId>
16+
<artifactId>maven-compiler-plugin</artifactId>
17+
</plugin>
18+
<plugin>
19+
<groupId>org.scala-tools</groupId>
20+
<artifactId>maven-scala-plugin</artifactId>
21+
</plugin>
22+
</plugins>
23+
</build>
1124
</project>

data/pom.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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">
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">
23
<modelVersion>4.0.0</modelVersion>
34
<parent>
45
<groupId>org.example</groupId>
@@ -8,6 +9,20 @@
89
</parent>
910
<artifactId>spring-security-rest-data</artifactId>
1011
<packaging>jar</packaging>
12+
13+
<build>
14+
<plugins>
15+
<plugin>
16+
<groupId>org.apache.maven.plugins</groupId>
17+
<artifactId>maven-compiler-plugin</artifactId>
18+
</plugin>
19+
<plugin>
20+
<groupId>org.scala-tools</groupId>
21+
<artifactId>maven-scala-plugin</artifactId>
22+
</plugin>
23+
</plugins>
24+
</build>
25+
1126
<dependencies>
1227
<dependency>
1328
<groupId>${project.groupId}</groupId>

data/src/main/scala/org/example/data/UserRepository.scala

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
package org.example.data
22

3-
import java.util.ArrayList
4-
import java.util.Collection
5-
import java.util.Collections
6-
import java.util.Comparator
7-
import java.util.HashMap
8-
import java.util.List
3+
import java.util.{ArrayList, Collection, Collections, HashMap}
94

105
import org.example.domain.User
116
import org.example.transfer.UserRoleEnum
127
import org.springframework.stereotype.Component
138

149
/**
15-
* Contract for data access operations on {@link User}.
10+
* Contract for data access operations on [[User]].
1611
*/
1712
trait UserRepository {
1813
/**
1914
* Finds all users in the system.
2015
*
21-
* @return A {@link Collection} of {@link User}s.
16+
* @return A [[Collection]] of [[User]]s.
2217
*/
2318
def findAll: Collection[User]
2419

2520
/**
2621
* Finds a user with a specified authentication username.
2722
*
2823
* @param username
29-
* The username to find.
30-
* @return A {@link User}.
24+
* The username to find.
25+
* @return A [[User]].
3126
*/
3227
def findOne(username: String): User
3328
}

domain/pom.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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">
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">
23
<modelVersion>4.0.0</modelVersion>
34
<parent>
45
<groupId>org.example</groupId>
@@ -8,6 +9,20 @@
89
</parent>
910
<artifactId>spring-security-rest-domain</artifactId>
1011
<packaging>jar</packaging>
12+
13+
<build>
14+
<plugins>
15+
<plugin>
16+
<groupId>org.apache.maven.plugins</groupId>
17+
<artifactId>maven-compiler-plugin</artifactId>
18+
</plugin>
19+
<plugin>
20+
<groupId>org.scala-tools</groupId>
21+
<artifactId>maven-scala-plugin</artifactId>
22+
</plugin>
23+
</plugins>
24+
</build>
25+
1126
<dependencies>
1227
<dependency>
1328
<groupId>${project.groupId}</groupId>

domain/src/main/scala/org/example/domain/User.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import org.example.transfer.UserRoleEnum
55
/**
66
* Represents an application user.
77
*/
8-
case class User(val username: String, val password: String, val firstName: String, val lastName: String, val role: UserRoleEnum) extends Ordered[User] {
9-
require(firstName != null && firstName.trim != "", "First name must not be null or blank.")
10-
require(lastName != null && lastName.trim != "", "Last name must not be null or blank.")
11-
require(username != null && username.trim != "", "Username must not be null or blank.")
12-
require(password != null && password.trim != "", "Password name must not be null or blank.")
8+
case class User(username: String, password: String, firstName: String, lastName: String, role: UserRoleEnum) extends Ordered[User] {
9+
require(firstName != null, "First name must not be null or blank.")
10+
require(lastName != null, "Last name must not be null or blank.")
11+
require(username != null, "Username must not be null or blank.")
12+
require(password != null, "Password name must not be null or blank.")
1313
require(role != null, "Role must not be null.")
1414

1515
/**

0 commit comments

Comments
 (0)