Skip to content

Commit 1fbd997

Browse files
committed
Merge branch 'release/3.6.x'
* release/3.6.x: Issue #438: Upgrade dependencies (3.6.1) No issue: Pull notifications up to root Issue #430: Resolving type system imports through sp is slows things down too much Issue #435: Improve performance of ImportResolver Issue #435: Improve performance of ImportResolver Issue #435: Improve performance of ImportResolver Issue #435: Improve performance of ImportResolver Issue #435: Improve performance of ImportResolver Issue #435: Improve performance of ImportResolver Issue #435: Improve performance of ImportResolver Issue #431: Issue using SPI-enabled type systems embedded into PEARs Issue #430: Resolving type system imports through SPIs slows things down too much Issue #430: Resolving type system imports through SPIs slows things down too much Issue #430: Resolving type system imports through SPIs slows things down too much
2 parents 626ad7f + 68561e3 commit 1fbd997

File tree

25 files changed

+608
-456
lines changed

25 files changed

+608
-456
lines changed

.asf.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
# limitations under the License.
1616
#
1717

18+
notifications:
19+
20+
21+
pullrequests: [email protected]
22+
23+
jira_options: link label
1824
github:
1925
description: "Apache UIMA Java SDK"
2026
homepage: https://uima.apache.org
2127
dependabot_alerts: true
2228
dependabot_updates: false
23-
notifications:
24-
25-
26-
pullrequests: [email protected]
27-
28-
jira_options: link label
2929
labels:
3030
- apache
3131
- uima

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
<plugin>
409409
<groupId>org.owasp</groupId>
410410
<artifactId>dependency-check-maven</artifactId>
411-
<version>11.1.0</version>
411+
<version>12.1.5</version>
412412
<executions>
413413
<execution>
414414
<goals><goal>check</goal></goals>

src/main/assembly/bin-without-jackson.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ under the License.
210210
<include>org.springframework:spring-context</include>
211211
<include>org.springframework:spring-core</include>
212212
<include>org.springframework:spring-expression</include>
213-
<include>org.springframework:spring-jcl/5.3.39/spring-jcl-5.3.39.jar</include>
213+
<include>org.springframework:spring-jcl</include>
214214
</includes>
215215
<unpack>false</unpack>
216216
<scope>runtime</scope>

src/main/bin_distr_license_notices/LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ Copyright (c) 2004-2017 QOS.ch
267267

268268
=======================================================================
269269

270-
SPRING FRAMEWORK 6.1.15 SUBCOMPONENTS:
270+
SPRING FRAMEWORK 6.2.11 SUBCOMPONENTS:
271271

272-
Spring Framework 6.1.15 includes a number of subcomponents
272+
Spring Framework 6.2.11 includes a number of subcomponents
273273
with separate copyright notices and license terms. The product that
274274
includes this file does not necessarily use all the open source
275275
subcomponents referred to below. Your use of the source

src/main/bin_distr_license_notices/NOTICE-without-jackson.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ ResolverUtil.java Copyright 2005-2006 Tim Fennell
1717
# Apache Commons IO
1818

1919
Apache Commons IO
20-
Copyright 2002-2024 The Apache Software Foundation
20+
Copyright 2002-2025 The Apache Software Foundation
2121

2222
# Apache Commons Lang
2323

2424
Apache Commons Lang
25-
Copyright 2001-2024 The Apache Software Foundation
25+
Copyright 2001-2025 The Apache Software Foundation
2626

2727
# Spring Framework
2828

29-
Copyright (c) 2002-2024 Pivotal, Inc.
29+
Copyright (c) 2002-2025 Pivotal, Inc.
3030

3131
This product is licensed to you under the Apache License, Version 2.0
3232
(the "License"). You may not use this product except in compliance with

src/main/bin_distr_license_notices/NOTICE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ ResolverUtil.java Copyright 2005-2006 Tim Fennell
1717
# Apache Commons IO
1818

1919
Apache Commons IO
20-
Copyright 2002-2024 The Apache Software Foundation
20+
Copyright 2002-2025 The Apache Software Foundation
2121

2222
# Apache Commons Lang
2323

2424
Apache Commons Lang
25-
Copyright 2001-2024 The Apache Software Foundation
25+
Copyright 2001-2025 The Apache Software Foundation
2626

27-
# Jackson JSON processor NOTICE from the Jackson Jar 2.15.2
27+
# Jackson JSON processor NOTICE from the Jackson Jar 2.20.0
2828

