[
https://issues.apache.org/jira/browse/WW-5594?focusedWorklogId=996081&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-996081
]
ASF GitHub Bot logged work on WW-5594:
--------------------------------------
Author: ASF GitHub Bot
Created on: 13/Dec/25 20:00
Start Date: 13/Dec/25 20:00
Worklog Time Spent: 10m
Work Description: sonarqubecloud[bot] commented on PR #1468:
URL: https://github.com/apache/struts/pull/1468#issuecomment-3649758742
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1468)
**Quality Gate passed**
Issues
 [0 New
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1468&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1468&issueStatuses=ACCEPTED)
Measures
 [0 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1468&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [88.9% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1468&metric=new_coverage&view=list)
 [0.0% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1468&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube
Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1468)
Issue Time Tracking
-------------------
Worklog Id: (was: 996081)
Time Spent: 20m (was: 10m)
> Convention plugin exclusion pattern org.apache.struts2.* doesn't match root
> package classes
> -------------------------------------------------------------------------------------------
>
> Key: WW-5594
> URL: https://issues.apache.org/jira/browse/WW-5594
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Convention
> Reporter: Lukasz Lenart
> Priority: Major
> Fix For: 7.2.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The default exclusion pattern "org.apache.struts2.*" in struts-plugin.xml
> doesn't properly
> exclude classes directly in the org.apache.struts2 package (without
> subpackages), such as
> org.apache.struts2.XWorkTestCase.
> *Root cause*:
> PackageBasedActionConfigBuilder.includeClassNameInActionScan() extracts
> package names using
> StringUtils.substringBeforeLast(className, "."), then matches against
> exclusion patterns.
> For class "org.apache.struts2.XWorkTestCase", this produces package
> "org.apache.struts2"
> (no trailing dot). The pattern "org.apache.struts2.*" expects something
> after the dot,
> causing a mismatch.
> *Impact*:
> - Test classes like XWorkTestCase in root Struts packages are not excluded
> from scanning
> - Can trigger the NoClassDefFoundError issue when combined with includeJars
> configuration
> - Affects any classes directly in excluded root packages
> *Current configuration* (struts-plugin.xml:57):
> {code:xml}
> <constant name="struts.convention.exclude.packages"
> value="org.apache.struts.*,org.apache.struts2.*,..." />
> {code}
> *Proposed fix*:
> Add root packages without wildcards to default exclusions:
> {code:xml}
> <constant name="struts.convention.exclude.packages"
>
> value="org.apache.struts,org.apache.struts.*,org.apache.struts2,org.apache.struts2.*,
>
> org.springframework.web.struts,org.springframework.web.struts.*,
>
> org.springframework.web.struts2,org.springframework.web.struts2.*,
> org.hibernate,org.hibernate.*" />
> {code}
> *Workaround*:
> Users can manually add root packages to their struts.xml:
> {code:xml}
> <constant name="struts.convention.exclude.packages"
> value="org.apache.struts2,org.apache.struts2.*" />
> {code}
> *Related classes*:
> - PackageBasedActionConfigBuilder.java (includeClassNameInActionScan
> method, line 558-584)
> - WildcardHelper.java (pattern matching implementation)
> - struts-plugin.xml (default configuration, line 57)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)