Skip to content

Commit 7f3c645

Browse files
committed
polishing
1 parent ecbd2e3 commit 7f3c645

File tree

8 files changed

+251
-37
lines changed

8 files changed

+251
-37
lines changed

pom.xml

Lines changed: 180 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,35 @@
55
<artifactId>audit4j-spring</artifactId>
66
<packaging>jar</packaging>
77
<name>Audit4j - Spring Integration</name>
8-
<version>2.4.0</version>
8+
<version>2.4.1-RC1</version>
99
<url>http://audit4j.org</url>
1010
<description>Audit4j - An open-source auditing framework for Java, Spring Integration</description>
11+
1112
<organization>
1213
<name>Audit4j</name>
1314
<url>http://audit4j.org</url>
1415
</organization>
16+
1517
<licenses>
1618
<license>
1719
<name>The Apache Software License, Version 2.0</name>
1820
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
1921
<distribution>repo</distribution>
2022
</license>
2123
</licenses>
24+
2225
<issueManagement>
23-
<system>mantis</system>
24-
<url>http://audit4j.org/bugs</url>
26+
<system>github</system>
27+
<url>https://github.com/audit4j/audit4j-core/issues</url>
2528
</issueManagement>
29+
2630
<scm>
2731
<connection>scm:git:[email protected]:audit4j/audit4j-spring.git</connection>
2832
<developerConnection>scm:git:[email protected]:audit4j/audit4j-spring.git</developerConnection>
2933
<url>scm:git:[email protected]:audit4j/audit4j-spring.git</url>
3034
<tag>2.4.0</tag>
3135
</scm>
36+
3237
<developers>
3338
<developer>
3439
<id>janith</id>
@@ -37,19 +42,13 @@
3742
<organizationUrl>http://audit4j.org</organizationUrl>
3843
<email>[email protected]</email>
3944
<roles>
40-
<role>owner</role>
41-
<role>developer</role>
45+
<role>Project Lead</role>
46+
<role>Developer</role>
4247
</roles>
4348
<timezone>+05:30</timezone>
4449
</developer>
4550
</developers>
4651

47-
<parent>
48-
<groupId>org.sonatype.oss</groupId>
49-
<artifactId>oss-parent</artifactId>
50-
<version>7</version>
51-
</parent>
52-
5352
<properties>
5453
<junit.version>4.11</junit.version>
5554
<audit4j.version>2.4.0</audit4j.version>
@@ -108,6 +107,17 @@
108107
</dependencies>
109108

110109

