@@ -154,15 +154,22 @@ private void processFile(String fileName) throws IOException {
154154 .configure (cfg -> cfg .setErrorLogEnabled (false ))
155155 ).parse (fileContent );
156156
157- if (!"11" .equals (System .getProperty ("java.specification.version" ))) {
158- throw new IllegalArgumentException ("GridJavadocAntTask isn't tested for java versions after 11. " +
159- "Please check html rendering of documentation package groups works correctly and remove this exception then." );
157+ String javaVer = System .getProperty ("java.specification.version" );
158+
159+ boolean jdk11 = "11" .equals (javaVer );
160+ boolean jdk17 = "17" .equals (javaVer );
161+
162+ if (!jdk11 && !jdk17 ) {
163+ throw new IllegalArgumentException ("GridJavadocAntTask is only tested for Java 11 and 17. " +
164+ "Current version: " + javaVer + ". " +
165+ "Please check html rendering of documentation package groups works correctly and add support then." );
160166 }
161167
162168 if ("index.html" .equals (file .getName ())) {
163169 // Try to find Other Packages section.
164- Jerry otherPackages =
165- doc .find ("div.contentContainer table.overviewSummary caption span:contains('Other Packages')" );
170+ Jerry otherPackages = jdk11
171+ ? doc .find ("div.contentContainer table.overviewSummary caption span:contains('Other Packages')" )
172+ : doc .find ("button.table-tab:contains('Other Packages')" );
166173
167174 if (otherPackages .size () > 0 ) {
168175 System .err .println ("[ERROR]: 'Other Packages' section should not be present, but found: " +
@@ -173,27 +180,34 @@ private void processFile(String fileName) throws IOException {
173180 "<configuration> / <groups>" );
174181 }
175182
176- int pkgGrps = doc .find ("div.contentContainer table.overviewSummary caption span.tableTab" ).size ();
183+ int pkgGrps = jdk11
184+ ? doc .find ("div.contentContainer table.overviewSummary caption span.tableTab" ).size ()
185+ : doc .find ("button.table-tab" ).size ();
177186
178187 if (pkgGrps == 0 ) {
179188 throw new IllegalArgumentException ("Documentation package groups missed. Please add packages " +
180189 "description to parent/pom.xml into <plugin>(maven-javadoc-plugin) / " +
181190 "<configuration> / <groups>" );
182191 }
183192
184- // This limit is set for JDK11. Each group is represented as a tab. Tabs are enumerated with a number 2^N
185- // where N is a sequential number for a tab. For 32 tabs (+ the "All Packages" tab) the number is overflowed
186- // and the tabulation becomes broken. See var data in "index.html".
187- if (pkgGrps > 30 ) {
188- throw new IllegalArgumentException ("Too many package groups: " + pkgGrps + ". The limit"
189- + " is 30 due to the javadoc limitations. Please reduce groups in parent/pom.xml"
190- + " inside <plugin>(maven-javadoc-plugin) / <configuration> / <groups>" );
193+ if (jdk11 ) {
194+ // This limit is set for JDK 11. Each group is represented as a tab. Tabs are enumerated with
195+ // a number 2^N where N is a sequential number for a tab. For 32 tabs (+ the "All Packages" tab)
196+ // the number is overflowed and the tabulation becomes broken. See var data in "index.html".
197+ // JDK 17 uses CSS class-based tab switching, so this limit does not apply.
198+ if (pkgGrps > 30 ) {
199+ throw new IllegalArgumentException ("Too many package groups: " + pkgGrps + ". The limit"
200+ + " is 30 due to the javadoc limitations. Please reduce groups in parent/pom.xml"
201+ + " inside <plugin>(maven-javadoc-plugin) / <configuration> / <groups>" );
202+ }
191203 }
192204 }
193205 else if (!isViewHtml (file )) {
194206 // TODO: fix the description block location IGNITE-22650
195207 // Try to find a class description block.
196- Jerry descBlock = doc .find ("div.contentContainer .description" );
208+ Jerry descBlock = jdk11
209+ ? doc .find ("div.contentContainer .description" )
210+ : doc .find ("section.class-description" );
197211
198212 if (descBlock .size () == 0 )
199213 throw new IllegalArgumentException ("Class doesn't have description in file: " + file );
@@ -204,6 +218,8 @@ else if (!isViewHtml(file)) {
204218 "</head>" ,
205219 "<link rel='shortcut icon' href='https://ignite.apache.org/favicon.ico'/>\n </head>\n " );
206220
221+ s = s .replace ("${current.year}" , String .valueOf (java .time .Year .now ().getValue ()));
222+
207223 replaceFile (file , s );
208224 }
209225
0 commit comments