[ https://issues.apache.org/jira/browse/WW-5383?focusedWorklogId=897965&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-897965 ]
ASF GitHub Bot logged work on WW-5383: -------------------------------------- Author: ASF GitHub Bot Created on: 04/Jan/24 05:52 Start Date: 04/Jan/24 05:52 Worklog Time Spent: 10m Work Description: lukaszlenart commented on code in PR #830: URL: https://github.com/apache/struts/pull/830#discussion_r1441366147 ########## plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java: ########## @@ -438,30 +471,26 @@ private UrlSet buildUrlSet(List<URL> resourceUrls) throws IOException { } //try to find classes dirs inside war files - urlSet = urlSet.includeClassesUrl(classLoaderInterface, new UrlSet.FileProtocolNormalizer() { - public URL normalizeToFileProtocol(URL url) { - return fileManager.normalizeToFileProtocol(url); - } - }); - + urlSet = urlSet.includeClassesUrl(classLoaderInterface, url -> fileManager.normalizeToFileProtocol(url)); urlSet = urlSet.excludeJavaExtDirs() - .excludeJavaEndorsedDirs() - .excludeUserExtensionsDir(); + .excludeJavaEndorsedDirs() + .excludeUserExtensionsDir(); try { - urlSet = urlSet.excludeJavaHome(); + urlSet = urlSet.excludeJavaHome(); } catch (NullPointerException e) { - // This happens in GAE since the sandbox contains no java.home directory - LOG.warn("Could not exclude JAVA_HOME, is this a sandbox jvm?"); + // This happens in GAE since the sandbox contains no java.home directory + LOG.warn("Could not exclude JAVA_HOME, is this a sandbox jvm?"); } urlSet = urlSet.excludePaths(System.getProperty("sun.boot.class.path", "")); urlSet = urlSet.exclude(".*/JavaVM.framework/.*"); if (includeJars == null) { - urlSet = urlSet.exclude(".*?\\.jar(!/|/)?"); + LOG.debug("\"{}\" is not defined, excluding all JAR files!", ConventionConstants.CONVENTION_ACTION_INCLUDE_JARS); + urlSet = urlSet.exclude(EXCLUDE_ALL_JARS_PATTERN); Review Comment: Yes, since JDK9 we can get either `jar:file:/.../org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1.jar!/META-INF/versions/10/` or just `jar:file:/.../org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1.jar!/` Issue Time Tracking ------------------- Worklog Id: (was: 897965) Time Spent: 1h 40m (was: 1.5h) > Exclude JAR files by default when scanning for actions on JDK9+ > --------------------------------------------------------------- > > Key: WW-5383 > URL: https://issues.apache.org/jira/browse/WW-5383 > Project: Struts 2 > Issue Type: Improvement > Components: Plugin - Convention > Reporter: Lukasz Lenart > Priority: Minor > Fix For: 6.4.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > When running an app on the JDK9+ it can happen that the Convention plugin > starts scanning JAR files due to changed behaviour of > {{getClassLoader().getResources("")}} as this will also return additional > path and current pattern to exclude JARs won't work. -- This message was sent by Atlassian Jira (v8.20.10#820010)