2929
Jackson is a high-performance, Free/Open Source JSON processing library.
3030
It was originally written by Tatu Saloranta ([email protected]), and has
@@ -59,7 +59,7 @@ and the licenses and copyrights that apply to that code.
5959

6060
# Spring Framework
6161

62-
Copyright (c) 2002-2024 Pivotal, Inc.
62+
Copyright (c) 2002-2025 Pivotal, Inc.
6363

6464
This product is licensed to you under the Apache License, Version 2.0
6565
(the "License"). You may not use this product except in compliance with

uima-bnd-plugin/src/main/java/org/apache/uima/tools/bnd/UimaBndPlugin.java

Lines changed: 66 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.ArrayList;
2525
import java.util.Arrays;
2626
import java.util.List;
27+
import java.util.Map;
2728
import java.util.regex.Pattern;
2829

2930
import org.apache.uima.UIMAFramework;
@@ -44,12 +45,14 @@
4445
import aQute.bnd.osgi.Analyzer;
4546
import aQute.bnd.osgi.Resource;
4647
import aQute.bnd.service.AnalyzerPlugin;
48+
import aQute.bnd.service.Plugin;
49+
import aQute.lib.converter.Converter;
50+
import aQute.service.reporter.Reporter;
4751

48-
@BndPlugin(name = "UIMA")
52+
@BndPlugin(name = "UIMA", parameters = UimaBndPlugin.Configuration.class)
4953
public class UimaBndPlugin
50-
implements AnalyzerPlugin
54+
implements AnalyzerPlugin, Plugin
5155
{
52-
5356
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
5457

5558
private static final Pattern XML_FILE = Pattern.compile(".*\\.xml");
@@ -58,6 +61,21 @@ public class UimaBndPlugin
5861

5962
private final static XMLParser PARSER = UIMAFramework.getXMLParser();
6063

64+
private Reporter reporter;
65+
private UimaBndPlugin.Configuration configuration;
66+
67+
@Override
68+
public void setProperties(Map<String, String> aMap) throws Exception
69+
{
70+
configuration = Converter.cnv(UimaBndPlugin.Configuration.class, aMap);
71+
}
72+
73+
@Override
74+
public void setReporter(Reporter aReporter)
75+
{
76+
reporter = aReporter;
77+
}
78+
6179
@Override
6280
public boolean analyzeJar(Analyzer analyzer) throws Exception
6381
{
@@ -69,37 +87,37 @@ public boolean analyzeJar(Analyzer analyzer) throws Exception
6987
for (var entry : resources.entrySet()) {
7088
var path = entry.getKey();
7189
var resource = entry.getValue();
72-
90+
7391
try {
7492
if (XML_FILE.matcher(path).matches()) {
75-
importsProcessed += analyzeXmlFile(analyzer, path, resource);
93+
importsProcessed += analyzeXmlFile(analyzer, path, resource, 0);
7694
}
7795
}
7896
catch (Exception e) {
7997
analyzer.error("Unexpected exception in processing resource (%s): %s", path, e);
8098
}
8199
}
82100
}
83-
101+
84102
LOG.info("UIMA bnd plugin processed {} imports", importsProcessed);
85103

86104
return false;
87105
}
88106

89-
private int analyzeXmlFile(Analyzer analyzer, String path, Resource resource) throws Exception
107+
private int analyzeXmlFile(Analyzer analyzer, String path, Resource resource, int level) throws Exception
90108
{
91109
var desc = readUimaDescriptor(resource);
92110
if (desc == null) {
93111
return 0;
94112
}
95113

96-
LOG.debug("Found {}: {}", desc.getClass().getSimpleName(), path);
114+
LOG.debug("{}Found {}: {}", repeat(" ", level), desc.getClass().getSimpleName(), path);
97115
var imports = getImportsFromDescriptor(desc);
98116

99117
var importsProcessed = 0;
100118
for (var imp : imports) {
101119
if (imp.getName() != null) {
102-
handleImportByName(analyzer, path, imp);
120+
handleImportByName(analyzer, path, imp, level);
103121
importsProcessed++;
104122
continue;
105123
}
@@ -108,22 +126,21 @@ private int analyzeXmlFile(Analyzer analyzer, String path, Resource resource) th
108126
handleImportByLocation(imp);
109127
continue;
110128
}
111-
129+
112130
LOG.warn(
113-
"Found UIMA type system import without name and location - ignoring, please fix your type system description");
131+
"Found UIMA import without name and location - ignoring, please fix your type system description");
114132
}
115-
133+
116134
return importsProcessed;
117135
}
118136

