Merge branch 'main' into release/UIMA-6456-UIMA-Parent-POM-15-release

* main:
  [UIMA-6460] Move tycho and auto-staging to parent pom
  [UIMA-6460] Move tycho and auto-staging to parent pom
  [UIMA-6460] Move tycho and auto-staging to parent pom
  [UIMA-6460] Move tycho and auto-staging to parent pom
  [UIMA-6458] Spurious "parsedVersion.osgiVersion" in file names in target
diff --git a/pom.xml b/pom.xml
index 851ed1c..f11ff64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -191,7 +191,9 @@
   <!-- *  V E R S I O N S                            -->
   <!-- *  most inherited from apache-wide parent pom -->
   <!-- ============================================= -->
-    <maven.version>3.0.5</maven.version>
+    <maven.version>3.2.2</maven.version>
+    <!-- Tycho requires at least Java 11 -->
+    <javaVersionMinBuild>11</javaVersionMinBuild>
     <felix.bundle.version>3.3.0</felix.bundle.version>
 
     <maven.surefire.heap>512m</maven.surefire.heap>
@@ -420,17 +422,15 @@
           <artifactId>maven-antrun-plugin</artifactId>
           <version>3.1.0</version>
           <dependencies>
+            <dependency>
+              <groupId>org.apache.ant</groupId>
+              <artifactId>ant</artifactId>
+              <version>1.10.12</version>
+            </dependency>
             <dependency> <!-- for ant extension supporting "if" -->
               <groupId>ant-contrib</groupId>
               <artifactId>ant-contrib</artifactId>
               <version>20020829</version>
-              <scope>runtime</scope>
-              <exclusions>
-                <exclusion> <!-- is dragging in ant 1.5 -->
-                  <groupId>ant</groupId>
-                  <artifactId>ant</artifactId>
-                </exclusion>
-              </exclusions>
             </dependency>
             <!-- <containsregexp> form for filesets -->
             <dependency>
@@ -444,7 +444,7 @@
         <plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
-          <version>5.1.5</version>
+          <version>5.1.6</version>
           <extensions>true</extensions>
           <executions>
             <execution>
@@ -472,6 +472,7 @@
               <configuration>
                 <consoleOutput>true</consoleOutput>
                 <excludes>
+                  <exclude>**/.tycho-consumer-pom.xml</exclude>
                   <exclude>.github/**/*</exclude> <!-- GitHub config/template files -->
                   <exclude>release.properties</exclude> <!-- generated file -->
                   <exclude>README*</exclude>
@@ -479,6 +480,7 @@
                   <exclude>issuesFixed/**</exclude> <!-- generated file -->
                   <!-- Maven profile trigger files -->
                   <exclude>**/marker-file-identifying-*</exclude>
+                  <exclude>**/marker-file-enabling-*</exclude>
                   <exclude>DEPENDENCIES</exclude>  <!-- generated file -->
                   <exclude>**/MANIFEST.MF</exclude> <!-- MANIFEST.MF files cannot have comments -->
                   <exclude>**/*.ppt</exclude> <!--  power point sources -->
@@ -572,7 +574,7 @@
                   <version>${maven.version}</version>
                 </requireMavenVersion>
                 <requireJavaVersion>
-                  <version>${maven.compiler.target}</version>
+                  <version>${javaVersionMinBuild}</version>
                 </requireJavaVersion>
               </rules>
             </configuration>
@@ -658,6 +660,28 @@
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
           <execution>
+            <id>fix-text-file-line-endings</id>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <phase>compile</phase>
+            <configuration>
+              <target>
+                <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" />
+                <if>
+                  <available file="${project.build.outputDirectory}" />
+                  <then>
+                    <fixcrlf srcdir="${project.build.outputDirectory}">
+                      <include name="**/META-INF/DEPENDENCIES" />
+                      <include name="**/META-INF/LICENSE" />
+                      <include name="**/META-INF/NOTICE" />
+                    </fixcrlf>
+                  </then>
+                </if>
+              </target>
+            </configuration>
+          </execution>
+          <execution>
             <id>dup-meta-jar-cleanup</id>
             <goals>
               <goal>run</goal>
