A Maven/Tycho project to add some validation rules for OSGI development. Most of the rules are pretty simple and are used to maintain coherence in a multi-plugin project.
This project is built using Maven. To build locally, simply execute the command line:
mvn clean install
Configuration to add in the pom.xml of your project:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>${enforcer.api.version}</version> <dependencies> <dependency> <groupId>org.eclipse.papyrus</groupId> <artifactId>papyrus-enforcer-rules</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> </dependencies> <executions> <execution> <id>papyrus-enforce</id> <phase>validate</phase> <goals> <goal>enforce</goal> </goals> <configuration> <rules> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build>
Check that a specific field in the manifest.mf is equals to a predefined value Example : Check that Bundle-Localization is using the correct property file plugin
<myCustomRule implementation="org.eclipse.papyrus.tycho.enforcer.rules.CheckManifestParameter"> <field>Bundle-Localization</field> <value>plugin</value> </myCustomRule>
Check that all required bundle have bundle-version set.
<myCustomRule implementation="org.eclipse.papyrus.tycho.enforcer.rules.RequireBundleVersion"> </myCustomRule>
Check that required bundle are following a specific order. Parameter :
Example : Check that plugins starting by org.eclipse.ui are imported before plugins starting by org.eclipse.core
<myCustomRule implementation="org.eclipse.papyrus.tycho.enforcer.rules.RequireBundleOrder"> <order> <namespace>org.eclipse.ui</namespace> <namespace>org.eclipse.core</namespace> </order> <inverse>false</inverse> </myCustomRule>