switching to maven

This commit is contained in:
aPunch 2012-01-16 15:18:47 -06:00
parent 7b727c3d6b
commit 2ef5d5323d
8 changed files with 156 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
/bin
/build
/target
.classpath
.project
Citizens.jar

41
build.xml Normal file
View File

@ -0,0 +1,41 @@
<project name="Citizens" default="dist" basedir=".">
<description>
Citizens build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="lib" location="lib" />
<target name="init">
<!-- Create neccesary folders -->
<mkdir dir="${build}" />
</target>
<!-- Compile the code -->
<target name="dist" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,vars,source" includeantruntime="false" encoding="Cp1252">
<classpath>
<pathelement path="${lib}" />
<pathelement location="${lib}/bukkit.jar" />
<pathelement location="${lib}/craftbukkit.jar" />
<pathelement location="${lib}/CitizensAPI.jar" />
<fileset dir="lib">
<include name="CitizensAPI.jar" />
</fileset>
</classpath>
</javac>
<antcall target="distcore" />
</target>
<!-- Generate the jars -->
<target name="distcore" description="generate the distribution">
<jar jarfile="Citizens.jar" basedir="${build}" encoding="Cp1252">
<zipfileset dir="." includes="*.yml" />
</jar>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>
</project>

Binary file not shown.

4
plugin.yml Normal file
View File

@ -0,0 +1,4 @@
name: Citizens
authors: [aPunch, fullwall]
version: 2.0
main: net.citizensnpcs.Citizens

108
pom.xml Normal file
View File

@ -0,0 +1,108 @@
<!-- Citizens build file -->
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0</version>
<name>Citizens</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.1-R1-SNAPSHOT</craftbukkit.version>
<build.number>Unknown</build.number>
</properties>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/repo/</url>
</repository>
<repository>
<id>citizensapi-repo</id>
<!-- This does not work yet. Need repo to be set up. -->
<url>http://repo.citizensnpcs.net/content/groups/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>${craftbukkit.version}</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizensapi</artifactId>
<version>2.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean</defaultGoal>
<sourceDirectory>${basedir}/src</sourceDirectory>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>false</filtering>
<directory>${basedir}</directory>
</resource>
<resource>
<targetPath>.</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>net.citizensnpcs:*</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -3,7 +3,7 @@ package net.citizensnpcs.npc;
import java.util.HashSet;
import java.util.Set;
import net.citizensnpcs.api.Citizens;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.event.NPCDespawnEvent;
import net.citizensnpcs.api.event.NPCSpawnEvent;
import net.citizensnpcs.api.npc.trait.Character;
@ -32,7 +32,7 @@ public class CitizensNPC implements NPC {
for (Trait trait : traits) {
this.traits.add(trait);
}
manager = (CitizensNPCManager) Citizens.getNPCManager();
manager = (CitizensNPCManager) CitizensAPI.getNPCManager();
id = manager.getUniqueID();
}