@@ -670,7 +694,15 @@
               </target>
             </configuration>
           </execution>
-        </executions>
+                 </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <configuration>
+          <autoVersionSubmodules>true</autoVersionSubmodules>
+        </configuration>
       </plugin>
     </plugins>
   </build>
@@ -680,7 +712,7 @@
   <profiles>
     <!-- ************************************************** -->
     <!-- * apache-release                                 * -->
-    <!-- *   NOTE: This profile is activated while        * --> 
+    <!-- *   NOTE: This profile is activated while        * -->
     <!-- *    running the Maven build pipeline, usually   * -->
     <!-- *      clean verify (for mvn release:prepare) or * -->
     <!-- *      deploy (for mvn release;perform),         * -->
@@ -713,10 +745,6 @@
                 </execution>
               </executions>
             </plugin>
-            <plugin>
-              <groupId>net.nicoulaj.maven.plugins</groupId>
-              <artifactId>checksum-maven-plugin</artifactId>
-            </plugin>
           </plugins>
         </pluginManagement>
 
@@ -770,7 +798,7 @@
                 <id>default-cli</id>
               </execution>
             </executions>
-          </plugin>      
+          </plugin>
           
           <!-- to fix up any generated Javadocs to have consistent line ends in html files -->
           <!-- runs in several phases after package -->
@@ -795,16 +823,26 @@
                         </fixcrlf>
                       </then>
                     </if>
-                    
-                    <!-- FIXME: Why do the checksum on the POM? I think this can be removed -->
+                  </target>
+                </configuration>
+              </execution>
+              <execution>
+                <id>copy-pom-to-target</id>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target>
                     <!-- copy to target so checksum-maven-plugin can sha512 checkum it -->
-                    <property name="pom-file-tgt" location="${project.build.directory}/${project.build.finalName}.pom" />
-                    <property name="pom-file-src" location="${project.build.directory}/../pom.xml" />
+                    <property name="pom-file-tgt"
+                      location="${project.build.directory}/${project.artifactId}-${project.version}.pom" />
+                    <property name="pom-file-src"
+                      location="${project.build.directory}/../pom.xml" />
                     <copy file="${pom-file-src}" tofile="${pom-file-tgt}" />
                   </target>
                 </configuration>
               </execution>
-
               <execution>
                 <id>sign and checksum source-release.zip</id>
                 <phase>verify</phase>  <!-- after source-release is built -->
@@ -814,12 +852,14 @@
                 <configuration>
                   <target>
                     <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" />
-                    <property name="source-release" location="${project.build.directory}/${project.artifactId}-${project.version}-source-release.zip" />
+                    <property name="source-release"
+                      location="${project.build.directory}/${project.artifactId}-${project.version}-source-release.zip" />
                     <if>
                       <available file="${source-release}" />
                       <then>
                         <echo message="Generating checksums for source-release.zip" />
-                        <checksum format="MD5SUM" forceoverwrite="yes" algorithm="SHA-512" fileext=".sha512" file="${source-release}" />
+                        <checksum format="MD5SUM" forceoverwrite="yes" algorithm="SHA-512"
+                          fileext=".sha512" file="${source-release}" />
                         <echo message="Generating gpg signatures for source-release.zip" />
                         <exec executable="gpg" failonerror="true">
                           <arg value="--detach-sign" />
@@ -878,6 +918,56 @@
                   </algorithms>
                 </configuration>
               </execution>
