-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SONARJAVA-5383 Lookup Spring-web dependency version to filter out visitors #5053
base: master
Are you sure you want to change the base?
Conversation
8d299c6
to
70d7cd8
Compare
@@ -120,7 +120,7 @@ public void javaCheckTestSources() throws Exception { | |||
.setProjectName(PROJECT_NAME) | |||
.setProjectVersion("0.1.0-SNAPSHOT") | |||
.setSourceEncoding("UTF-8") | |||
.setSourceDirs("aws/src/main/java/,default/src/main/java/,java-17/src/main/java/,spring-3.2/src/main/java/") | |||
.setSourceDirs("aws/src/main/java/,default/src/main/java/,java-17/src/main/java/,spring-3.2/src/main/java/,spring-web-4.0/src/main/java/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the root folder of sonar-java we have the .cirrus.yml file where in some parts we exclude test source modules to avoid FPs on Mend for instance, at line 89 of this yml file for instance
We will need to add this new module in such places as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just at line 89 and 121
@@ -23,4 +23,6 @@ private Constants() { | |||
|
|||
public static final String SPRING_3_2 = "../java-checks-test-sources/spring-3.2"; | |||
public static final String SPRING_3_2_CLASSPATH = SPRING_3_2 + "/target/test-classpath.txt"; | |||
public static final String SPRING_WEB_4_0 = "../java-checks-test-sources/spring-web-4.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a strong opinion on this one, I let you decide
We should probably name this/these constants differently, as their usages will look like Constants.SPRING_WEB_4_0
which is not clear what it represents, to something like SPRING_WEB_4_0_PROJECT
or SPRING_WEB_4_0_ROOT
. I don't know if we want to change also the SPRING_3_2
right now for consistency, or skip it for the sake of smaller scope possible of the PR
private static final Pattern VERSION_PATTERN = Pattern.compile(VERSION_REGEX); | ||
|
||
/** | ||
* matcher must come from a match again a pattern that contains {@link #VERSION_REGEX} and no other groups. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* matcher must come from a match again a pattern that contains {@link #VERSION_REGEX} and no other groups. | |
* matcher must come from a match against a pattern that contains {@link #VERSION_REGEX} and no other groups. |
For inferring version of libraries present in the classpatth
Allow to filter visitors based on there dependency versions
To filter it out depending on the Spring version.
70d7cd8
to
73266fd
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SONARJAVA-5383
Minimal example of what can be achieved by looking at dependency versions.
Improves the SpringComposedRequestMappingCheck