-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching off .xml extension for xml language the (other) xml checks no longer work #19
Comments
I created a fork with *.mule as extension which requires to copy/rename the files before analysis: https://github.com/c-a-services/mule-sonarqube-plugin/tree/use-mule-file-extension (Just changing in sonar config is not sufficient as MuleFilePredicate still searching for .xml, see #20 ) |
Hi @ca-stefan-cordes, you could disable the XML plugin at project level instead of to all the server instance. Does that work for you? |
HI @fperezpa,
For 2. we could integrate the xpath expressions in the rules-4.xml as workaround, but then e.g. "log4j2.xml" needs to be checked by mule, too - not nice. My current workaround is to copy all mule-xml files via ant to *.mule and change the language for this plugin to .mule. pom.xml:
With Additionally I digged a little bit in the sonar architecture and found that e.g. the file-path (src/main/mule/**/.xml) can be changed for a language as well but still the exception comes up (as xml plugin is **/.xml):
This problem is more likely a restriction of the sonar architecture and the best way to solve would be to define mule files with an own extension in AnypointStudio directly (like *.mule or *.mulexml) but that probably is a large change to your platform... So for this issue I think we can work with the workaround. I can add a section to the readme.md to via this issue how to co-existence with the xml plugin and then all should be fine. |
The simple fix for this issue is to disable Mule plugin completely by updating File Suffixes for the Mule plugin.
Note: Alternatively these values can be passed as VM arguments while running sonar scan.
This fix will help if your Sonarqube server is shared across teams and you don't want to disturb other projects those are using XML Plugin. |
Hi @chirubtech, Unfortunately we currently have XML plugin rules (xpath) for mule-applications :-( When this plugin is based on javax.xml.xpath (see #23) it will be easy to move all our xml-plugin-mule-xpath rules to rules-4.xml and so we can use your workaround as mule projects no longer will need XML-Plugin. |
Thank you. I figured out the first step but couldn't see how to enable the Mule plugin (and disable default xml) for running on Mule projects. I can automate this in CICD so you've given me the solution I need. Given the age of this ticket you haven't found a way to disable and enable plugins for certain projects do you? Not having an |
Same as above, if multiple projects use one server not being able to make modifications per-project is a real issue. |
Hello,
|
When switching off
Administration-> Configuration->General Settings->XML and delete the .xml "File suffixes"
to enable mule-sonarqube to work with .xml files (as documented),
(btw. it is Administration-> Configuration -> Language -> XML in Sonar Version 8.1 )
the rules for XML no longer apply.
E.g. XPath rules are switched off:
Please add another approach to scan xml files with this mule plugin.
Log of mvn sonar:sonar differs:
![image](https://user-images.githubusercontent.com/50696194/100087454-0a000680-2e4f-11eb-9bdf-39481e6a909c.png)
With .xml:
Without .xml:
![image](https://user-images.githubusercontent.com/50696194/100087482-171cf580-2e4f-11eb-82bf-91d3f7a946d2.png)
The text was updated successfully, but these errors were encountered: