Merge pull request #103 from sgdc3/master

Added Metrics + CircleCi support
This commit is contained in:
Alexandre Vanhecke 2015-07-06 21:51:35 +02:00
commit 702d2be8b9
3 changed files with 53 additions and 5 deletions

9
circle.yml Normal file
View File

@ -0,0 +1,9 @@
machine:
java:
version: oraclejdk7
general:
artifacts:
- "target/*.jar"
test:
override:
- mvn clean install

36
pom.xml
View File

@ -3,8 +3,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>fr.xephi.authme</groupId> <groupId>fr.xephi</groupId>
<artifactId>AuthMe</artifactId> <artifactId>authme</artifactId>
<version>5.0-SNAPSHOT</version> <version>5.0-SNAPSHOT</version>
<name>AuthMeReloaded</name> <name>AuthMeReloaded</name>
@ -22,8 +22,6 @@
<!-- Change MC Version HERE! --> <!-- Change MC Version HERE! -->
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion> <bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
<mainClass>${project.groupId}.${project.artifactId}</mainClass>
</properties> </properties>
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! --> <!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
@ -90,8 +88,15 @@
<include>com.sun.mail:*</include> <include>com.sun.mail:*</include>
<include>javax.mail:*</include> <include>javax.mail:*</include>
<include>com.comphenix.attribute:*</include> <include>com.comphenix.attribute:*</include>
<include>org.mcstats.*:*</include>
</includes> </includes>
</artifactSet> </artifactSet>
<relocations>
<relocation>
<pattern>org.mcstats</pattern>
<shadedPattern>fr.xephi.authme</shadedPattern>
</relocation>
</relocations>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
@ -113,6 +118,12 @@
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url> <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository> </repository>
<!-- Mcstats.org Metrics Repo -->
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
</repository>
<!-- Vault Repo (Already in ess repo!) --> <!-- Vault Repo (Already in ess repo!) -->
<repository> <repository>
<id>vault-repo</id> <id>vault-repo</id>
@ -202,6 +213,23 @@
<version>1.2.14</version> <version>1.2.14</version>
</dependency> </dependency>
<dependency>
<groupId>org.mcstats.bukkit</groupId>
<artifactId>metrics-lite</artifactId>
<version>R7</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project, <!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project,
http://bukkit.org/ --> http://bukkit.org/ -->
<dependency> <dependency>

View File

@ -3,6 +3,7 @@ package fr.xephi.authme;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
@ -27,6 +28,7 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.mcstats.MetricsLite;
import com.earth2me.essentials.Essentials; import com.earth2me.essentials.Essentials;
import com.maxmind.geoip.LookupService; import com.maxmind.geoip.LookupService;
@ -126,7 +128,16 @@ public class AuthMe extends JavaPlugin {
this.getServer().shutdown(); this.getServer().shutdown();
return; return;
} }
try {
MetricsLite metrics = new MetricsLite(this);
metrics.start();
ConsoleLogger.info("Metrics-Lite started successfully!");
} catch (IOException e) {
// Failed to submit the stats :-(
ConsoleLogger.showError("Can't start Metrics-Lite! The plugin will work anyway...");
}
citizens = new CitizensCommunicator(this); citizens = new CitizensCommunicator(this);
if (Settings.enableAntiBot) { if (Settings.enableAntiBot) {