110+
<distributionManagement>
111+
<repository>
112+
<id>oss.sonatype.org</id>
113+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
114+
</repository>
115+
<snapshotRepository>
116+
<id>oss.sonatype.org</id>
117+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
118+
</snapshotRepository>
119+
</distributionManagement>
120+
111121
<build>
112122
<plugins>
113123
<plugin>
@@ -116,16 +126,20 @@
116126
<configuration>
117127
<source>1.7</source>
118128
<target>1.7</target>
129+
<!-- [#2413] Make compiler warnings a bit more visible But don't fail
130+
(yet) -->
131+
<compilerArgs>
132+
<arg>-Xlint:varargs</arg>
133+
</compilerArgs>
119134
</configuration>
120135
</plugin>
121136
<plugin>
122137
<groupId>org.apache.maven.plugins</groupId>
123-
<artifactId>maven-javadoc-plugin</artifactId>
138+
<artifactId>maven-source-plugin</artifactId>
139+
<version>2.4</version>
124140
<executions>
125141
<execution>
126-
<id>attach-javadocs</id>
127-
<!-- Restrict execution of source compilation to install -->
128-
<phase>install</phase>
142+
<id>attach-sources</id>
129143
<goals>
130144
<goal>jar</goal>
131145
</goals>
@@ -134,45 +148,182 @@
134148
</plugin>
135149
<plugin>
136150
<groupId>org.apache.maven.plugins</groupId>
137-
<artifactId>maven-source-plugin</artifactId>
151+
<artifactId>maven-javadoc-plugin</artifactId>
152+
<version>2.10.3</version>
153+
<configuration>
154+
<charset>${file_encoding}</charset>
155+
<encoding>${file_encoding}</encoding>
156+
</configuration>
138157
<executions>
139158
<execution>
140-
<phase>install</phase>
159+
<id>attach-javadocs</id>
141160
<goals>
142161
<goal>jar</goal>
143162
</goals>
163+
<configuration>
164+
<additionalparam>-Xdoclint:none</additionalparam>
165+
</configuration>
144166
</execution>
145167
</executions>
146168
</plugin>
147169
<plugin>
148170
<groupId>org.apache.maven.plugins</groupId>
149-
<artifactId>maven-release-plugin</artifactId>
150-
<version>2.5</version>
171+
<artifactId>maven-jar-plugin</artifactId>
151172
<configuration>
152-
<tagNameFormat>v@{project.version}</tagNameFormat>
173+
<archive>
174+
<manifest>
175+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
176+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
177+
</manifest>
178+
</archive>
153179
</configuration>
154180
</plugin>
155181
<plugin>
156-
<groupId>org.apache.maven.plugins</groupId>
157-
<artifactId>maven-eclipse-plugin</artifactId>
182+
<groupId>org.codehaus.mojo</groupId>
183+
<artifactId>versions-maven-plugin</artifactId>
184+
<version>2.2</version>
185+
<configuration>
186+
<generateBackupPoms>false</generateBackupPoms>
187+
</configuration>
158188
</plugin>
159189
<plugin>
160-
<groupId>org.apache.maven.plugins</groupId>
161-
<artifactId>maven-surefire-plugin</artifactId>
190+
<artifactId>maven-deploy-plugin</artifactId>
191+
<version>2.8.2</version>
192+
<configuration>
193+
<skip>true</skip>
194+
</configuration>
162195
</plugin>
163196
<plugin>
164-
<groupId>org.apache.maven.plugins</groupId>
165-
<artifactId>maven-gpg-plugin</artifactId>
197+
<groupId>org.sonatype.plugins</groupId>
198+
<artifactId>nexus-staging-maven-plugin</artifactId>
199+
<version>1.6.5</version>
200+
<extensions>true</extensions>
201+
<configuration>
202+
<serverId>oss.sonatype.org</serverId>
203+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
204+
<description>${project.version}</description>
205+
</configuration>
166206
<executions>
167207
<execution>
168-
<id>sign-artifacts</id>
169-
<phase>verify</phase>
208+
<id>deploy-to-sonatype</id>
209+
<phase>deploy</phase>
170210
<goals>
171-
<goal>sign</goal>
211+
<goal>deploy</goal>
212+
<goal>release</goal>
172213
</goals>
173214
</execution>
174215
</executions>
175216
</plugin>
217+
<plugin>
218+
<groupId>org.apache.maven.plugins</groupId>
219+
<artifactId>maven-release-plugin</artifactId>
220+
<version>2.3.2</version>
221+
<configuration>
222+
<tagNameFormat>@{project.version}</tagNameFormat>
223+
</configuration>
224+
</plugin>
225+
<plugin>
226+
<groupId>org.apache.maven.plugins</groupId>
227+
<artifactId>maven-eclipse-plugin</artifactId>
228+
<configuration>
229+
<downloadSources>true</downloadSources>
230+
<downloadJavadocs>true</downloadJavadocs>
231+
</configuration>
232+
</plugin>
233+
<plugin>
234+
<groupId>org.apache.maven.plugins</groupId>
235+
<artifactId>maven-surefire-plugin</artifactId>
236+
</plugin>
237+
176238
</plugins>
177239
</build>
240+
241+
<!-- Execute this mvn -DperformRelease=true -->
242+
<profiles>
243+
<profile>
244+
<id>release-sign-artifacts</id>
245+
<activation>
246+
<property>
247+
<name>performRelease</name>
248+
<value>true</value>
249+
</property>
250+
</activation>
251+
<build>
252+
<plugins>
253+
<plugin>
254+
<groupId>org.apache.maven.plugins</groupId>
255+
<artifactId>maven-gpg-plugin</artifactId>
256+
<version>1.6</version>
257+
<executions>
258+
<execution>
259+
<id>sign-artifacts</id>
260+
<phase>verify</phase>
261+
<goals>
262+
<goal>sign</goal>
263+
</goals>
264+
</execution>
265+
</executions>
266+
</plugin>
267+
</plugins>
268+
</build>
269+
</profile>
270+
</profiles>
271+
272+
<reporting>
273+
<plugins>
274+
<plugin>
275+
<groupId>org.codehaus.mojo</groupId>
276+
<artifactId>cobertura-maven-plugin</artifactId>
277+
<version>2.6</version>
278+
</plugin>
279+
<plugin>
280+
<groupId>org.codehaus.mojo</groupId>
281+
<artifactId>findbugs-maven-plugin</artifactId>
282+
<version>3.0.0</version>
283+
</plugin>
284+
<plugin>
285+
<groupId>org.apache.maven.plugins</groupId>
286+
<artifactId>maven-pmd-plugin</artifactId>
287+
<version>3.4</version>
288+
<configuration>
289+
<linkXref>true</linkXref>
290+
<sourceEncoding>utf-8</sourceEncoding>
291+
<minimumTokens>100</minimumTokens>
292+
<targetJdk>1.5</targetJdk>
293+
</configuration>
294+
</plugin>
295+
<plugin>
296+
<groupId>org.apache.maven.plugins</groupId>
297+
<artifactId>maven-project-info-reports-plugin</artifactId>
298+
<version>2.6</version>
299+
<reportSets>
300+
<reportSet>
301+
<reports><!-- select reports -->
302+
<report>index</report>
303+
</reports>
304+
</reportSet>
305+
</reportSets>
306+
</plugin>
307+
<plugin>
308+
<groupId>org.apache.maven.plugins</groupId>
309+
<artifactId>maven-javadoc-plugin</artifactId>
310+
<version>2.9</version>
311+
<reportSets>
312+
<reportSet>
313+
<reports>
314+
<report>javadoc</report>
315+
<report>test-javadoc</report>
316+
</reports>
317+
</reportSet>
318+
<reportSet>
319+
<id>aggregate</id>
320+
<inherited>false</inherited>
321+
<reports>
322+
<report>aggregate</report>
323+
</reports>
324+
</reportSet>
325+
</reportSets>
326+
</plugin>
327+
</plugins>
328+
</reporting>
178329
</project>

src/main/java/org/audit4j/integration/spring/AuditAdvice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014-2015 Janith Bandara, This source is a part of
2+
* Copyright (c) 2014-2016 Janith Bandara, This source is a part of
33
* Audit4j - An open source auditing framework.
44
* http://audit4j.org
55
*

src/main/java/org/audit4j/integration/spring/AuditAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014-2015 Janith Bandara, This source is a part of
2+
* Copyright (c) 2014-2016 Janith Bandara, This source is a part of
33
* Audit4j - An open source auditing framework.
44
* http://audit4j.org
55
*

src/main/java/org/audit4j/integration/spring/AuditAspectOld.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014-2015 Janith Bandara, This source is a part of
2+
* Copyright (c) 2014-2016 Janith Bandara, This source is a part of
33
* Audit4j - An open source auditing framework.
44
* http://audit4j.org
55
*

src/main/java/org/audit4j/integration/spring/SpringAudit4jConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014-2015 Janith Bandara, This source is a part of
2+
* Copyright (c) 2014-2016 Janith Bandara, This source is a part of
33
* Audit4j - An open source auditing framework.
44
* http://audit4j.org
55
*

src/main/java/org/audit4j/integration/spring/SpringSecurityWebAuditMetaData.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright (c) 2014-2016 Janith Bandara, This source is a part of
3+
* Audit4j - An open source auditing framework.
4+
* http://audit4j.org
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
package org.audit4j.integration.spring;
220

321
import org.springframework.security.core.Authentication;
@@ -28,6 +46,8 @@ public String getActor() {
2846
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
2947
if (authentication != null && authentication.getPrincipal() instanceof UserDetails) {
3048
return ((UserDetails) authentication.getPrincipal()).getUsername();
49+
} else if (authentication != null && authentication.getPrincipal() instanceof String) {
50+
return (String) authentication.getPrincipal();
3151
}
3252
return undefienedActorName;
3353
}

0 commit comments

Comments
 (0)