[maven-release-plugin] copy for tag uimafit-2.4.0
git-svn-id: https://svn.apache.org/repos/asf/uima/uimafit/tags/uimafit-2.4.0@1814883 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/README b/README
index 0e8e648..8f840bc 100644
--- a/README
+++ b/README
@@ -40,9 +40,8 @@
What's New in 2.4.0
-------------------
-uimaFIT 2.4.0 is a bugfix release to uimaFIT 2.3.0. It should should serve as a drop-in replacement
-for previous uimaFIT 2.x versions. Mind that uimaFIT 2.4.0 now requires UIMA 2.10.0. The upgrade
-to UIMA 2.10.0 is the main reason for increasing the middle version number in this uimaFIT release.
+uimaFIT 2.4.0 is a minor feature and bugfix release. It should should serve as a drop-in replacement
+for previous uimaFIT 2.x versions.
A full list of issues addressed in this release can be found on the Apache issue tracker:
@@ -51,7 +50,7 @@
Supported Platforms
-------------------
-uimaFIT requires Java 1.7 or higher, UIMA 2.10.0 or higher, and the Spring Framework 3.2.16 or higher.
+uimaFIT requires Java 1.7 or higher, UIMA 2.10.2 or higher, and the Spring Framework 3.2.16 or higher.
Availability
diff --git a/api-change-report.html b/api-change-report.html
new file mode 100644
index 0000000..f4a27fd
--- /dev/null
+++ b/api-change-report.html
@@ -0,0 +1,61 @@
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+<html>
+<head>
+ <title>API Change Report - Apache uimaFIT</title>
+</head>
+<body>
+<h1>Apache uimaFIT API Change Report</h1>
+
+<h2>Contents</h2>
+<p>
+<a href="#description">What is an API change report?</a><br/>
+<a target="_blank" href="uimafit-core/api-change-report/japicmp.html">API Changes: uimafit-core</a><br/>
+<a target="_blank" href="uimafit-cpe/api-change-report/japicmp.html">API Changes: uimafit-cpe</a><br/>
+<a target="_blank" href="uimafit-legacy-support/api-change-report/japicmp.html">API Changes: uimafit-legacy-support</a><br/>
+<a target="_blank" href="uimafit-spring/api-change-report/japicmp.html">API Changes: uimafit-spring</a><br/>
+<a href-"#running-more-reports">Running your own custom reports</a>
+</p>
+
+<h2><a id="description">What is an API change report?</a></h2>
+
+ <p>
+ Four of the uimaFIT modules track API changes from version to version.
+ The changes between this current version and the last previously released version are
+ reported below. Each report includes a summary of Classes that were changed, together with
+ a flag indicating if the change was a source or binary incompatible change.
+ More details about each change are available further down in the report.
+ </p>
+
+ <p>
+ Follow the links above to get the report for each of the four modules.
+ </p>
+
+
+<h2><a id="running-more-reports">Running additional change reports</a></h2>
+<p>The reports are generated by an open source tool,
+<a target="_blank" href="http://siom79.github.io/japicmp/">japicmp</a>, which compares two versions of
+a Java Jar and generates the report. See that website for details on how to run this for arbitrary versions, if you
+want to compare other versions.
+</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/uimafit-core/pom.xml b/uimafit-core/pom.xml
index dea6ac4..0348361 100644
--- a/uimafit-core/pom.xml
+++ b/uimafit-core/pom.xml
@@ -149,37 +149,29 @@
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
- <executions>
- <execution>
- <id>default-cli</id>
- <configuration>
- <excludes>
- <!-- Plain documentation -->
- <exclude>README*</exclude>
- <!-- Release files -->
- <exclude>RELEASE_NOTES*</exclude>
- <exclude>issuesFixed/**</exclude>
- <exclude>release.properties</exclude>
- <!-- Build controls -->
- <exclude>.activate-enforce-compatibility</exclude>
- <!-- These test files are unreasonable to bear a license header -->
- <exclude>src/test/resources/log4j.properties</exclude>
- <exclude>src/test/resources/data/docs/unix-newlines.txt.bin</exclude>
- <exclude>src/test/resources/data/docs/windows-newlines.txt.bin</exclude>
- <exclude>src/test/resources/data/docs/bad.xcas</exclude>
- <exclude>src/test/resources/data/docs/test.xcas</exclude>
- <exclude>src/test/resources/data/docs/test.xmi</exclude>
- <exclude>src/test/resources/data/reference/JCasBuilderTest.dump</exclude>
- <exclude>src/test/resources/data/reference/test.xmi.dump</exclude>
- <exclude>src/test/resources/data/reference/SerializationTestAnnotator.xml</exclude>
- <!-- These configuration files cannot bear a license header -->
- <exclude>src/test/resources/META-INF/org.apache.uima.fit/fsindexes.txt</exclude>
- <exclude>src/test/resources/META-INF/org.apache.uima.fit/typepriorities.txt</exclude>
- <exclude>src/test/resources/META-INF/org.apache.uima.fit/types.txt</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <configuration>
+ <excludes combine.children="append">
+ <!-- These test files are unreasonable to bear a license header -->
+ <exclude>src/test/resources/log4j.properties</exclude>
+ <exclude>src/test/resources/data/docs/unix-newlines.txt.bin</exclude>
+ <exclude>src/test/resources/data/docs/windows-newlines.txt.bin</exclude>
+ <exclude>src/test/resources/data/docs/bad.xcas</exclude>
+ <exclude>src/test/resources/data/docs/test.xcas</exclude>
+ <exclude>src/test/resources/data/docs/test.xmi</exclude>
+ <exclude>src/test/resources/data/reference/JCasBuilderTest.dump</exclude>
+ <exclude>src/test/resources/data/reference/test.xmi.dump</exclude>
+ <exclude>src/test/resources/data/reference/SerializationTestAnnotator.xml</exclude>
+ <!-- These configuration files cannot bear a license header -->
+ <exclude>src/test/resources/META-INF/org.apache.uima.fit/fsindexes.txt</exclude>
+ <exclude>src/test/resources/META-INF/org.apache.uima.fit/typepriorities.txt</exclude>
+ <exclude>src/test/resources/META-INF/org.apache.uima.fit/types.txt</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</pluginManagement>
diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/util/CasUtil.java b/uimafit-core/src/main/java/org/apache/uima/fit/util/CasUtil.java
index bd2e3f9..869faee 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/util/CasUtil.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/util/CasUtil.java
@@ -299,7 +299,7 @@
while (it.isValid()) {
AnnotationFS a = it.get();
// If the offsets do not match the specified offets, we're done
- if (a.getBegin() != aBegin && a.getEnd() != aEnd) {
+ if (a.getBegin() != aBegin || a.getEnd() != aEnd) {
break;
}
it.moveToNext();
diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/util/FSUtil.java b/uimafit-core/src/main/java/org/apache/uima/fit/util/FSUtil.java
index 971a571..fd62513 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/util/FSUtil.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/util/FSUtil.java
@@ -97,13 +97,17 @@
}
public static boolean isMultiValuedFeature(FeatureStructure aFS, Feature feat) {
+ return isMultiValuedFeature(aFS.getCAS().getTypeSystem(), feat);
+ }
+
+ public static boolean isMultiValuedFeature(TypeSystem aTypeSystem, Feature feat) {
if (feat == null) {
return false;
}
- return feat.getRange().isArray() || isListType(aFS.getCAS().getTypeSystem(), feat.getRange());
+ return feat.getRange().isArray() || isListType(aTypeSystem, feat.getRange());
}
-
+
public static void setFeature(FeatureStructure aFS, String aFeature, boolean... aValue) {
Feature feat = getMandatoryFeature(aFS, aFeature);
if (feat.getRange().isPrimitive()) {
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
index becbd21..1984210 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
@@ -828,12 +828,13 @@
Token a = new Token(this.jCas, 0, 1);
Token b = new Token(this.jCas, 2, 3);
Token bc = new Token(this.jCas, 2, 5);
- Token c = new Token(this.jCas, 4, 5);
- Token c1 = new Token(this.jCas, 4, 5);
- Token d = new Token(this.jCas, 4, 7);
- Token cd = new Token(this.jCas, 6, 7);
- Token e = new Token(this.jCas, 8, 9);
- for (Token token : Arrays.asList(a, b, bc, c, c1, d, cd, e)) {
+ Token c = new Token(this.jCas, 4, 6);
+ Token c1 = new Token(this.jCas, 4, 6);
+ Token d = new Token(this.jCas, 4, 5);
+ Token e = new Token(this.jCas, 4, 7);
+ Token cde = new Token(this.jCas, 6, 7);
+ Token f = new Token(this.jCas, 8, 9);
+ for (Token token : Arrays.asList(a, b, bc, c, c1, d, e, cde, e, f)) {
token.addToIndexes();
}
@@ -852,12 +853,13 @@
Token a = new Token(this.jCas, 0, 1);
Token b = new Token(this.jCas, 2, 3);
Token bc = new Token(this.jCas, 2, 5);
- Token c = new Token(this.jCas, 4, 5);
- Token c1 = new Token(this.jCas, 4, 5);
- Token d = new Token(this.jCas, 4, 7);
- Token cd = new Token(this.jCas, 6, 7);
- Token e = new Token(this.jCas, 8, 9);
- for (Token token : Arrays.asList(a, b, bc, c, c1, d, cd, e)) {
+ Token c = new Token(this.jCas, 4, 6);
+ Token c1 = new Token(this.jCas, 4, 6);
+ Token d = new Token(this.jCas, 4, 5);
+ Token e = new Token(this.jCas, 4, 7);
+ Token cde = new Token(this.jCas, 6, 7);
+ Token f = new Token(this.jCas, 8, 9);
+ for (Token token : Arrays.asList(a, b, bc, c, c1, d, e, cde, e, f)) {
token.addToIndexes();
}
diff --git a/uimafit-docbook/src/docbook/tools.uimafit.migration.xml b/uimafit-docbook/src/docbook/tools.uimafit.migration.xml
index 0346bb2..b804137 100644
--- a/uimafit-docbook/src/docbook/tools.uimafit.migration.xml
+++ b/uimafit-docbook/src/docbook/tools.uimafit.migration.xml
@@ -20,6 +20,17 @@
<title>Migration Guide</title>
<para>This section provides helpful information on incompatible changes between versions.</para>
<section>
+ <title>Version 2.3.0 to 2.4.0</title>
+ <formalpara>
+ <title>Version requirements</title>
+ <para>Depends on UIMA 2.10.2, Spring Framework 3.2.16 and Java 7.</para>
+ </formalpara>
+ <formalpara>
+ <para>Mind the updated version requirements. There should be no other potentially problematic
+ changes in this upgrade.</para>
+ </formalpara>
+ </section>
+ <section>
<title>Version 2.2.0 to 2.3.0</title>
<formalpara>
<title>CasIOUtil deprecated</title>
diff --git a/uimafit-legacy-support/pom.xml b/uimafit-legacy-support/pom.xml
index fdcb2df..3874f14 100644
--- a/uimafit-legacy-support/pom.xml
+++ b/uimafit-legacy-support/pom.xml
@@ -109,41 +109,36 @@
</executions>
</plugin>
</plugins>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <executions>
- <execution>
- <id>default-cli</id>
- <configuration>
- <excludes>
- <!-- Plain documentation -->
- <exclude>README*</exclude>
- <!-- Release files -->
- <exclude>RELEASE_NOTES*</exclude>
- <exclude>issuesFixed/**</exclude>
- <exclude>release.properties</exclude>
- <!-- Build controls -->
- <exclude>.activate-enforce-compatibility</exclude>
- <!-- These test files are unreasonable to bear a license header -->
- <exclude>src/test/resources/data/docs/unix-newlines.txt.bin</exclude>
- <exclude>src/test/resources/data/docs/windows-newlines.txt.bin</exclude>
- <exclude>src/test/resources/data/docs/bad.xcas</exclude>
- <exclude>src/test/resources/data/docs/test.xcas</exclude>
- <exclude>src/test/resources/data/docs/test.xmi</exclude>
- <exclude>src/test/resources/data/reference/JCasBuilderTest.dump</exclude>
- <exclude>src/test/resources/data/reference/test.xmi.dump</exclude>
- <!-- These configuration files cannot bear a license header -->
- <exclude>src/test/resources/META-INF/org.uimafit/fsindexes.txt</exclude>
- <exclude>src/test/resources/META-INF/org.uimafit/types.txt</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <configuration>
+ <excludes combine.children="append">
+ <!-- These test files are unreasonable to bear a license header -->
+ <exclude>src/test/resources/log4j.properties</exclude>
+ <exclude>src/test/resources/data/docs/unix-newlines.txt.bin</exclude>
+ <exclude>src/test/resources/data/docs/windows-newlines.txt.bin</exclude>
+ <exclude>src/test/resources/data/docs/bad.xcas</exclude>
+ <exclude>src/test/resources/data/docs/test.xcas</exclude>
+ <exclude>src/test/resources/data/docs/test.xmi</exclude>
+ <exclude>src/test/resources/data/reference/JCasBuilderTest.dump</exclude>
+ <exclude>src/test/resources/data/reference/test.xmi.dump</exclude>
+ <exclude>src/test/resources/data/reference/SerializationTestAnnotator.xml</exclude>
+ <!-- These configuration files cannot bear a license header -->
+ <exclude>src/test/resources/META-INF/org.uimafit/fsindexes.txt</exclude>
+ <exclude>src/test/resources/META-INF/org.uimafit/typepriorities.txt</exclude>
+ <exclude>src/test/resources/META-INF/org.uimafit/types.txt</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
</project>
\ No newline at end of file
diff --git a/uimafit-maven-plugin/pom.xml b/uimafit-maven-plugin/pom.xml
index 572cfa9..8d5f553 100644
--- a/uimafit-maven-plugin/pom.xml
+++ b/uimafit-maven-plugin/pom.xml
@@ -167,6 +167,25 @@
</configuration>
</plugin>
</plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <configuration>
+ <excludes combine.children="append">
+ <!-- These configuration files cannot bear a license header -->
+ <exclude>**/META-INF/org.apache.uima.fit/types.txt</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
<url>${uimaWebsiteUrl}</url>
<inceptionYear>2012</inceptionYear>
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/pom.xml b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/pom.xml
new file mode 100644
index 0000000..1e4ce74
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/pom.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.uima.fit.maven.it</groupId>
+ <artifactId>default</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>Test for default configuration</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>uimafit-core</artifactId>
+ <version>@pom.version@</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>uimafit-maven-plugin</artifactId>
+ <version>@pom.version@</version>
+ <configuration>
+ <componentVendor>Apache UIMA</componentVendor>
+ <componentCopyright>Copyright by the respective authors.</componentCopyright>
+ </configuration>
+ <executions>
+ <execution>
+ <id>default</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>enhance</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <addTypeSystemDescriptions>EMBEDDED</addTypeSystemDescriptions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/reference/TestAnnotator.xml b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/reference/TestAnnotator.xml
new file mode 100644
index 0000000..7d65136
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/reference/TestAnnotator.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+-->
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <primitive>true</primitive>
+ <annotatorImplementationName>TestAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>TestAnnotator</name>
+ <version>1.0-SNAPSHOT</version>
+ <vendor>Apache UIMA</vendor>
+ <copyright>Copyright by the respective authors.</copyright>
+ <configurationParameters>
+ <configurationParameter>
+ <name>value1</name>
+ <description>Parameter value 1.</description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+ <configurationParameter>
+ <name>valueParent1</name>
+ <description>Parameter value 1 in parent.</description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+ </configurationParameters>
+ <configurationParameterSettings>
+ <nameValuePair>
+ <name>valueParent1</name>
+ <value>
+ <string>defaultValue</string>
+ </value>
+ </nameValuePair>
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.fit.type.Sentence</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.uima.fit.type.Token</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ <features>
+ <featureDescription>
+ <name>pos</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>stem</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+ </features>
+ </typeDescription>
+ </types>
+ </typeSystemDescription>
+ <typePriorities/>
+ <fsIndexCollection/>
+ <capabilities/>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+ <externalResourceDependencies>
+ <externalResourceDependency>
+ <key>res</key>
+ <description>Documentation for resource</description>
+ <interfaceName>org.apache.uima.resource.Resource</interfaceName>
+ <optional>false</optional>
+ </externalResourceDependency>
+ </externalResourceDependencies>
+</analysisEngineDescription>
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/java/AbstractAnnotator.java b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/java/AbstractAnnotator.java
new file mode 100644
index 0000000..c510197
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/java/AbstractAnnotator.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import org.apache.uima.analysis_component.JCasAnnotator_ImplBase;
+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
+import org.apache.uima.fit.descriptor.ConfigurationParameter;
+import org.apache.uima.jcas.JCas;
+
+public abstract class AbstractAnnotator extends JCasAnnotator_ImplBase {
+
+ /**
+ * Parameter value 1 in parent.
+ */
+ public static final String PARAM_VALUE_PARENT_1 = "valueParent1";
+
+ @ConfigurationParameter(name = PARAM_VALUE_PARENT_1, mandatory = true, defaultValue = "defaultValue")
+ private String valueParent1;
+}
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/java/TestAnnotator.java b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/java/TestAnnotator.java
new file mode 100644
index 0000000..8f35759
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/java/TestAnnotator.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import org.apache.uima.analysis_component.JCasAnnotator_ImplBase;
+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
+import org.apache.uima.fit.descriptor.ConfigurationParameter;
+import org.apache.uima.fit.descriptor.ExternalResource;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.resource.Resource;
+
+public class TestAnnotator extends AbstractAnnotator {
+
+ /**
+ * Parameter value 1.
+ */
+ public static final String PARAM_VALUE_1 = "value1";
+ @ConfigurationParameter(name = PARAM_VALUE_1, mandatory=true)
+ private String value1;
+
+ /**
+ * Documentation for resource
+ */
+ public static final String RES_KEY = "res";
+ @ExternalResource(key = RES_KEY)
+ private Resource res;
+
+ @Override
+ public void process(JCas aJCas) throws AnalysisEngineProcessException {
+ // Nothing to do
+ }
+}
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/META-INF/org.apache.uima.fit/types.txt b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/META-INF/org.apache.uima.fit/types.txt
new file mode 100644
index 0000000..1c96dc9
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/META-INF/org.apache.uima.fit/types.txt
@@ -0,0 +1 @@
+classpath*:org/apache/uima/fit/type/**/*.xml
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/org/apache/uima/fit/type/Sentence.xml b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/org/apache/uima/fit/type/Sentence.xml
new file mode 100644
index 0000000..a69681d
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/org/apache/uima/fit/type/Sentence.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <name>Sentence</name>
+ <description></description>
+ <version>1.0</version>
+ <vendor/>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.fit.type.Sentence</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ </types>
+</typeSystemDescription>
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/org/apache/uima/fit/type/Token.xml b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/org/apache/uima/fit/type/Token.xml
new file mode 100644
index 0000000..629ae03
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/src/main/resources/org/apache/uima/fit/type/Token.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <name>Token</name>
+ <description></description>
+ <version>1.0</version>
+ <vendor/>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.fit.type.Token</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ <features>
+ <featureDescription>
+ <name>pos</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>stem</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+ </features>
+ </typeDescription>
+ </types>
+</typeSystemDescription>
diff --git a/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/verify.bsh b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/verify.bsh
new file mode 100644
index 0000000..34d0f2f
--- /dev/null
+++ b/uimafit-maven-plugin/src/it/with-typesystem-in-descriptors/verify.bsh
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+import org.apache.commons.io.*;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+
+try
+{
+ String reference = IOUtils.toString(new File(basedir,
+ "reference/TestAnnotator.xml").toURI().toURL());
+ String actual = IOUtils.toString(new File(basedir,
+ "target/classes/TestAnnotator.xml").toURI().toURL());
+
+ // In a local build, I get indented XML but on the Apache Jenkins I get non-indented XML. This
+ // settings tells XMLUnit to ignore this difference in whitespace - rec 2013-02-16
+ XMLUnit.setIgnoreWhitespace(true);
+ Diff diff = XMLUnit.compareXML(reference, actual);
+
+ if (!diff.identical()) {
+ System.out.println("Actual descriptor does not match expected descriptor: " + diff);
+ return false;
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/uimafit-maven-plugin/src/main/java/org/apache/uima/fit/maven/GenerateDescriptorsMojo.java b/uimafit-maven-plugin/src/main/java/org/apache/uima/fit/maven/GenerateDescriptorsMojo.java
index 2edeff8..6d111b9 100644
--- a/uimafit-maven-plugin/src/main/java/org/apache/uima/fit/maven/GenerateDescriptorsMojo.java
+++ b/uimafit-maven-plugin/src/main/java/org/apache/uima/fit/maven/GenerateDescriptorsMojo.java
@@ -23,7 +23,6 @@
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Modifier;
-
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.maven.plugin.AbstractMojo;
@@ -34,12 +33,17 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.collection.CollectionReaderDescription;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.CollectionReaderFactory;
+import org.apache.uima.fit.factory.TypeSystemDescriptionFactory;
import org.apache.uima.fit.maven.util.Util;
import org.apache.uima.resource.ResourceCreationSpecifier;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
+import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
+import org.apache.uima.resource.metadata.TypeSystemDescription;
import org.codehaus.plexus.util.FileUtils;
import org.sonatype.plexus.build.incremental.BuildContext;
import org.xml.sax.SAXException;
@@ -60,7 +64,7 @@
/**
* Path where the generated resources are written.
*/
- @Parameter(defaultValue="${project.build.directory}/classes", required=true)
+ @Parameter(defaultValue = "${project.build.directory}/classes", required = true)
private File outputDirectory;
/**
@@ -75,6 +79,17 @@
@Parameter(defaultValue = "${project.build.sourceEncoding}", required = true)
private String encoding;
+ enum TypeSystemSerialization {
+ NONE, EMBEDDED
+ }
+
+ /**
+ * Mode of adding type systems found on the classpath via the uimaFIT detection mechanism at
+ * compile time to the generated descriptor. By default, no type systems are added.
+ */
+ @Parameter(defaultValue = "NONE")
+ private TypeSystemSerialization addTypeSystemDescriptions;
+
@Override
public void execute() throws MojoExecutionException {
// add the generated sources to the build
@@ -106,24 +121,39 @@
}
ResourceCreationSpecifier desc = null;
+ ProcessingResourceMetaData metadata = null;
switch (Util.getType(componentLoader, clazz)) {
case ANALYSIS_ENGINE:
- desc = AnalysisEngineFactory.createEngineDescription(clazz);
+ AnalysisEngineDescription aeDesc = AnalysisEngineFactory.createEngineDescription(clazz);
+ metadata = aeDesc.getAnalysisEngineMetaData();
+ desc = aeDesc;
break;
case COLLECTION_READER:
- desc = CollectionReaderFactory.createReaderDescription(clazz);
+ CollectionReaderDescription crDesc = CollectionReaderFactory
+ .createReaderDescription(clazz);
+ metadata = crDesc.getCollectionReaderMetaData();
+ desc = crDesc;
default:
// Do nothing
}
if (desc != null) {
- File out = new File(outputDirectory, clazzPath+".xml");
+ switch (addTypeSystemDescriptions) {
+ case EMBEDDED:
+ embedTypeSystems(metadata);
+ break;
+ case NONE: // fall-through
+ default:
+ // Do nothing
+ }
+
+ File out = new File(outputDirectory, clazzPath + ".xml");
out.getParentFile().mkdirs();
toXML(desc, out.getPath());
countGenerated++;
// Remember component
- componentsManifest.append("classpath*:").append(clazzPath+".xml").append('\n');
+ componentsManifest.append("classpath*:").append(clazzPath + ".xml").append('\n');
}
} catch (SAXException e) {
getLog().warn("Cannot serialize descriptor for [" + clazzName + "]", e);
@@ -153,6 +183,19 @@
}
}
+ private void embedTypeSystems(ProcessingResourceMetaData metadata)
+ throws ResourceInitializationException {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(componentLoader);
+ try {
+ TypeSystemDescriptionFactory.forceTypeDescriptorsScan();
+ TypeSystemDescription tsDesc = TypeSystemDescriptionFactory.createTypeSystemDescription();
+ metadata.setTypeSystem(tsDesc);
+ } finally {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ }
+
/**
* Save descriptor XML to file system.
*/
diff --git a/uimafit-parent/pom.xml b/uimafit-parent/pom.xml
index 53e71ee..37a0244 100644
--- a/uimafit-parent/pom.xml
+++ b/uimafit-parent/pom.xml
@@ -14,10 +14,16 @@
<inceptionYear>2012</inceptionYear>
<properties>
<spring.version>3.2.16.RELEASE</spring.version>
- <uima.version>2.10.0</uima.version>
+ <uima.version>2.10.2</uima.version>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
- <compat.previous.version>2.1.0</compat.previous.version>
+ <!--
+ BACKWARD_COMPATIBLE_IMPLEMENTER - patch version (=.=.+)
+ BACKWARD_COMPATIBLE_USER - minor version (=.+.0)
+ NON_BACKWARD_COMPATIBLE - major version (+.0.0)
+ -->
+ <compat.level>BACKWARD_COMPATIBLE_USER</compat.level>
+ <compat.previous.version>2.3.0</compat.previous.version>
</properties>
<!--
- Only required while uimaFIT depends on unreleased versions of UIMA.
@@ -315,6 +321,36 @@
<pluginManagement>
<plugins>
<plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.4.1</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.semver</groupId>
+ <artifactId>enforcer-rule</artifactId>
+ <version>0.9.33</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>enforce-compatibility</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireBackwardCompatibility implementation="org.semver.enforcer.RequireBackwardCompatibility">
+ <previousVersion>${compat.previous.version}</previousVersion>
+ <dumpDetails>true</dumpDetails>
+ <compatibilityType>${compat.level}</compatibilityType>
+ </requireBackwardCompatibility>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<executions>
@@ -349,6 +385,8 @@
<onlyModified>true</onlyModified>
<!-- filter out classes with impl in their package or class name -->
<postAnalysisScript>${project.basedir}/../uimafit-parent/src/main/groovy/api-report.groovy</postAnalysisScript>
+ <breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
+ <reportOnlyFilename>true</reportOnlyFilename>
</parameter>
</configuration>
<executions>