+              <execution>
+                <!-- 
+                  - The POM checksum needs a separate treatment because it is not included in the 
+                  - attached artifacts.
+                  -->
+                <id>pom-checksum</id>
+                <goals>
+                  <goal>files</goal>
+                </goals>
+                <configuration>
+                  <appendFilename>true</appendFilename>
+                  <algorithms>
+                    <algorithm>SHA-512</algorithm>
+                  </algorithms>
+                  <fileSets>
+                    <fileSet>
+                      <directory>${project.build.directory}</directory>
+                      <includes>
+                        <include>${project.artifactId}-${project.version}.pom</include>
+                      </includes>
+                    </fileSet>
+                  </fileSets>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>build-helper-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <!-- 
+                  - The POM checksum needs a separate treatment because it is not included in the 
+                  - attached artifacts.
+                  -->
+                <id>attach-artifacts</id>
+                <phase>verify</phase>
+                <goals>
+                  <goal>attach-artifact</goal>
+                </goals>
+                <configuration>
+                  <artifacts>
+                    <artifact>
+                      <file>${project.build.directory}/${project.artifactId}-${project.version}.pom.sha512</file>
+                      <type>pom.sha512</type>
+                    </artifact>
+                  </artifacts>
+                </configuration>
+              </execution>
             </executions>
           </plugin>
         </plugins>
@@ -886,8 +976,7 @@
 
 
     <!-- *************************************************** -->
-    <!-- * Run Rat report - for Jenkins                    * -->
-    <!-- * https://issues.apache.org/jira/browse/UIMA-2590 * -->
+    <!-- * Run Rat report                                  * -->
     <!-- *************************************************** -->
     <profile>
       <id>run-rat-report</id>
@@ -907,29 +996,12 @@
       </build>
     </profile>
 
-
     <!-- *********************************************** -->
-    <!-- *  Run actions only for uima-wide parent pom  * -->
-    <!-- *    ** not inherited by sub projects **      * -->
-    <!-- *   Produce Jira report                       * -->
-    <!-- *   attach patches for gpg and chksum plugins * -->
+    <!-- * Generate JIRA issues report                 * -->
     <!-- *********************************************** -->
     <profile>
       <id>mavenJirareport</id>
       <activation>
-        <!-- NOTE: if you try to make this work more generally, by 
-             using a marker file in all top-level release projects,
-             this approach fails because for other top-level
-             release projects, it substitutes the value of
-             the jiraVersion property from the top level pom, not
-             the pom being released.  So other release projects include
-             this kind of profile within themselves, in a profile
-             for "apache-release" triggered by name. -->
-             
-        <!-- It would be nice to have this only run when releasing, 
-             but the activation clauses are currently only
-             "ored" together, not "anded". -->
-
         <file>
           <exists>marker-file-identifying-parent-pom</exists>
         </file>
@@ -941,36 +1013,33 @@
           </plugin>
 
           <plugin>
-            <artifactId>maven-changes-plugin</artifactId>
+            <artifactId>maven-clean-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>clean-jira-changes-report</id>
+                <phase>clean</phase>
+                <goals>
+                  <goal>clean</goal>
+                </goals>
+                <configuration>
+                  <filesets>
+                    <fileset>
+                      <directory>issuesFixed</directory>
+                    </fileset>
+                  </filesets>
+                </configuration>
+              </execution>
+            </executions>
           </plugin>
-        </plugins>
-      </build>
-    </profile>
-    
-    <!-- **************************************** -->
-    <!-- * Override - don't produce Jira report * -->
-    <!-- **************************************** -->
-    
-    <!-- 
-      NOTE: if you use this, you MUST check in the generated Jira report into SVN, otherwise
-      it won't appear in the release assemblies. 
-    -->
-    <profile>
-      <id>mavenJirareportSkip</id>
-      <activation>
-        <property>
-          <name>maven.jiraReport.skip</name>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <!-- Skip jira report -->
+          
           <plugin>
             <artifactId>maven-changes-plugin</artifactId>
             <executions>
               <execution>
                 <id>default-cli</id>
-                <phase />
+                <configuration>
+                  <fixVersionIds>${jiraVersion}</fixVersionIds>
+                </configuration>
               </execution>
             </executions>
           </plugin>
@@ -1290,16 +1359,6 @@
         </file>
       </activation>
       <build>
