简体   繁体   中英

How to import new java plugin rules in Sonarqube

I am using Sonarqube 5.2. with Java Plugin 3.8 . Looks like there are 339 Rules for Java in the Java plugin. However, in the default quality profile there are 234 rules.

I believe this is because initially I had Java Plugin 3.0 which had 234 rules due to which the default quality profile also has the same number of rules.

Now since i have upgraded the Java plugin to 3.8 there are new rules but those aren't part of the default quality profile.

So how do i implement the remaining 105 rules. Do i have to create a new quality profile, if yes then how do i import the new rules from Java plugin into the quality profile.

Alternatively can I change the default profile and add the missing rules to it ?

You can "Restore Built-in Profiles" by language (look under the arrow menu next to "Create") to catch them up to their most current versions.

You can copy one profile to another in the Rules space. Use the "Quality Profile" search facet to find all the rules active in your source profile, then use Bulk Change to activate them in your target profile.

If I were you, I'd do both: create a new profile, copy your current default profile into it (I'm assuming Sonar way is your current default), then Restore Built-in Profiles for Java. At that point you can use the profile comparison feature to see what changes have been made in the default profile and decide individually whether to apply them in your (new) default profile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM