I tried to define a way to validate source code defined in an xml file in a project for an ESB (Websphere ESB).
As I want a code analysis solution which could be integrate in a livecycle I chose Sonar and the sonar xml plugin.
All my rules are xpath Rules, but some value are based on the project name. I want to my rule in the quality profile to use the project name as a variable.
Example :
<EventSource>
<Name>MethodInvocation:/SAPExport.receiveIDoc</Name>
<Property>CEI</Property>
<Event active="true" label="MyProjectName_Entry" name="ENTRY" payload="FULL" tx="SAME"/>
<Event active="true" label="MyProjectName_Failure" name="FAILURE" payload="EMPTY" tx="NEW"/>
</EventSource>
When setting my xpath rule I want to ensure that the label matches the pattern $ProjectName$_[Entry|Failure]
The $ProjectName$ value is equal to the value set in sonar.projectName property
Does anybody know if sonar could do that?
AFAIK, the Sonar XML plugin does not allow this.