Skip to content

Commit 64569e0

Browse files
committed
Going to Java 8, updating and replacing libraries, closes #34
1 parent 1620ac7 commit 64569e0

File tree

10 files changed

+303
-313
lines changed

10 files changed

+303
-313
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Technologies
3333
Running
3434
-------
3535

36-
Make sure [Maven](http://maven.apache.org/) >= 2.2.1 is installed on your system. Go into the project dir and type `mvn jetty:run`, then point your browser to `http://localhost:8080`.
36+
Make sure Java >= 8 and [Maven](http://maven.apache.org/) >= 3.0 is installed on your system. Go into the project dir and type `mvn jetty:run`, then point your browser to `http://localhost:8080`.
3737

3838
License
3939
-------

pom.xml

+165-181
Original file line numberDiff line numberDiff line change
@@ -1,182 +1,166 @@
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>net.dontdrinkandroot.example</groupId>
4-
<artifactId>angular-rest-springsecurity</artifactId>
5-
<version>0.3.0-SNAPSHOT</version>
6-
<packaging>war</packaging>
7-
8-
<properties>
9-
<version.org.springframework.security>4.2.2.RELEASE</version.org.springframework.security>
10-
<version.org.springframework>4.3.7.RELEASE</version.org.springframework>
11-
<version.com.sun.jersey.contribs>1.19.3</version.com.sun.jersey.contribs>
12-
<version.org.hibernate>5.2.9.Final</version.org.hibernate>
13-
<org.slf4j.version>1.7.25</org.slf4j.version>
14-
<javax.servlet-api.version>2.5</javax.servlet-api.version>
15-
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
16-
<org.hsqldb.version>2.3.4</org.hsqldb.version>
17-
<commons-dbcp.version>1.4</commons-dbcp.version>
18-
<junit.version>4.12</junit.version>
19-
<org.eclipse.jetty.jetty-maven-plugin.version>9.1.1.v20140108</org.eclipse.jetty.jetty-maven-plugin.version>
20-
</properties>
21-
22-
<developers>
23-
<developer>
24-
<name>Philip Washington Sorst</name>
25-
<url>https://sorst.net</url>
26-
</developer>
27-
</developers>
28-
29-
<licenses>
30-
<license>
31-
<name>The Apache Software License, Version 2.0</name>
32-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
33-
<distribution>repo</distribution>
34-
</license>
35-
</licenses>
36-
37-
<prerequisites>
38-
<maven>2.2.1</maven>
39-
</prerequisites>
40-
41-
<build>
42-
<plugins>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-compiler-plugin</artifactId>
46-
<version>${maven-compiler-plugin.version}</version>
47-
<configuration>
48-
<source>1.6</source>
49-
<target>1.6</target>
50-
</configuration>
51-
</plugin>
52-
<plugin>
53-
<groupId>org.eclipse.jetty</groupId>
54-
<artifactId>jetty-maven-plugin</artifactId>
55-
<version>${org.eclipse.jetty.jetty-maven-plugin.version}</version>
56-
</plugin>
57-
</plugins>
58-
</build>
59-
60-
<scm>
61-
<developerConnection>scm:git:https://github.com/philipsorst/angular-rest-springsecurity.git</developerConnection>
62-
</scm>
63-
64-
<dependencies>
65-
66-
<dependency>
67-
<groupId>org.springframework</groupId>
68-
<artifactId>spring-orm</artifactId>
69-
<version>${version.org.springframework}</version>
70-
</dependency>
71-
72-
<!-- Huh? Spring Jdbc is suddenly marked as provided by spring-orm? -->
73-
<dependency>
74-
<groupId>org.springframework</groupId>
75-
<artifactId>spring-jdbc</artifactId>
76-
<version>${version.org.springframework}</version>
77-
</dependency>
78-
79-
<dependency>
80-
<groupId>org.springframework</groupId>
81-
<artifactId>spring-tx</artifactId>
82-
<version>${version.org.springframework}</version>
83-
</dependency>
84-
85-
<dependency>
86-
<groupId>com.sun.jersey.contribs</groupId>
87-
<artifactId>jersey-spring</artifactId>
88-
<version>${version.com.sun.jersey.contribs}</version>
89-
<!-- jersey-spring uses spring 2.5, we want to use 3.x instead -->
90-
<exclusions>
91-
<exclusion>
92-
<groupId>org.springframework</groupId>
93-
<artifactId>spring</artifactId>
94-
</exclusion>
95-
<exclusion>
96-
<groupId>org.springframework</groupId>
97-
<artifactId>spring-core</artifactId>
98-
</exclusion>
99-
<exclusion>
100-
<groupId>org.springframework</groupId>
101-
<artifactId>spring-web</artifactId>
102-
</exclusion>
103-
<exclusion>
104-
<groupId>org.springframework</groupId>
105-
<artifactId>spring-beans</artifactId>
106-
</exclusion>
107-
<exclusion>
108-
<groupId>org.springframework</groupId>
109-
<artifactId>spring-context</artifactId>
110-
</exclusion>
111-
<exclusion>
112-
<groupId>org.springframework</groupId>
113-
<artifactId>spring-aop</artifactId>
114-
</exclusion>
115-
</exclusions>
116-
</dependency>
117-
118-
<dependency>
119-
<groupId>com.sun.jersey</groupId>
120-
<artifactId>jersey-json</artifactId>
121-
<version>${version.com.sun.jersey.contribs}</version>
122-
</dependency>
123-
124-
<dependency>
125-
<groupId>org.hsqldb</groupId>
126-
<artifactId>hsqldb</artifactId>
127-
<version>${org.hsqldb.version}</version>
128-
</dependency>
129-
130-
<dependency>
131-
<groupId>commons-dbcp</groupId>
132-
<artifactId>commons-dbcp</artifactId>
133-
<version>${commons-dbcp.version}</version>
134-
</dependency>
135-
136-
<dependency>
137-
<groupId>org.hibernate</groupId>
138-
<artifactId>hibernate-entitymanager</artifactId>
139-
<version>${version.org.hibernate}</version>
140-
</dependency>
141-
142-
<dependency>
143-
<groupId>org.slf4j</groupId>
144-
<artifactId>slf4j-log4j12</artifactId>
145-
<version>${org.slf4j.version}</version>
146-
</dependency>
147-
148-
<dependency>
149-
<groupId>org.springframework.security</groupId>
150-
<artifactId>spring-security-web</artifactId>
151-
<version>${version.org.springframework.security}</version>
152-
</dependency>
153-
154-
<dependency>
155-
<groupId>org.springframework.security</groupId>
156-
<artifactId>spring-security-config</artifactId>
157-
<version>${version.org.springframework.security}</version>
158-
</dependency>
159-
160-
<dependency>
161-
<groupId>javax.servlet</groupId>
162-
<artifactId>servlet-api</artifactId>
163-
<version>${javax.servlet-api.version}</version>
164-
<scope>provided</scope>
165-
</dependency>
166-
167-
<dependency>
168-
<groupId>org.springframework</groupId>
169-
<artifactId>spring-test</artifactId>
170-
<version>${version.org.springframework}</version>
171-
<scope>test</scope>
172-
</dependency>
173-
174-
<dependency>
175-
<groupId>junit</groupId>
176-
<artifactId>junit</artifactId>
177-
<version>${junit.version}</version>
178-
<scope>test</scope>
179-
</dependency>
180-
</dependencies>
181-
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>net.dontdrinkandroot.example</groupId>
5+
<artifactId>angular-rest-springsecurity</artifactId>
6+
<version>0.4.0-SNAPSHOT</version>
7+
<packaging>war</packaging>
8+
9+
<properties>
10+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
<version.org.springframework.security>4.2.3.RELEASE</version.org.springframework.security>
12+
<version.org.springframework>4.3.9.RELEASE</version.org.springframework>
13+
<version.com.sun.jersey.json>1.19.4</version.com.sun.jersey.json>
14+
<version.org.glassfish.jersey>2.26-b07</version.org.glassfish.jersey>
15+
<version.org.hibernate>5.2.10.Final</version.org.hibernate>
16+
<version.org.apache.logging.log4j>2.8.2</version.org.apache.logging.log4j>
17+
<version.javax.servlet-api>3.1.0</version.javax.servlet-api>
18+
<version.org.hsqldb>2.4.0</version.org.hsqldb>
19+
<version.org.apache.commons.dbcp2>2.1.1</version.org.apache.commons.dbcp2>
20+
<version.junit>4.12</version.junit>
21+
<!--Plugins-->
22+
<version.maven-compiler-plugin>3.6.1</version.maven-compiler-plugin>
23+
<version.org.eclipse.jetty.jetty-maven-plugin>9.4.6.v20170531</version.org.eclipse.jetty.jetty-maven-plugin>
24+
</properties>
25+
26+
<developers>
27+
<developer>
28+
<name>Philip Washington Sorst</name>
29+
<url>https://sorst.net</url>
30+
</developer>
31+
</developers>
32+
33+
<licenses>
34+
<license>
35+
<name>The Apache Software License, Version 2.0</name>
36+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
37+
<distribution>repo</distribution>
38+
</license>
39+
</licenses>
40+
41+
<prerequisites>
42+
<maven>3.0</maven>
43+
</prerequisites>
44+
45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-compiler-plugin</artifactId>
50+
<version>${version.maven-compiler-plugin}</version>
51+
<configuration>
52+
<source>1.8</source>
53+
<target>1.8</target>
54+
</configuration>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.eclipse.jetty</groupId>
58+
<artifactId>jetty-maven-plugin</artifactId>
59+
<version>${version.org.eclipse.jetty.jetty-maven-plugin}</version>
60+
<configuration>
61+
<webApp>
62+
<contextPath>/</contextPath>
63+
<webInfIncludeJarPattern>.*/^(asm-all-repackaged)[^/]*\.jar$</webInfIncludeJarPattern>
64+
</webApp>
65+
</configuration>
66+
</plugin>
67+
</plugins>
68+
</build>
69+
70+
<scm>
71+
<developerConnection>scm:git:https://github.com/philipsorst/angular-rest-springsecurity.git
72+
</developerConnection>
73+
<tag>HEAD</tag>
74+
</scm>
75+
76+
<dependencies>
77+
78+
<dependency>
79+
<groupId>org.springframework</groupId>
80+
<artifactId>spring-orm</artifactId>
81+
<version>${version.org.springframework}</version>
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>org.springframework</groupId>
86+
<artifactId>spring-tx</artifactId>
87+
<version>${version.org.springframework}</version>
88+
</dependency>
89+
90+
<dependency>
91+
<groupId>org.glassfish.jersey.ext</groupId>
92+
<artifactId>jersey-spring4</artifactId>
93+
<version>${version.org.glassfish.jersey}</version>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>org.glassfish.jersey.media</groupId>
98+
<artifactId>jersey-media-json-jackson</artifactId>
99+
<version>${version.org.glassfish.jersey}</version>
100+
</dependency>
101+
102+
<dependency>
103+
<groupId>org.hsqldb</groupId>
104+
<artifactId>hsqldb</artifactId>
105+
<version>${version.org.hsqldb}</version>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>org.apache.commons</groupId>
110+
<artifactId>commons-dbcp2</artifactId>
111+
<version>${version.org.apache.commons.dbcp2}</version>
112+
</dependency>
113+
114+
<dependency>
115+
<groupId>org.hibernate</groupId>
116+
<artifactId>hibernate-entitymanager</artifactId>
117+
<version>${version.org.hibernate}</version>
118+
</dependency>
119+
120+
<dependency>
121+
<groupId>org.apache.logging.log4j</groupId>
122+
<artifactId>log4j-core</artifactId>
123+
<version>${version.org.apache.logging.log4j}</version>
124+
</dependency>
125+
126+
<dependency>
127+
<groupId>org.apache.logging.log4j</groupId>
128+
<artifactId>log4j-slf4j-impl</artifactId>
129+
<version>${version.org.apache.logging.log4j}</version>
130+
</dependency>
131+
132+
<dependency>
133+
<groupId>org.springframework.security</groupId>
134+
<artifactId>spring-security-web</artifactId>
135+
<version>${version.org.springframework.security}</version>
136+
</dependency>
137+
138+
<dependency>
139+
<groupId>org.springframework.security</groupId>
140+
<artifactId>spring-security-config</artifactId>
141+
<version>${version.org.springframework.security}</version>
142+
</dependency>
143+
144+
<dependency>
145+
<groupId>javax.servlet</groupId>
146+
<artifactId>javax.servlet-api</artifactId>
147+
<version>${version.javax.servlet-api}</version>
148+
<scope>provided</scope>
149+
</dependency>
150+
151+
<dependency>
152+
<groupId>org.springframework</groupId>
153+
<artifactId>spring-test</artifactId>
154+
<version>${version.org.springframework}</version>
155+
<scope>test</scope>
156+
</dependency>
157+
158+
<dependency>
159+
<groupId>junit</groupId>
160+
<artifactId>junit</artifactId>
161+
<version>${version.junit}</version>
162+
<scope>test</scope>
163+
</dependency>
164+
</dependencies>
165+
182166
</project>

src/main/java/net/dontdrinkandroot/example/angularrestspringsecurity/entity/BlogPost.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.dontdrinkandroot.example.angularrestspringsecurity.entity;
22

3+
import com.fasterxml.jackson.annotation.JsonView;
34
import net.dontdrinkandroot.example.angularrestspringsecurity.JsonViews;
4-
import org.codehaus.jackson.map.annotate.JsonView;
55

66
import javax.persistence.Column;
77
import javax.persistence.GeneratedValue;

src/main/java/net/dontdrinkandroot/example/angularrestspringsecurity/rest/resources/BlogPostResource.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package net.dontdrinkandroot.example.angularrestspringsecurity.rest.resources;
22

3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import com.fasterxml.jackson.databind.ObjectWriter;
35
import net.dontdrinkandroot.example.angularrestspringsecurity.JsonViews;
46
import net.dontdrinkandroot.example.angularrestspringsecurity.dao.blogpost.BlogPostDao;
57
import net.dontdrinkandroot.example.angularrestspringsecurity.entity.BlogPost;
68
import net.dontdrinkandroot.example.angularrestspringsecurity.entity.Role;
7-
import org.codehaus.jackson.map.ObjectMapper;
8-
import org.codehaus.jackson.map.ObjectWriter;
99
import org.slf4j.Logger;
1010
import org.slf4j.LoggerFactory;
1111
import org.springframework.beans.factory.annotation.Autowired;

src/main/java/net/dontdrinkandroot/example/angularrestspringsecurity/rest/resources/UserResource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public AccessToken authenticate(@FormParam("username") String username, @FormPar
8080

8181
private Map<String, Boolean> createRoleMap(UserDetails userDetails)
8282
{
83-
Map<String, Boolean> roles = new HashMap<String, Boolean>();
83+
Map<String, Boolean> roles = new HashMap<>();
8484
for (GrantedAuthority authority : userDetails.getAuthorities()) {
8585
roles.put(authority.getAuthority(), Boolean.TRUE);
8686
}

0 commit comments

Comments
 (0)