8000 [releases/6.1.z] WINDUP-3605 Enhanced rules for Spring components identification (#843) by github-actions[bot] · Pull Request #845 · windup/windup-rulesets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[releases/6.1.z] WINDUP-3605 Enhanced rules for Spring components identification (#843) #845

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

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -742,28 +742,5 @@
<technology-tag level="INFORMATIONAL">Eureka</technology-tag>
</perform>
</rule>
<!-- this rule has to be always the last one in order to effectively checks for classifications added from previous rules in this ruleset-->
<rule id="embedded-framework-90000">
<when>
<file filename="spring{*}.jar"/>
</when>
<perform>
<iteration>
<when>
<not>
<has-classification title="Embedded framework - Spring {pattern}"/>
</not>
</when>
<classification title="Embedded framework - Spring" category-id="information" effort="0">
<description>The application embeds the Spring framework.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring</technology-tag>
</iteration>
</perform>
<where param="pattern">
<matches pattern="(Integration|Data|Security|MVC|Batch|Boot|Test|DI)"/>
</where>
</rule>
<!-- the rule above has to be always the last one in order to effectively checks for classifications added from previous rules in this ruleset-->
</rules>
</ruleset>
6 changes: 3 additions & 3 deletions rules/rules-reviewed/technology-usage/mvc.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<file filename="{*}spring-webmvc{*}.jar"/>
</when>
<perform>
<classification title="Embedded library - Spring MVC" category-id="information" effort="0">
<classification title="Embedded framework - Spring MVC" category-id="information" effort="0">
<description>The application embeds a Spring MVC library.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring MVC</technology-tag>
Expand All @@ -52,7 +52,7 @@
</javaclass>
</when>
<perform>
<classification title="Embedded library - Spring MVC" category-id="information" effort="0">
<classification title="Embedded framework - Spring MVC" category-id="information" effort="0">
<description>The application embeds a Spring MVC library.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring MVC</technology-tag>
Expand All @@ -77,7 +77,7 @@
</or>
</when>
<perform>
<classification title="Embedded library - Spring MVC" category-id="information" effort="0">
<classification title="Embedded framework - Spring MVC" category-id="information" effort="0">
<description>The application embeds a Spring MVC library.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring MVC</technology-tag>
Expand Down
4 changes: 2 additions & 2 deletions rules/rules-reviewed/technology-usage/security.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<file filename="{*}spring-security{*}.jar"/>
</when>
<perform>
<classification title="Embedded library - Spring Security" category-id="information" effort="0">
<classification title="Embedded framework - Spring Security" category-id="information" effort="0">
<description>The application embeds a Spring Security library.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring Security</technology-tag>
Expand Down Expand Up @@ -310,7 +310,7 @@
</or>
</when>
<perform>
<classification title="Embedded library - Spring Security" category-id="information" effort="0">
<classification title="Embedded framework - Spring Security" category-id="information" effort="0">
<description>The application embeds a Spring Security library.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring Security</technology-tag>
Expand Down
44 changes: 44 additions & 0 deletions rules/rules-reviewed/technology-usage/spring-catchall.windup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<ruleset
xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="spring-catchall"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>
This ruleset provides analysis of embedded Spring frameworks for which no specific rules exist.
</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" />
</dependencies>
<executeAfter>3rd-party</executeAfter>
<executeAfter>database</executeAfter>
<executeAfter>embedded-framework</executeAfter>
<executeAfter>integration</executeAfter>
<executeAfter>mvc</executeAfter>
<executeAfter>security</executeAfter>
<executeAfter>test-frameworks-usage</executeAfter>
</metadata>
<rules>
<rule id="spring-catchall-00001">
<when>
<file filename="spring{*}.jar"/>
</when>
<perform>
<iteration>
<when>
<not>
<has-classification title="Embedded framework - Spring {pattern}{*}"/>
</not>
</when>
<classification title="Embedded framework - Spring" category-id="information" effort="0">
<description>The application embeds the Spring framework.</description>
</classification>
<technology-tag level="INFORMATIONAL">Spring</technology-tag>
</iteration>
</perform>
<where param="pattern">
<matches pattern="(Integration|Data|Security|MVC|Batch|Boot|Test|DI)"/>
</where>
</rule>
</rules>
</ruleset>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<testDataPath>data/embedded-framework/</testDataPath>
<rulePath>../../openshift/embedded-cache-libraries.windup.xml</rulePath>
<rulePath>../../eap7/embedded-framework-libraries.windup.xml</rulePath>
<rulePath>../spring-catchall.windup.xml</rulePath>
<rulePath>../embedded-framework.windup.xml</rulePath>
<rulePath>../embedded-framework-technology-usage.windup.xml</rulePath>
<ruleset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<rule id="mvc-01200-test">
<when>
<not>
<classification-exists classification="Embedded library - Spring MVC"/>
<classification-exists classification="Embedded framework - Spring MVC"/>
<technology-tag-exists technology-tag="Spring MVC"/>
</not>
</when>
Expand All @@ -46,7 +46,7 @@
<rule id="mvc-01210-test">
<when>
<not>
<classification-exists classification="Embedded library - Spring MVC"/>
<classification-exists classification="Embedded framework - Spring MVC"/>
<technology-tag-exists technology-tag="Spring MVC"/>
</not>
</when>
Expand All @@ -57,7 +57,7 @@
<rule id="mvc-01220-test">
<when>
<not>
<classification-exists classification="Embedded library - Spring MVC"/>
<classification-exists classification="Embedded framework - Spring MVC"/>
<technology-tag-exists technology-tag="Spring MVC"/>
</not>
</when>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<rule id="security-01100-test">
<when>
<not>
<classification-exists classification="Embedded library - Spring Security"/>
<classification-exists classification="Embedded framework - Spring Security"/>
<technology-tag-exists technology-tag="Spring Security"/>
</not>
</when>
Expand Down Expand Up @@ -287,7 +287,7 @@
<rule id="security-03600-test">
<when>
<not>
<classification-exists classification="Embedded library - Spring Security"/>
<classification-exists classification="Embedded framework - Spring Security"/>
<technology-tag-exists technology-tag="Spring Security"/>
</not>
</when>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruletest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
id="spring-catchall-test"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">

<testDataPath>data/spring-catchall</testDataPath>
<rulePath>../integration.windup.xml</rulePath>
<rulePath>../spring-catchall.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="spring-catchall-00001-test-0">
<when>
<not>
<iterable-filter size="1">
<classification-exists classification="^Embedded framework - Spring$"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="Expected data not found for rule embedded-framework-90000"/>
</perform>
</rule>
<rule id="spring-catchall-00001-test-1">
<when>
<not>
<iterable-filter size="1">
<technology-tag-exists technology-tag="^Spring$"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="Expected data not found for rule embedded-framework-90000"/>
</perform>
</rule>
</rules>
</ruleset>
</ruletest>
0