Created
January 7, 2013 19:22
-
-
Save mbax/4477632 to your computer and use it in GitHub Desktop.
Example maven things
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> | |
<!-- Above this line, here be dragons --> | |
<!-- Here, I specify the unique identifying information maven will use. | |
groupId is sort of like a package name, a degree of ownership | |
artifactId is the unique name within that groupId for this project --> | |
<groupId>org.kitteh</groupId> | |
<artifactId>notched</artifactId> | |
<!-- Specifying its version, used by maven for tracking versions. | |
I also use it through filtering (see below) to define version in plugin.yml --> | |
<version>1.2.1-SNAPSHOT</version> | |
<!-- Here is the name! This is just internally used by maven. Same with the URL. --> | |
<name>Notched</name> | |
<url>http://github.com/mbax/Notched</url> | |
<!-- UTF-8 please --> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
</properties> | |
<!-- Defining the repository to search, as this is where Bukkit is stored --> | |
<repositories> | |
<repository> | |
<id>bukkit-repo</id> | |
<url>http://repo.bukkit.org/content/groups/public</url> | |
</repository> | |
</repositories> | |
<!-- Informing Maven that I depend on Bukkit. It will be part of the compiling classpath. | |
If Maven can't find it on the local system it will search the repositories for it. | |
I use version RELEASE here because that will always point to the latest RB/beta --> | |
<dependencies> | |
<dependency> | |
<groupId>org.bukkit</groupId> | |
<artifactId>bukkit</artifactId> | |
<version>RELEASE</version> | |
<type>jar</type> | |
</dependency> | |
</dependencies> | |
<build> | |
<!-- finalName defines the jar file's name. Here I specify it's project.artifactId | |
The default is name-project --> | |
<finalName>${project.artifactId}</finalName> | |
<!-- The defaultGoal definition means instead of typing 'mvn clean install' I can just type 'mvn' --> | |
<defaultGoal>clean install</defaultGoal> | |
<resources> | |
<!-- Defining one set of resources (from one source folder with one destination) --> | |
<resource> | |
<!-- Relative path within the jar. So, these ones are going to the jar root --> | |
<targetPath>.</targetPath> | |
<!-- Filtering means it will check these files for anything like ${project.version} and replace with the data in here --> | |
<filtering>true</filtering> | |
<!-- This is the directory they are located in, relative to the pom.xml --> | |
<directory>${basedir}/src/main/resources</directory> | |
<includes> | |
<include>complicated.yml</include> | |
<include>config.yml</include> | |
<include>plugin.yml</include> | |
</includes> | |
</resource> | |
</resources> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment