[
https://issues.apache.org/jira/browse/WW-5594?focusedWorklogId=996124&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-996124
]
ASF GitHub Bot logged work on WW-5594:
--------------------------------------
Author: ASF GitHub Bot
Created on: 14/Dec/25 18:42
Start Date: 14/Dec/25 18:42
Worklog Time Spent: 10m
Work Description: lukaszlenart merged PR #1468:
URL: https://github.com/apache/struts/pull/1468
Issue Time Tracking
-------------------
Worklog Id: (was: 996124)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> 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)