Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added maven profile to easily test the plugin #7

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
@@ -0,0 +1,7 @@
Testing your plugin
-------------------

Run `mvn package -Pstart-server`.

This will compile and packge your plugin, then download all the necessary dependencies to run the server which will be started in the folder `server`.

61 changes: 51 additions & 10 deletions pom.xml
@@ -1,23 +1,58 @@
<?xml version="1.0"?>
<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>org.bukkit</groupId>
<artifactId>bukkit-sample-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>BukkitSamplePlugin</name>
<url>http://www.bukkit.org</url>
<repositories>
<repository>
<id>bukkit-plugins-snapshot</id>
<url>http://repo.bukkit.org/artifactory/libs-snapshot-local</url>
</repository>
</repositories>
<build>
<plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>start-server</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<workingDirectory>server</workingDirectory>
<classpathScope>test</classpathScope>
<commandlineArgs>-Xmx1024M -cp %classpath org.bukkit.craftbukkit.Main -P ../target</commandlineArgs>
</configuration>
</plugin>
</plugins>
</build>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
Expand All @@ -26,5 +61,11 @@
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>