Skip to content

Commit 8179e85

Browse files
committed
Merge pull request #244 from garethf/issues/243
Issues/243
2 parents 4263c55 + b1f9a59 commit 8179e85

232 files changed

Lines changed: 24802 additions & 27878 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.settings
22
.DS_Store
33
.project
4+
.checkstyle
45
target
56
.classpath
67
target

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ Note this points to the main buddycloud repository for the java server.
88

99
[![Build Status](https://travis-ci.org/buddycloud/buddycloud-server-java.png?branch=master)](https://travis-ci.org/buddycloud/buddycloud-server-java)
1010

11+
## Coding Standards
12+
13+
Checkstyle is used to confirm the preferred coding standards are used, these are based loosely on Google's OS Java guidelines. There is support in maven, the build should fail on the introduction of errors and there is also support for automated formatting in Eclipse. To setup do the following -
14+
15+
* Navigate to Eclipse->Preferences->Java ->Code Style->Formatter
16+
* Select 'import' and there is a file named 'eclipse_formatter.xml' in src/main/resources.
17+
* Import and set it as the active profile
18+
19+
N.B. Its also worth setting up the hooks that allow for formatting and organising of imports on save, to do this
20+
21+
* Navigate to Eclipse->Preferences->Java->Code Style->Save Actions
22+
* Select 'Format All Lines' and 'Organize Imports'
23+
1124
## Database install
1225

1326
The java server purposefully uses the same database schema as the buddycloud node.js server. See here for database installation instructions https://github.com/buddycloud/buddycloud-server/tree/develop/postgres.

pom.xml

Lines changed: 100 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<scm>
1111
<url>https://github.com/buddycloud/buddycloud-server-java</url>
1212
</scm>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<project.build.withDependencies>jar-with-dependencies</project.build.withDependencies>
17+
<maven.checkstyle.plugin.version>2.13</maven.checkstyle.plugin.version>
18+
<checkstyle.config.location>src/main/resources/checkstyle.xml</checkstyle.config.location>
19+
</properties>
20+
1321
<dependencies>
1422
<dependency>
1523
<groupId>org.xbill</groupId>
@@ -148,69 +156,72 @@
148156
</repository>
149157
</repositories>
150158
<build>
151-
<plugins>
152-
<plugin>
153-
<!-- Extended Maven antrun plugin -->
154-
<!-- https://maven-antrun-extended-plugin.dev.java.net/ -->
155-
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
156-
<artifactId>maven-antrun-extended-plugin</artifactId>
157-
<executions>
158-
<execution>
159-
<id>test-reports</id>
160-
<phase>test</phase>
161-
<configuration>
162-
<tasks unless="maven.test.skip">
163-
<junitreport todir="target/surefire-reports">
164-
<fileset dir="target/surefire-reports">
165-
<include name="**/*.xml" />
166-
</fileset>
167-
<report format="noframes"
168-
todir="target/surefire-reports" />
169-
</junitreport>
170-
</tasks>
171-
</configuration>
172-
<goals>
173-
<goal>run</goal>
174-
</goals>
175-
</execution>
176-
</executions>
177-
<dependencies>
178-
<dependency>
179-
<groupId>org.apache.ant</groupId>
180-
<artifactId>ant-junit</artifactId>
181-
<version>1.8.0</version>
182-
</dependency>
183-
<dependency>
184-
<groupId>org.apache.ant</groupId>
185-
<artifactId>ant-trax</artifactId>
186-
<version>1.8.0</version>
187-
</dependency>
188-
</dependencies>
189-
</plugin>
190-
<plugin>
191-
<groupId>org.apache.maven.plugins</groupId>
192-
<artifactId>maven-surefire-plugin</artifactId>
193-
<version>2.5</version>
194-
<configuration>
195-
<argLine>-Duser.timezone=UTC -XX:MaxPermSize=1024m -Xmx1024m</argLine>
196-
<skipTests>false</skipTests>
197-
<testFailureIgnore>true</testFailureIgnore>
198-
<forkMode>once</forkMode>
199-
<includes>
200-
<include>**/*Test.java</include>
201-
</includes>
202-
<useFile>false</useFile>
203-
</configuration>
204-
</plugin>
205-
<plugin>
206-
<groupId>org.apache.maven.plugins</groupId>
207-
<artifactId>maven-compiler-plugin</artifactId>
208-
<version>2.5.1</version>
209-
<configuration>
210-
<source>1.6</source>
211-
<target>1.6</target>
212-
</configuration>
213-
</plugin>
159+
<pluginManagement>
160+
<plugins>
161+
<plugin>
162+
<!-- Extended Maven antrun plugin -->
163+
<!-- https://maven-antrun-extended-plugin.dev.java.net/ -->
164+
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
165+
<artifactId>maven-antrun-extended-plugin</artifactId>
166+
<executions>
167+
<execution>
168+
<id>test-reports</id>
169+
<phase>test</phase>
170+
<configuration>
171+
<tasks unless="maven.test.skip">
172+
<junitreport
173+
todir="target/surefire-reports">
174+
<fileset
175+
dir="target/surefire-reports">
176+
<include name="**/*.xml" />
177+
</fileset>
178+
<report format="noframes"
179+
todir="target/surefire-reports" />
180+
</junitreport>
181+
</tasks>
182+
</configuration>
183+
<goals>
184+
<goal>run</goal>
185+
</goals>
186+
</execution>
187+
</executions>
188+
<dependencies>
189+
<dependency>
190+
<groupId>org.apache.ant</groupId>
191+
<artifactId>ant-junit</artifactId>
192+
<version>1.8.0</version>
193+
</dependency>
194+
<dependency>
195+
<groupId>org.apache.ant</groupId>
196+
<artifactId>ant-trax</artifactId>
197+
<version>1.8.0</version>
198+
</dependency>
199+
</dependencies>
200+
</plugin>
201+
<plugin>
202+
<groupId>org.apache.maven.plugins</groupId>
203+
<artifactId>maven-surefire-plugin</artifactId>
204+
<version>2.5</version>
205+
<configuration>
206+
<argLine>-Duser.timezone=UTC -XX:MaxPermSize=1024m -Xmx1024m</argLine>
207+
<skipTests>false</skipTests>
208+
<testFailureIgnore>true</testFailureIgnore>
209+
<forkMode>once</forkMode>
210+
<includes>
211+
<include>**/*Test.java</include>
212+
</includes>
213+
<useFile>false</useFile>
214+
</configuration>
215+
</plugin>
216+
<plugin>
217+
<groupId>org.apache.maven.plugins</groupId>
218+
<artifactId>maven-compiler-plugin</artifactId>
219+
<version>2.5.1</version>
220+
<configuration>
221+
<source>1.6</source>
222+
<target>1.6</target>
223+
</configuration>
224+
</plugin>
214225
<plugin>
215226
<groupId>org.apache.maven.plugins</groupId>
216227
<artifactId>maven-shade-plugin</artifactId>
@@ -233,10 +244,31 @@
233244
</execution>
234245
</executions>
235246
</plugin>
236-
</plugins>
247+
<plugin>
248+
<groupId>org.apache.maven.plugins</groupId>
249+
<artifactId>maven-checkstyle-plugin</artifactId>
250+
<configuration>
251+
<failOnViolation>true</failOnViolation>
252+
<failsOnError>true</failsOnError>
253+
<encoding>UTF-8</encoding>
254+
<consoleOutput>false</consoleOutput>
255+
<linkXRef>false</linkXRef>
256+
<includes>**\/*.java</includes>
257+
<includeResources>false</includeResources>
258+
</configuration>
259+
<version>${maven.checkstyle.plugin.version}</version>
260+
<executions>
261+
<execution>
262+
<id>validate</id>
263+
<phase>validate</phase>
264+
<goals>
265+
<goal>check</goal>
266+
</goals>
267+
</execution>
268+
</executions>
269+
</plugin>
270+
</plugins>
271+
</pluginManagement>
237272
</build>
238-
<properties>
239-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
240-
<project.build.withDependencies>jar-with-dependencies</project.build.withDependencies>
241-
</properties>
273+
242274
</project>

0 commit comments

Comments
 (0)