119137
private void handleImportByLocation(Import imp)
120138
{
121-
LOG.warn(
122-
"Found UIMA type system import by location: {} - ignoring, please only use import-by-name",
139+
LOG.warn("Ignoring UIMA import by location (please only use import-by-name): {}",
123140
imp.getLocation());
124141
}
125142

126-
private void handleImportByName(Analyzer analyzer, String path, Import imp)
143+
private void handleImportByName(Analyzer analyzer, String path, Import imp, int level) throws Exception
127144
{
128145
var tsdPackage = imp.getName();
129146
int lastSeparatorPosition = tsdPackage.lastIndexOf('.');
@@ -132,18 +149,29 @@ private void handleImportByName(Analyzer analyzer, String path, Import imp)
132149
tsdPackage = tsdPackage.substring(0, lastSeparatorPosition);
133150
}
134151

135-
LOG.debug("Found UIMA type system import by name: {}", tsdPackage);
136-
137152
var pack = analyzer.getPackageRef(tsdPackage);
138153
if (!QN.matcher(pack.getFQN()).matches()) {
139-
analyzer.warning("Type system import does not seem to refer to a package (%s): %s",
140-
path, pack);
154+
analyzer.warning("Import does not seem to refer to a package (%s): %s", path, pack);
141155
}
142156

143-
if (!analyzer.getReferred().containsKey(pack)) {
157+
var alreadyKnownImport = analyzer.getReferred().containsKey(pack);
158+
if (!alreadyKnownImport) {
144159
var attrs = new Attrs();
145160
analyzer.getReferred().put(pack, attrs);
146161
}
162+
163+
LOG.debug("{}Found UIMA import by name: {} {}", repeat(" ", level), tsdPackage, alreadyKnownImport ? "" : "(new)");
164+
165+
var importedResourcePath = imp.getName().replace('.', '/') + ".xml";
166+
var importedResource = analyzer.findResource(importedResourcePath);
167+
if (importedResource == null) {
168+
analyzer.warning("Imported resource not found on classpath: {}", importedResourcePath);
169+
return;
170+
}
171+
172+
if (configuration == null || configuration.transitive(false)) {
173+
analyzeXmlFile(analyzer, importedResourcePath, importedResource, level + 1);
174+
}
147175
}
148176

149177
private List<Import> getImportsFromDescriptor(XMLizable desc)
@@ -194,4 +222,22 @@ private static <T> List<T> asList(T[] aList)
194222

195223
return Arrays.asList(aList);
196224
}
225+
226+
private static String repeat(String aString, int aCount) {
227+
if (aCount == 0) {
228+
return "";
229+
}
230+
231+
var buf = new StringBuilder();
232+
for (var i = 0; i < aCount; i++) {
233+
buf.append(aString);
234+
}
235+
236+
return buf.toString();
237+
}
238+
239+
public static interface Configuration
240+
{
241+
boolean transitive(boolean aDefault);
242+
}
197243
}

uimafit-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<dependency>
9090
<groupId>com.google.guava</groupId>
9191
<artifactId>guava</artifactId>
92-
<version>33.2.0-jre</version>
92+
<version>33.5.0-jre</version>
9393
</dependency>
9494
</dependencies>
9595

uimafit-maven-plugin/src/main/java/org/apache/uima/fit/maven/GenerateDescriptorsMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void execute() throws MojoExecutionException {
149149
componentLoader = Util.getClassloader(project, includeScope);
150150

151151
// List of components that is later written to META-INF/org.apache.uima.fit/components.txt
152-
StringBuilder componentsManifest = new StringBuilder();
152+
var componentsManifest = new StringBuilder();
153153

154154
int countGenerated = 0;
155155
for (String file : files) {

uimaj-core/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@
216216
osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.uima.spi.TypeSystemProvider)";cardinality:=multiple;resolution:=optional,
217217
osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.uima.spi.TypeSystemDescriptionProvider)";cardinality:=multiple;resolution:=optional,
218218
osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.uima.spi.TypePrioritiesProvider)";cardinality:=multiple;resolution:=optional,
219-
osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.uima.spi.FsIndexCollectionProvider)";cardinality:=multiple;resolution:=optional
219+
osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.uima.spi.FsIndexCollectionProvider)";cardinality:=multiple;resolution:=optional,
220+
osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.uima.fit.validation.ValidationCheck)";cardinality:=multiple;resolution:=optional
220221
</Require-Capability>
221222
</instructions>
222223
</configuration>

0 commit comments

Comments
 (0)