Skip to content

Create a feature

Emmanuel Chebbi edited this page Jul 7, 2018 · 2 revisions

Location

All the features should be located under the features/ folder. This is a convention making easier for a newcomer to understand project's architecture.

Hence, adding a fr.kazejiyu.foo.feature plug-in to the project would result in the following tree structure:

.
├───features
│   │   pom.xml
│   └───fr.kazejiyu.foo.feature
│           .project
│           build.properties
│           feature.xml

Add to Maven build

In order to be taken into account by Maven, the plug-in must be added as a sub-module of the features module. To this end, the features/pom.xml must be enhanced with a <module> tag as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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>fr.kazejiyu.piou</groupId>
	<artifactId>fr.kazejiyu.piou.features</artifactId>
	<packaging>pom</packaging>
	
        ...
        
        <modules>
                <module>fr.kazejiyu.foo.feature</module>
        </modules>    
</project>