This is an automated email from the ASF dual-hosted git repository.
dsoumis pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 5cad91781e Improve IntelliJ IDEA support for the FFM code and name the
SDK after the JDK running Ant.
5cad91781e is described below
commit 5cad91781e301d8a8a7c1fe0409e1187ca4f096d
Author: Dimitris Soumis <[email protected]>
AuthorDate: Mon Nov 9 12:35:10 2026 +0200
Improve IntelliJ IDEA support for the FFM code and name the SDK after the
JDK running Ant.
---
build.xml | 35 ++++++++++++++++++++++++++-------
res/ide-support/idea/misc.xml | 5 ++++-
res/ide-support/idea/modules.xml | 1 +
res/ide-support/idea/tomcat-ffm.iml | 39 +++++++++++++++++++++++++++++++++++++
res/ide-support/idea/tomcat.iml | 16 ++++++++-------
5 files changed, 81 insertions(+), 15 deletions(-)
diff --git a/build.xml b/build.xml
index 3a5a14ddb7..b4b706abfc 100644
--- a/build.xml
+++ b/build.xml
@@ -303,6 +303,7 @@
<filter token="GIT_BRANCH" value="${git.branch}"/>
<filter token="MIN_JAVA_VERSION" value="${min.java.version}"/>
<filter token="BUILD_JAVA_VERSION" value="${build.java.version}"/>
+ <filter token="RELEASE_JAVA_VERSION" value="${release.java.version}"/>
<filter token="ANT_VERSION_REQUIRED" value="${ant.version.required}"/>
<filter token="SERVLET_SPEC_VERSION" value="${servlet.spec.version}"/>
<filter token="JSP_SPEC_VERSION" value="${jsp.spec.version}"/>
@@ -4284,22 +4285,42 @@ Read the Building page on the Apache Tomcat
documentation site for details on ho
description="Creates project directory .idea for IntelliJ IDEA">
<copy todir="${tomcat.home}/.idea" overwrite="true">
- <fileset dir="${tomcat.home}/res/ide-support/idea"/>
+ <fileset dir="${tomcat.home}/res/ide-support/idea">
+ <exclude name="tomcat-ffm.iml" unless:set="has-ffm"/>
+ </fileset>
<filterset refid="classpath.filters"/>
<filterset refid="version.filters"/>
+ <filterset>
+ <!-- The SDK is named after the Java version this runs on, as the
build compiles with that JDK -->
+ <filter token="ANT_JAVA_VERSION" value="${ant.java.version}"/>
+ </filterset>
+ <filterchain>
+ <!-- As for the build, the code that uses the FFM API is only included
when this runs on a Java version
+ that supports it. It then belongs to the tomcat-ffm module rather
than being excluded. -->
+ <linecontains negate="true" if:set="has-ffm">
+ <contains value="IDEA-FFM-EXCLUDE"/>
+ </linecontains>
+ <linecontains negate="true" unless:set="has-ffm">
+ <contains value="IDEA-FFM-MODULE"/>
+ </linecontains>
+ </filterchain>
</copy>
<mkdir dir="${tomcat.home}/lib"/>
<echo>IntelliJ IDEA project directory created.
-The SDK was set to "${build.java.version}" so make sure that your
IDE has an SDK with that name,
+The SDK was set to "${ant.java.version}", the Java version that ran
this build.
+Make sure that your IDE has an SDK with that name,
or update the Project Settings accordingly. Choose [File > Project
Structure] to open the settings dialog
-and set the SDK level, language level, etc. as needed.
-
-Some folders have been excluded by default as they require the latest SDK
version and enabling of preview
-features. You can remove or comment out the exclusions to enable the
directories in the .idea/tomcat.iml
-file, or via the IDEA UI by right-clicking folders, and choosing [Mark
Directory as > Cancel Exclusion]</echo>
+and set the SDK level, language level, etc. as needed.</echo>
+ <echo if:set="has-ffm">
+The code that uses the FFM API is in a separate module, tomcat-ffm. Its
language level follows
+the SDK, while the build compiles that code for Java ${release.java.version}.
The rest of the project
+does not depend on that module.</echo>
+ <echo unless:set="has-ffm">
+The code that uses the FFM API has been excluded as it requires Java
${release.java.version} or later.
+Run ant ide-intellij with Java ${release.java.version} or later to include it
in a separate module, tomcat-ffm.</echo>
</target>
<!-- ============================ NetBeans ===============================
-->
diff --git a/res/ide-support/idea/misc.xml b/res/ide-support/idea/misc.xml
index 0f6a7a25c6..0c066cba23 100644
--- a/res/ide-support/idea/misc.xml
+++ b/res/ide-support/idea/misc.xml
@@ -15,8 +15,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<!-- The SDK is named after the Java version ant ide-intellij ran on, as the
build compiles with that JDK. The
+ project language level is the SDK default, which the tomcat-ffm module
uses. The tomcat module sets its own
+ level, the Java version that Tomcat is compiled for. !-->
<project version="4">
- <component name="ProjectRootManager" version="2"
languageLevel="JDK_@BUILD_JAVA_VERSION@" default="false"
project-jdk-name="@BUILD_JAVA_VERSION@" project-jdk-type="JavaSDK">
+ <component name="ProjectRootManager" version="2"
languageLevel="JDK_@BUILD_JAVA_VERSION@" default="true"
project-jdk-name="@ANT_JAVA_VERSION@" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/.idea/output" />
</component>
</project>
\ No newline at end of file
diff --git a/res/ide-support/idea/modules.xml b/res/ide-support/idea/modules.xml
index 03c9e26914..d001f58441 100644
--- a/res/ide-support/idea/modules.xml
+++ b/res/ide-support/idea/modules.xml
@@ -19,6 +19,7 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/tomcat.iml"
filepath="$PROJECT_DIR$/.idea/tomcat.iml" />
+ <module fileurl="file://$PROJECT_DIR$/.idea/tomcat-ffm.iml"
filepath="$PROJECT_DIR$/.idea/tomcat-ffm.iml" /><!-- IDEA-FFM-MODULE -->
</modules>
</component>
</project>
\ No newline at end of file
diff --git a/res/ide-support/idea/tomcat-ffm.iml
b/res/ide-support/idea/tomcat-ffm.iml
new file mode 100644
index 0000000000..06588940ca
--- /dev/null
+++ b/res/ide-support/idea/tomcat-ffm.iml
@@ -0,0 +1,39 @@
+<?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.
+-->
+<!-- The code that uses the FFM API. It needs Java @RELEASE_JAVA_VERSION@ or
later rather than the Java
+ @BUILD_JAVA_VERSION@ the rest of Tomcat targets, so it is a module of its
own. It uses the project SDK and the
+ project language level, which follows the SDK. The build compiles this
code for Java @RELEASE_JAVA_VERSION@, so
+ code that needs a later version is accepted here but fails the build. Its
content roots are nested in the java
+ folder of the tomcat module, which gives this module those directories.
ant ide-intellij only adds this module
+ when it runs on Java @RELEASE_JAVA_VERSION@ or later. !-->
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/net/openssl/panama">
+ <sourceFolder
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/net/openssl/panama"
isTestSource="false"
+ packagePrefix="org.apache.tomcat.util.net.openssl.panama" />
+ </content>
+ <content url="file://$MODULE_DIR$/java/org/apache/tomcat/util/openssl">
+ <sourceFolder
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/openssl"
isTestSource="false"
+ packagePrefix="org.apache.tomcat.util.openssl" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="tomcat" />
+ </component>
+</module>
diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml
index 419b561a2f..04d80447cb 100644
--- a/res/ide-support/idea/tomcat.iml
+++ b/res/ide-support/idea/tomcat.iml
@@ -16,19 +16,21 @@
limitations under the License.
-->
<module type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <!-- The language level is the Java version Tomcat is compiled for, not the
project level that follows the SDK !-->
+ <component name="NewModuleRootManager"
LANGUAGE_LEVEL="JDK_@BUILD_JAVA_VERSION@" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/webapps/examples/WEB-INF/classes"
isTestSource="true" />
- <!-- The directories below are excluded by default as they require the
FFM API which is
- available as a preview feature in Java SDK 22. If you wish to use
the FFM API in the
- IDE then set your project and module SDK levels to Java 22 or later,
enable preview
- features if needed, and comment out or remove the excludeFolder
lines below. !-->
- <excludeFolder
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/net/openssl/panama" />
- <excludeFolder
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/openssl" />
+ <!-- The code that uses the FFM API is only compiled when the build runs
on Java
+ @RELEASE_JAVA_VERSION@ or later. When ant ide-intellij runs on such
a version it omits the
+ excludeFolder lines below, so that code belongs to the tomcat-ffm
module, whose content roots
+ are nested in the java folder above. An exclusion in this module
would also hide those
+ directories from that module. On an earlier version the code is
excluded instead. !-->
+ <excludeFolder
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/net/openssl/panama" /><!--
IDEA-FFM-EXCLUDE -->
+ <excludeFolder
url="file://$MODULE_DIR$/java/org/apache/tomcat/util/openssl" /><!--
IDEA-FFM-EXCLUDE -->
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]