Skip to content

A simple Maven plugin for retreiving YAML data during compilation. Useful for Bukkit plugins.

Notifications You must be signed in to change notification settings

InsiderIn/yaml-properties-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Yaml-Properties-Plugin

This Maven plugin allows you to reference YAML key-value pairs through Maven properties. To use it, add the following repository to your pom:

<pluginRepositories>
  <pluginRepository>
    <id>comphenix-rep</id>
    <name>Comphenix Maven Releases</name>
    <url>http://repo.comphenix.net/content/groups/public</url>
  </pluginRepository>
</pluginRepositories>

Then reference the plugin itself:

<build>
  <plugins>
    <plugin>
      <groupId>com.comphenix.maven</groupId>
	  <artifactId>yaml-properties-plugin</artifactId>
	  <version>0.1.0</version>
	  <executions>
	    <execution>
		  <goals>
		    <goal>read-yaml-properties</goal>
		  </goals>
		  <configuration>
		    <files>
			  <!-- YAML files that will be loaded. The element name is the file ID. -->
		      <plugin>${basedir}/src/main/resources/plugin.yml</plugin>
		    </files>
          </configuration> 
		</execution>
      </executions>  
    </plugin>
	...
  </plugins>
</build>

A possible use of this is to import plugin name and version from a Bukkit plugin.yml file:

<version>${yaml.plugin.version}</version>
<name>${yaml.plugin.name}</name>
<description>${yaml.plugin.version}</description>

The syntax for referencing values in the YAML file is as follows:

${yaml.FILE_ID.KEY}

Of course, you can dig deeper into the hierachy as well, along with looking up list elements by index:

${yaml.FILE_ID.KEY.LIST[INDEX].KEY}

About

A simple Maven plugin for retreiving YAML data during compilation. Useful for Bukkit plugins.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 97.7%
  • Groovy 2.3%