-        <!-- The final name is typically overridden in the individual project
-             to follow the Eclipse naming rules.  Rather than just the artifactId,
-             Eclipse wants this name to be the same as the Bundle-SymbolicName,
-             which typically starts with org.apache.uima, and isn't the same as
-             the artifact name.
-             examples:
-                uimaj-ep-jcasgen    -     org.apache.uima.jcas.jcasgenp
-                uimaj-ep-configurator -   org.apache.uima.desceditor     -->
-        <finalName>${project.artifactId}_${parsedVersion.osgiVersion}</finalName>         
-                
         <!-- resources are "merged" -->
         <!-- needed to copy resources, icons, and the plugin.xml to the result -->
         <resources>
@@ -1424,7 +1483,6 @@
         </file>
       </activation>
       <build>
-        <finalName>${project.artifactId}_${parsedVersion.osgiVersion}</finalName>
         <!-- turn on filtering for these resources -->
         <resources>
           <resource>
@@ -2813,8 +2871,8 @@
       </properties>
       <dependencies>
         <!--
-          - java.xml.bind and javax.annotation-api have been removed in Java 11 from the JDK, need to add it 
-          as dependency
+          - java.xml.bind and javax.annotation-api have been removed in Java 11 from the JDK, need 
+          - to add them as dependencies
         -->
         <dependency>
           <groupId>javax.xml.bind</groupId>
@@ -2835,9 +2893,9 @@
           <scope>runtime</scope>
         </dependency>
         <dependency>
-          <groupId>javax.annotation</groupId>
-          <artifactId>javax.annotation-api</artifactId>
-          <version>1.3.2</version>
+          <groupId>javax.activation</groupId>
+          <artifactId>javax.activation-api</artifactId>
+          <version>1.2.0</version>
         </dependency>
       </dependencies>
 
@@ -2846,6 +2904,21 @@
           <plugins>
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <configuration>
+                <ignoredUnusedDeclaredDependencies combine.children="append">
+                  <!--
+                    - JAXB is used via reflection and cannot be detected by Maven
+                  -->
+                  <dependency>javax.xml.bind:jaxb-api</dependency>
+                  <dependency>com.sun.xml.bind:jaxb-core</dependency>
+                  <dependency>com.sun.xml.bind:jaxb-impl</dependency>
+                  <dependency>javax.activation:javax.activation-api</dependency>
+                </ignoredUnusedDeclaredDependencies>
+              </configuration>
+            </plugin>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <configuration>
                 <argLine>--illegal-access=permit</argLine>
@@ -2862,5 +2935,208 @@
         </pluginManagement>
       </build>
     </profile>
+
+
+    <!-- *********************************************** -->
+    <!-- * Enable Tycho                                * -->
+    <!-- *********************************************** -->
+    <profile>
+      <id>tycho</id>
+      <activation>
+        <property>
+          <name>!disable-tycho</name>
+        </property>
+      </activation>
+      
+      <properties>
+        <tycho-version>2.7.3</tycho-version>
+      </properties>
+      
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-release-plugin</artifactId>
+            <configuration>
+              <!-- 
+                - Tycho-managed Eclipse files during release 
+                -
+                - We do not need the 'org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin' goal 
+                - here because the release plugin automatically commits twice during the 'prepare' phase
+                -->
+              <preparationGoals>
+                org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata
+                org.apache.maven.plugins:maven-scm-plugin:1.9.5:add
+              </preparationGoals>
+              <completionGoals>
+                org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata
+                org.apache.maven.plugins:maven-scm-plugin:1.9.5:add
+              </completionGoals>
+            </configuration>
+          </plugin>
+          
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-scm-plugin</artifactId>
+            <executions>
+              <execution>
+                <!-- 
+                  - Tycho-managed Eclipse files during release 
+                  -->
+                <id>default-cli</id>
+                <goals>
+                  <goal>add</goal>
+                  <goal>checkin</goal>
+                </goals>
+                <configuration>
+                  <includes>
+                    *-eclipse-*/META-INF/MANIFEST.MF,
+                    *-eclipse-*/feature.xml,
+                    *-eclipse-*/*.product,
+                    *-eclipse-*/category.xml
+                  </includes>
+                  <excludes>**/target/**</excludes>
+                  <message>Changing the Eclipse files versions</message>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+        
+    <!-- *********************************************** -->
+    <!-- * Enable Tycho in a module                    * -->
+    <!-- *********************************************** -->
+    <profile>
+      <id>tycho-module</id>
+      <activation>
+        <file>
+          <exists>marker-file-identifying-tycho-module</exists>
+        </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.eclipse.tycho</groupId>
+            <artifactId>tycho-maven-plugin</artifactId>
+            <version>${tycho-version}</version>
+            <extensions>true</extensions>
+          </plugin>
+          <plugin>
+            <groupId>org.eclipse.tycho</groupId>
+            <artifactId>target-platform-configuration</artifactId>
+            <version>${tycho-version}</version>
+            <configuration>
+              <pomDependencies>consider</pomDependencies>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <!-- *********************************************** -->
+    <!-- * Enable auto-staging of release artifacts    * -->
+    <!-- *                                             * -->
+    <!-- * Modules need to place their artifacts into  * -->
+    <!-- * ${staging-local-root}                       * -->
+    <!-- *********************************************** -->
+    <profile>
+      <id>apache-release-rc-auto-staging-config</id>
+      <activation>
+        <property>
+          <name>!disable-rc-auto-staging</name>
+        </property>
+      </activation>
+      
+      <properties>
+        <releaseCandidateNum></releaseCandidateNum>
+        <staging-scm-root>scm:svn:https://dist.apache.org/repos/dist/dev/uima/</staging-scm-root>
+        <staging-local-root>${project.build.directory}/staging</staging-local-root>
+        <staging-folder>${project.artifactId}-${project.version}-RC-${staging-timestamp}-${candidate-id}</staging-folder>
+      </properties>
+    </profile>
+    
+    <profile>
+      <id>apache-release-rc-auto-staging</id>
+      <activation>
+        <property>
+          <name>!disable-rc-auto-staging</name>
+        </property>
+        <file>
+          <exists>marker-file-enabling-auto-staging</exists>
+        </file>
+      </activation>
+      
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>buildnumber-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>generate-candidate-id</id>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>create</goal>
+                </goals>
+                <configuration>
+                  <buildNumberPropertyName>candidate-id</buildNumberPropertyName>
+                  <timestampPropertyName>staging-timestamp</timestampPropertyName>
+                  <shortRevisionLength>7</shortRevisionLength>
+                  <timestampFormat>yyyyMMddHHmm</timestampFormat>
+                  <timezone>Z</timezone>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-scm-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>checkout-staging</id>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>checkout</goal>
+                </goals>
+                <configuration>
+                  <connectionType>developerConnection</connectionType>
+                  <developerConnectionUrl>${staging-scm-root}</developerConnectionUrl>
+                  <checkoutDirectory>${staging-local-root}</checkoutDirectory>
+                </configuration>
+              </execution>
+              <execution>
+                <id>add-staging-files</id>
+                <phase>deploy</phase>
+                <goals>
+                  <goal>add</goal>
+                </goals>
+                <configuration>
+                  <connectionType>developerConnection</connectionType>
+                  <developerConnectionUrl>${staging-scm-root}</developerConnectionUrl>
+                  <basedir>${staging-local-root}</basedir>
+                  <includes>${staging-folder}/**/*</includes>
+                </configuration>
+              </execution>
+              <execution>
+                <id>commit-staging-files</id>
+                <phase>deploy</phase>
+                <goals>
+                  <goal>checkin</goal>
+                </goals>
+                <configuration>
+                  <connectionType>developerConnection</connectionType>
+                  <developerConnectionUrl>${staging-scm-root}</developerConnectionUrl>
+                  <basedir>${staging-local-root}</basedir>
+                  <message>Staging release artifacts for ${project.artifactId}-${project.version}-RC-${staging-timestamp}-${candidate-id}</message>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 </project>
\ No newline at end of file