1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028
|
<?xml version="1.0"?>
<!--
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 name="Tomcat 7.0" default="deploy" basedir=".">
<!-- ===================== Initialize Property Values ==================== -->
<!-- We read customizable properties from "build.properties.default" -->
<!-- and also from "build.properties" if it exists. -->
<!-- The values in "build.properties" have stronger preference. -->
<!-- If you want to customize your build, you can either change the values -->
<!-- directly in the default file, or create a new build.properties and -->
<!-- set the values there. This way you don't have to change a file which -->
<!-- is part of the original project source code. -->
<!-- See "build.properties.default" in the top level directory for some -->
<!-- property values you may customize. -->
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
<property file="build.properties.default"/>
<!-- Project Name -->
<property name="project" value="apache-tomcat" />
<!-- Version numbers -->
<property name="version" value="${version.major}.${version.minor}.${version.build}${version.suffix}" />
<property name="version.number" value="${version.major}.${version.minor}.${version.build}.${version.patch}" />
<property name="version.major.minor" value="${version.major}.${version.minor}" />
<!-- constant to declare a file binary for md5sum -->
<property name="md5sum.binary-prefix" value=" *" />
<!-- Exact spec versions (for the manifests) -->
<property name="servlet.revision" value="FR" />
<property name="jsp.revision" value="FR" />
<property name="el.revision" value="FR" />
<property name="websocket.revision" value="FR" />
<!-- Release artifact base names -->
<property name="final.name" value="${project}-${version}" />
<property name="final-src.name" value="${project}-${version}-src" />
<!-- Locations to create build artifacts -->
<property name="tomcat.home" value="${basedir}"/>
<property name="tomcat.output" value="${basedir}/output"/>
<property name="tomcat.build" value="${tomcat.output}/build"/>
<property name="tomcat.classes" value="${tomcat.output}/classes"/>
<property name="tomcat.deployer" value="${tomcat.output}/deployer"/>
<property name="tomcat.dist" value="${tomcat.output}/dist"/>
<property name="tomcat.embed" value="${tomcat.output}/embed"/>
<property name="tomcat.embed.sources" value="${tomcat.output}/embed-src-jars"/>
<property name="tomcat.extras" value="${tomcat.output}/extras"/>
<property name="tomcat.extras.sources" value="${tomcat.output}/extras-src-jars"/>
<property name="tomcat.manifests" value="${tomcat.output}/manifests"/>
<property name="tomcat.release" value="${tomcat.output}/release"/>
<property name="tomcat.src.jars" value="${tomcat.output}/src-jars"/>
<property name="test.classes" value="${tomcat.output}/testclasses"/>
<property name="test.temp" value="${tomcat.output}/test-tmp"/>
<property name="test.reports" value="${tomcat.build}/logs"/>
<property name="test.apr.loc" value="${tomcat.build}/bin/native"/>
<!-- base directory for jdbc-pool -->
<property name="tomcat.jdbc.dir" value="${basedir}/modules/jdbc-pool"/>
<!-- build output directory for jdbc-pool -->
<property name="tomcat.pool" value="${tomcat.output}/jdbc-pool"/>
<!-- Servlet 3.0 spec requires 1.6+ -->
<property name="compile.source" value="1.6"/>
<property name="compile.target" value="1.6"/>
<!-- Locations to create the JAR artifacts -->
<!-- Standard JARs -->
<property name="bootstrap.jar" value="${tomcat.build}/bin/bootstrap.jar"/>
<property name="tomcat-juli.jar" value="${tomcat.build}/bin/tomcat-juli.jar"/>
<property name="annotations-api.jar" value="${tomcat.build}/lib/annotations-api.jar"/>
<property name="servlet-api.jar" value="${tomcat.build}/lib/servlet-api.jar"/>
<property name="jsp-api.jar" value="${tomcat.build}/lib/jsp-api.jar"/>
<property name="el-api.jar" value="${tomcat.build}/lib/el-api.jar"/>
<property name="catalina.jar" value="${tomcat.build}/lib/catalina.jar"/>
<property name="catalina-tribes.jar" value="${tomcat.build}/lib/catalina-tribes.jar"/>
<property name="catalina-ha.jar" value="${tomcat.build}/lib/catalina-ha.jar"/>
<property name="catalina-ant.jar" value="${tomcat.build}/lib/catalina-ant.jar"/>
<property name="tomcat-coyote.jar" value="${tomcat.build}/lib/tomcat-coyote.jar"/>
<property name="tomcat-api.jar" value="${tomcat.build}/lib/tomcat-api.jar"/>
<property name="tomcat-util.jar" value="${tomcat.build}/lib/tomcat-util.jar"/>
<property name="jasper.jar" value="${tomcat.build}/lib/jasper.jar"/>
<property name="jasper-el.jar" value="${tomcat.build}/lib/jasper-el.jar"/>
<property name="tomcat-dbcp.home" value="${base.path}/tomcat${version.major}-deps/dbcp" />
<property name="tomcat-dbcp.jar" value="${tomcat-dbcp.home}/tomcat-dbcp.jar"/>
<!-- Standard Source JARs -->
<property name="bootstrap-src.jar" value="${tomcat.src.jars}/bootstrap-src.jar"/>
<property name="tomcat-juli-src.jar" value="${tomcat.src.jars}/tomcat-juli-src.jar"/>
<property name="annotations-api-src.jar" value="${tomcat.src.jars}/annotations-api-src.jar"/>
<property name="servlet-api-src.jar" value="${tomcat.src.jars}/servlet-api-src.jar"/>
<property name="jsp-api-src.jar" value="${tomcat.src.jars}/jsp-api-src.jar"/>
<property name="el-api-src.jar" value="${tomcat.src.jars}/el-api-src.jar"/>
<property name="catalina-src.jar" value="${tomcat.src.jars}/catalina-src.jar"/>
<property name="catalina-tribes-src.jar" value="${tomcat.src.jars}/catalina-tribes-src.jar"/>
<property name="catalina-ha-src.jar" value="${tomcat.src.jars}/catalina-ha-src.jar"/>
<property name="catalina-ant-src.jar" value="${tomcat.src.jars}/catalina-ant-src.jar"/>
<property name="tomcat-coyote-src.jar" value="${tomcat.src.jars}/tomcat-coyote-src.jar"/>
<property name="tomcat-api-src.jar" value="${tomcat.src.jars}/tomcat-api-src.jar"/>
<property name="tomcat-util-src.jar" value="${tomcat.src.jars}/tomcat-util-src.jar"/>
<property name="jasper-src.jar" value="${tomcat.src.jars}/jasper-src.jar"/>
<property name="jasper-el-src.jar" value="${tomcat.src.jars}/jasper-el-src.jar"/>
<property name="tomcat-dbcp-src.jar" value="${tomcat-dbcp.home}/tomcat-dbcp-src.jar"/>
<!-- Embedded JARs & source JARs -->
<property name="tomcat-embed-core.jar" value="${tomcat.embed}/tomcat-embed-core.jar"/>
<property name="tomcat-embed-jasper.jar" value="${tomcat.embed}/tomcat-embed-jasper.jar"/>
<property name="tomcat-embed-el.jar" value="${tomcat.embed}/tomcat-embed-el.jar"/>
<property name="tomcat7-embed-websocket.jar" value="${tomcat.embed}/tomcat7-embed-websocket.jar"/>
<property name="tomcat-embed-juli.jar" value="${tomcat.embed}/tomcat-embed-logging-juli.jar"/>
<property name="tomcat-embed-core-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-core-src.jar"/>
<property name="tomcat-embed-jasper-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-jasper-src.jar"/>
<property name="tomcat-embed-el-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-el-src.jar"/>
<property name="tomcat7-embed-websocket-sources.jar" value="${tomcat.embed.sources}/tomcat7-embed-websocket-src.jar"/>
<property name="tomcat-embed-juli-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-logging-juli-src.jar"/>
<property name="tomcat-embed-dbcp-sources.jar" value="${tomcat.embed.sources}/tomcat-dbcp-src.jar"/>
<!-- Extras JARs & source JARs -->
<property name="tomcat-juli-extras.jar" value="${tomcat.extras}/tomcat-juli.jar"/>
<property name="tomcat-juli-adapters.jar" value="${tomcat.extras}/tomcat-juli-adapters.jar"/>
<property name="catalina-ws.jar" value="${tomcat.extras}/catalina-ws.jar"/>
<property name="catalina-jmx-remote.jar" value="${tomcat.extras}/catalina-jmx-remote.jar"/>
<property name="tomcat-embed-log4j.jar" value="${tomcat.embed}/tomcat-embed-logging-log4j.jar"/>
<property name="tomcat-juli-extras-src.jar" value="${tomcat.extras.sources}/tomcat-juli-src.jar"/>
<property name="tomcat-juli-adapters-src.jar" value="${tomcat.extras.sources}/tomcat-juli-adapters-src.jar"/>
<property name="catalina-ws-src.jar" value="${tomcat.extras.sources}/catalina-ws-src.jar"/>
<property name="catalina-jmx-remote-src.jar" value="${tomcat.extras.sources}/catalina-jmx-remote-src.jar"/>
<property name="tomcat-embed-log4j-src.jar" value="${tomcat.embed.sources}/tomcat-embed-logging-log4j-src.jar"/>
<!-- jdbc-pool JARs & source JARs -->
<property name="tomcat-jdbc.jar" value="${tomcat.pool}/tomcat-jdbc.jar"/>
<property name="tomcat-jdbc-src.jar" value="${tomcat.pool}/tomcat-jdbc-src.jar"/>
<!-- WebSocket 1.0 (JSR-356) API and implementation JARs & source JARS -->
<!-- The API JAR is the same as the one that ships with Tomcat 8 except -->
<!-- that it does not use Java 7 features (<> and multi-catch) and has -->
<!-- been compiled for Java 6. The implementation JAR includes a number of -->
<!-- modifications to remove the dependencies on the Servlet 3.1 APIs. -->
<!-- The implementation JAR will only work with Tomcat 7. -->
<property name="websocket-api.jar" value="${tomcat.build}/lib/websocket-api.jar"/>
<property name="tomcat7-websocket.jar" value="${tomcat.build}/lib/tomcat7-websocket.jar"/>
<property name="websocket-api-src.jar" value="${tomcat.src.jars}/websocket-api-src.jar"/>
<property name="tomcat7-websocket-src.jar" value="${tomcat.src.jars}/tomcat7-websocket-src.jar"/>
<!-- Tests To Run -->
<property name="test.name" value="**/Test*.java"/>
<property name="test.formatter" value="-Dorg.apache.juli.formatter=java.util.logging.SimpleFormatter"/>
<!-- Cobertura code coverage settings -->
<property name="cobertura.out" value="${tomcat.output}/coverage"/>
<property name="cobertura.datafile" value="${cobertura.out}/cobertura.ser"/>
<property name="tomcat.classes.cobertura" value="${tomcat.classes}-cobertura"/>
<property name="cobertura.report.format" value="html"/>
<!-- Workaround against http://bugs.sun.com/view_bug.do?bug_id=6202721 -->
<available file="/dev/urandom" property="test.jvmarg.egd" value="-Djava.security.egd=file:/dev/./urandom"/>
<property name="test.jvmarg.egd" value="" />
<!-- Include .gitignore in src distributions. -->
<!-- .git and .gitignore are in defaultexcludes since Ant 1.8.2 -->
<defaultexcludes add="**/.git" />
<defaultexcludes add="**/.git/**" />
<defaultexcludes remove="**/.gitignore" />
<!--<defaultexcludes echo="true" />-->
<!-- Classpaths -->
<path id="compile.classpath">
<pathelement location="${jdt.jar}"/>
</path>
<path id="tomcat.classpath">
<pathelement location="${tomcat.classes}"/>
</path>
<path id="tomcat.test.classpath">
<pathelement location="${tomcat.build}/webapps/examples/WEB-INF/classes"/>
<pathelement location="${test.classes}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest.jar}"/>
<path refid="compile.classpath" />
<path refid="tomcat.classpath" />
</path>
<path id="tomcat.webservices.classpath">
<path refid="tomcat.classpath" />
<fileset dir="${tomcat.extras}/webservices">
<include name="jaxrpc.jar"/>
<include name="wsdl4j.jar"/>
</fileset>
</path>
<!-- Version info filter set -->
<tstamp>
<format property="year" pattern="yyyy" locale="en"/>
<format property="today" pattern="MMM d yyyy" locale="en"/>
<format property="tstamp" pattern="hh:mm:ss"/>
</tstamp>
<filterset id="version.filters">
<filter token="YEAR" value="${year}"/>
<filter token="VERSION" value="${version}"/>
<filter token="VERSION_NUMBER" value="${version.number}"/>
<filter token="TOMCAT7_DISTRIBUTION" value="${distribution.name}"/>
<filter token="VERSION_MAJOR" value="${version.major}"/>
<filter token="VERSION_MAJOR_MINOR" value="${version.major.minor}"/>
<filter token="VERSION_BUILT" value="${today} ${tstamp}"/>
<filter token="JDT_VERSION" value="${jdt.version}"/>
</filterset>
<!-- Files to change line endings for depending on target platform -->
<patternset id="text.files" >
<include name="**/INSTALLLICENSE"/>
<include name="**/KEYS"/>
<include name="**/LICENSE"/>
<include name="**/NOTICE"/>
<include name="**/RELEASE-NOTES"/>
<include name="**/.gitignore"/>
<include name="**/*.classpath"/>
<include name="**/*.css"/>
<include name="**/*.dtd"/>
<include name="**/*.htm"/>
<include name="**/*.html"/>
<include name="**/*.ini"/>
<include name="**/*.java"/>
<include name="**/*.jjt"/>
<include name="**/*.jsp"/>
<include name="**/*.jspf"/>
<include name="**/*.jspx"/>
<include name="**/*.launch"/>
<include name="**/*.license"/>
<include name="**/*.manifest"/>
<include name="**/*.mdl"/>
<include name="**/*.MF"/>
<include name="**/*.notice"/>
<include name="**/*.nsi"/>
<include name="**/*.pl"/>
<include name="**/*.policy"/>
<include name="**/*.pom"/>
<include name="**/*.project"/>
<include name="**/*.properties"/>
<include name="**/*.properties.default"/>
<include name="**/*.svg"/>
<include name="**/*.tag"/>
<include name="**/*.tagx"/>
<include name="**/*.tasks"/>
<include name="**/*.tld"/>
<include name="**/*.txt"/>
<include name="**/*.xhtml"/>
<include name="**/*.xml"/>
<include name="**/*.xsd"/>
<include name="**/*.xsl"/>
</patternset>
<!-- ========= Pattern sets used to control content of JAR files ========= -->
<!-- Pattern sets for jar files in standard distributions -->
<patternset id="files.annotations-api">
<include name="javax/annotation/**" />
<include name="javax/ejb/**" />
<include name="javax/persistence/**" />
<include name="javax/xml/ws/**" />
</patternset>
<patternset id="files.servlet-api">
<include name="javax/servlet/*" />
<include name="javax/servlet/annotation/**" />
<include name="javax/servlet/descriptor/**" />
<include name="javax/servlet/http/**" />
<include name="javax/servlet/resources/**" />
</patternset>
<patternset id="files.jsp-api">
<include name="javax/servlet/jsp/**" />
</patternset>
<patternset id="files.el-api">
<include name="javax/el/**" />
</patternset>
<patternset id="files.websocket-api">
<include name="javax/websocket/**" />
</patternset>
<patternset id="files.tomcat7-websocket">
<include name="org/apache/tomcat/websocket/**" />
</patternset>
<patternset id="files.bootstrap">
<include name="org/apache/catalina/startup/Bootstrap.*" />
<include name="org/apache/catalina/startup/catalina.properties" />
<include name="org/apache/catalina/startup/CatalinaProperties.*" />
<include name="org/apache/catalina/startup/ClassLoaderFactory.*" />
<include name="org/apache/catalina/startup/ClassLoaderFactory$*.*" />
<include name="org/apache/catalina/startup/Tool.*" />
<include name="org/apache/catalina/loader/StandardClassLoader*.*" />
<include name="org/apache/catalina/loader/Extension.*" />
<include name="org/apache/catalina/loader/Reloader.*" />
<include name="org/apache/catalina/security/SecurityClassLoad.*" />
<include name="org/apache/naming/JndiPermission.*" />
</patternset>
<patternset id="files.tomcat-juli">
<include name="org/apache/juli/**" />
</patternset>
<patternset id="files.tomcat-api">
<include name="org/apache/tomcat/*" />
</patternset>
<patternset id="files.tomcat-util">
<include name="org/apache/tomcat/util/descriptor/**" />
<include name="org/apache/tomcat/util/file/**" />
<include name="org/apache/tomcat/util/res/**" />
<include name="org/apache/tomcat/util/scan/**" />
<include name="org/apache/tomcat/util/security/**" />
</patternset>
<patternset id="files.catalina">
<include name="org/apache/catalina/**" />
<include name="org/apache/naming/**" />
<!-- Modules -->
<exclude name="org/apache/catalina/ant/**" />
<exclude name="org/apache/catalina/ha/**" />
<exclude name="org/apache/catalina/mbeans/JmxRemote*" />
<exclude name="org/apache/catalina/tribes/**" />
<exclude name="org/apache/naming/factory/webservices/**" />
</patternset>
<patternset id="files.catalina-tribes">
<include name="org/apache/catalina/tribes/**" />
</patternset>
<patternset id="files.catalina-ha">
<include name="org/apache/catalina/ha/**" />
</patternset>
<patternset id="files.catalina-ant">
<include name="org/apache/catalina/ant/**" />
<include name="org/apache/catalina/util/Base64.*" />
</patternset>
<patternset id="files.tomcat-coyote">
<include name="org/apache/coyote/**" />
<include name="org/apache/tomcat/jni/**" />
<include name="org/apache/jk/**" />
<include name="org/apache/tomcat/util/**" />
<!-- Exclude the files shared between Catalina & Jasper -->
<exclude name="org/apache/tomcat/util/descriptor/**" />
<exclude name="org/apache/tomcat/util/file/**" />
<exclude name="org/apache/tomcat/util/res/**" />
<exclude name="org/apache/tomcat/util/scan/**" />
<exclude name="org/apache/tomcat/util/security/**" />
</patternset>
<patternset id="files.jasper">
<include name="org/apache/jasper/**" />
</patternset>
<patternset id="files.jasper-el">
<include name="org/apache/el/**" />
</patternset>
<patternset id="files.tomcat-dbcp">
<include name="org/apache/tomcat/dbcp/**"/>
</patternset>
<!-- Pattern sets for embedded JARs -->
<!-- Every standard pattern set above should be included in an embedded JAR -->
<patternset id="files.tomcat-embed-core" >
<patternset refid="files.annotations-api" />
<patternset refid="files.bootstrap" />
<patternset refid="files.catalina" />
<patternset refid="files.servlet-api" />
<patternset refid="files.tomcat-api" />
<!-- These pattern sets conflict so include files directly
<patternset refid="files.tomcat-coyote" />
<patternset refid="files.tomcat-util" />
-->
<include name="org/apache/coyote/**" />
<include name="org/apache/tomcat/jni/**" />
<include name="org/apache/jk/**" />
<include name="org/apache/tomcat/util/**" />
</patternset>
<patternset id="files.tomcat-embed-jasper" >
<patternset refid="files.jasper" />
<patternset refid="files.jsp-api" />
</patternset>
<patternset id="files.tomcat-embed-el" >
<patternset refid="files.el-api" />
<patternset refid="files.jasper-el" />
</patternset>
<patternset id="files.tomcat7-embed-websocket" >
<patternset refid="files.websocket-api" />
<patternset refid="files.tomcat7-websocket" />
</patternset>
<!-- Pattern sets used directly -->
<!--<patternset refid="files.tomcat-juli" />-->
<!-- Pattern sets not included in embedded -->
<!-- Cluster support not included in embedded -->
<!--<patternset refid="files.catalina-tribes" />-->
<!--<patternset refid="files.catalina-ha" />-->
<!-- Ant tasks not included in embedded -->
<!--<patternset refid="files.catalina-ant" />-->
<!-- Pattern sets for extras JARs -->
<patternset id="files.tomcat-extras-ws">
<include name="org/apache/naming/factory/webservices/**" />
</patternset>
<patternset id="files.tomcat-extras-jmxremote">
<include name="org/apache/catalina/mbeans/JmxRemote*" />
</patternset>
<patternset id="files.tomcat-extras-juli-adapters">
<include name="org/apache/juli/logging/impl/**" />
<exclude name="org/apache/juli/logging/impl/WeakHashtable*" />
<exclude name="org/apache/juli/logging/impl/LogFactoryImpl" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</patternset>
<!-- =========================== Build targets =========================== -->
<target name="build-prepare">
<!-- Required so we can compile -->
<mkdir dir="${tomcat.classes}"/>
<!-- Ensure these directories are removed every time we re-build -->
<delete dir="${tomcat.build}/temp" />
<delete dir="${tomcat.build}/work" />
<!-- Minimum dirs needed for a working Tomcat instance -->
<mkdir dir="${tomcat.build}"/>
<mkdir dir="${tomcat.build}/bin"/>
<mkdir dir="${tomcat.build}/conf"/>
<mkdir dir="${tomcat.build}/lib"/>
<mkdir dir="${tomcat.build}/logs"/>
<mkdir dir="${tomcat.build}/temp"/>
<mkdir dir="${tomcat.build}/webapps"/>
<!-- Property that determines if manifests need updating -->
<uptodate property="manifests.uptodate"
targetfile="${tomcat.manifests}/default.manifest" >
<srcfiles file="${basedir}/build.properties" />
<srcfiles file="${basedir}/build.properties.default" />
<srcfiles file="${basedir}/build.xml" />
<srcfiles dir="${tomcat.home}/res/META-INF" >
<include name="*.manifest" />
<include name="*.license" />
<include name="*.notice" />
</srcfiles>
</uptodate>
</target>
<target name="validate" if="${execute.validate}"
depends="build-prepare,compile-prepare,download-validate"
description="Uses Checkstyle tool to perform style check for the source code">
<!-- Required so we can cache checkstyle results -->
<mkdir dir="${tomcat.output}/res/checkstyle"/>
<taskdef resource="checkstyletask.properties"
classpath="${checkstyle.jar}" />
<checkstyle config="res/checkstyle/checkstyle.xml">
<fileset dir="." >
<patternset refid="text.files" />
<include name="**/*.bat"/>
<include name="**/*.sh"/>
<exclude name="bin/setenv.*"/>
<exclude name=".*/**"/>
<exclude name="output/**"/>
<exclude name="modules/**"/>
<exclude name="**/*.mdl"/>
<exclude name="**/*_2.xml"/>
<exclude name="res/checkstyle/header-al2.txt"/>
<!-- Exclude auto-generated files -->
<exclude name="java/org/apache/el/parser/ELParser*.java" />
<exclude name="java/org/apache/el/parser/Node.java" />
<exclude name="java/org/apache/**/parser/JJT*ParserState.java" />
<exclude name="java/org/apache/**/parser/ParseException.java" />
<exclude name="java/org/apache/**/parser/SimpleCharStream.java" />
<exclude name="java/org/apache/**/parser/Token*.java" />
<!-- Exclude these else Gump runs validate on them -->
<exclude name="**/org/apache/tomcat/dbcp/**"/>
<exclude name="**/tomcat-deps/**"/>
<!-- Exclude simple test files -->
<exclude name="test/webapp-3.0/bug53257/**/*.txt"/>
<exclude name="test/webapp-3.0-fragments/WEB-INF/classes/*.txt"/>
</fileset>
<fileset dir="modules/jdbc-pool" >
<exclude name=".*/**"/>
<exclude name="**/MANIFEST.MF"/>
<patternset refid="text.files" />
</fileset>
</checkstyle>
<!-- javax package checks -->
<checkstyle config="res/checkstyle/javax-checkstyle.xml">
<fileset dir="java/javax" >
<include name="**/*.java"/>
</fileset>
</checkstyle>
<!-- org package checks -->
<checkstyle config="res/checkstyle/org-checkstyle.xml">
<fileset dir="java/org" >
<include name="**/*.java"/>
</fileset>
</checkstyle>
</target>
<target name="validate-eoln" depends="build-prepare,compile-prepare"
description="Validate that the source files have correct line ends">
<!-- Compile the CheckEol class only. Note that the class depends on
Ant only. There is no need to download additional dependencies nor
add them to the class path. The rest should be the same as in "compile"
target.-->
<javac srcdir="java" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<compilerarg value="-Xlint:unchecked"/>
<include name="org/apache/tomcat/buildutil/CheckEol*" />
</javac>
<taskdef name="checkeol"
classname="org.apache.tomcat.buildutil.CheckEol"
classpath="${tomcat.classes}" />
<checkeol>
<fileset dir="." >
<patternset refid="text.files" />
<include name="**/*.bat"/>
<include name="**/*.sh"/>
<exclude name=".*/**"/>
<exclude name="output/**"/>
<exclude name="modules/**"/>
<!-- Exclude these else Gump runs validate on them -->
<exclude name="**/org/apache/tomcat/dbcp/**"/>
<exclude name="**/tomcat-deps/**"/>
</fileset>
<fileset dir="modules/jdbc-pool" >
<patternset refid="text.files" />
</fileset>
</checkeol>
</target>
<target name="compile-prepare">
<!-- Add the builtin catalina.properties -->
<copy todir="java/org/apache/catalina/startup"
file="conf/catalina.properties" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<!-- Copy jdbc-pool documentation -->
<copy tofile="webapps/docs/jdbc-pool.xml"
file="${tomcat.jdbc.dir}/doc/jdbc-pool.xml" encoding="ISO-8859-1">
<filterset>
<filter token="TOMCAT_PROJECT_DEST" value="project.xml"/>
</filterset>
</copy>
</target>
<target name="compile" depends="compile-java6,compile-java7" />
<target name="compile-java6"
depends="build-prepare,compile-prepare">
<!-- Compile internal server components -->
<javac srcdir="java" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="compile.classpath" />
<exclude name="org/apache/naming/factory/webservices/**" />
<!-- Exclude classes that require Java 7 to compile -->
<exclude name="org/apache/tomcat/websocket/**" />
</javac>
<!-- Copy static resource files -->
<copy todir="${tomcat.classes}" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="java">
<include name="**/*.properties"/>
<include name="**/*.dtd"/>
<include name="**/*.tasks"/>
<include name="**/*.xsd"/>
<include name="**/*.xml"/>
</fileset>
</copy>
<!-- Copy JSP Schemas and DTDs to be packed into servlet-api.jar -->
<copy todir="${tomcat.classes}/javax/servlet/resources" encoding="ISO-8859-1">
<fileset dir="${tomcat.classes}/javax/servlet/jsp/resources">
<include name="*" />
<exclude name="jspxml*" />
</fileset>
</copy>
</target>
<target name="compile-java7" depends="compile-java6" if="java.7.home" >
<javac sourcepath="" srcdir="java" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true"
fork="true"
executable="${java.7.home}/bin/javac">
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="compile.classpath" />
<!-- Only include classes that require Java 7 to compile -->
<include name="org/apache/tomcat/websocket/**" />
<!-- Not required but prevents a warning being displayed -->
<bootclasspath>
<fileset dir="${java.7.home}/jre/lib">
<include name="*.jar"/>
</fileset>
</bootclasspath>
</javac>
</target>
<target name="build-manifests" unless="manifests.uptodate"
depends="build-prepare">
<!-- Filtering tokens for JAR manifests-->
<filter token="source.jdk" value="${compile.source}"/>
<filter token="target.jdk" value="${compile.target}"/>
<filter token="servlet.revision" value="${servlet.revision}"/>
<filter token="jsp.revision" value="${jsp.revision}"/>
<filter token="el.revision" value="${el.revision}"/>
<filter token="websocket.revision" value="${websocket.revision}"/>
<mkdir dir="${tomcat.manifests}" />
<copy todir="${tomcat.manifests}" overwrite="yes" filtering="yes"
encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="${tomcat.home}/res/META-INF" />
</copy>
</target>
<target name="package" depends="compile,build-manifests,package-java7" >
<!-- Common Annotations 1.0 JAR File -->
<jarIt jarfile="${annotations-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.annotations-api"
manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
<!-- Servlet 3.0 Implementation JAR File -->
<jarIt jarfile="${servlet-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.servlet-api"
manifest="${tomcat.manifests}/servlet-api.jar.manifest"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license" />
<!-- JSP 2.2 Implementation JAR File -->
<jarIt jarfile="${jsp-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.jsp-api"
manifest="${tomcat.manifests}/jsp-api.jar.manifest"
notice="${tomcat.manifests}/jsp-api.jar.notice"
license="${tomcat.manifests}/jsp-api.jar.license" />
<!-- JSP 2.2 EL Implementation JAR File -->
<jarIt jarfile="${el-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.el-api"
manifest="${tomcat.manifests}/el-api.jar.manifest" />
<!-- Bootstrap JAR File -->
<jarIt jarfile="${bootstrap.jar}"
filesDir="${tomcat.classes}"
filesId="files.bootstrap"
manifest="${tomcat.manifests}/bootstrap.jar.manifest" />
<!-- Tomcat-juli JAR File -->
<jarIt jarfile="${tomcat-juli.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-juli" />
<!-- Catalina Main JAR File -->
<jarIt jarfile="${catalina.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina" />
<!-- Catalina GroupCom/Tribes JAR File -->
<jarIt jarfile="${catalina-tribes.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-tribes" />
<!-- Catalina Cluster/HA JAR File -->
<jarIt jarfile="${catalina-ha.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-ha" />
<!-- Catalina Ant Tasks JAR File -->
<jarIt jarfile="${catalina-ant.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-ant" />
<!-- Tomcat API JAR File -->
<jarIt jarfile="${tomcat-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-api" />
<!-- Tomcat Util JAR File -->
<jarIt jarfile="${tomcat-util.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-util" />
<!-- Protocol handlers - Coyote -->
<jarIt jarfile="${tomcat-coyote.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-coyote" />
<!-- Jasper Implementation JAR File -->
<jarIt jarfile="${jasper.jar}"
filesDir="${tomcat.classes}"
filesId="files.jasper"
manifest="${tomcat.manifests}/jasper.jar.manifest" />
<!-- Jasper EL Implementation JAR File -->
<jarIt jarfile="${jasper-el.jar}"
filesDir="${tomcat.classes}"
filesId="files.jasper-el" />
<!-- i18n JARs -->
<zip destfile="${tomcat.build}/lib/tomcat-i18n-es.jar">
<fileset dir="${tomcat.classes}">
<include name="**/LocalStrings_es.properties" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</zip>
<zip destfile="${tomcat.build}/lib/tomcat-i18n-fr.jar">
<fileset dir="${tomcat.classes}">
<include name="**/LocalStrings_fr.properties" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</zip>
<zip destfile="${tomcat.build}/lib/tomcat-i18n-ja.jar">
<fileset dir="${tomcat.classes}">
<include name="**/LocalStrings_ja.properties" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</zip>
</target>
<target name="package-java7" depends="compile,build-manifests"
if="java.7.home">
<!-- WebSocket 1.0 API JAR File -->
<jarIt jarfile="${websocket-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.websocket-api"
manifest="${tomcat.manifests}/websocket-api.jar.manifest" />
<!-- WebSocket 1.0 implementation JAR File -->
<jarIt jarfile="${tomcat7-websocket.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat7-websocket"
meta-inf="${tomcat.manifests}/tomcat7-websocket.jar"/>
</target>
<target name="build-docs" depends="compile-prepare" description="Builds all documentation from XML sources">
<copy todir="${tomcat.build}/webapps">
<fileset dir="webapps">
<include name="docs/images/**"/>
<include name="docs/WEB-INF/**"/>
<include name="docs/appdev/*.txt"/>
<include name="docs/appdev/sample/**"/>
</fileset>
<fileset dir="webapps">
<include name="docs/architecture/**"/>
<exclude name="docs/architecture/*.xml"/>
</fileset>
</copy>
<copy todir="${tomcat.build}/webapps" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="webapps">
<include name="docs/**/*.html"/>
</fileset>
</copy>
<copy todir="${tomcat.build}/webapps/docs" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir=".">
<include name="BUILDING.txt"/>
<include name="RUNNING.txt"/>
</fileset>
</copy>
<copy tofile="${tomcat.build}/webapps/docs/RELEASE-NOTES.txt" file="RELEASE-NOTES" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<copy tofile="${tomcat.build}/webapps/docs/appdev/sample/build.xml"
file="webapps/docs/appdev/build.xml.txt"/>
<mkdir dir="${tomcat.build}/webapps/docs/funcspecs" />
<!-- XSL processing -->
<xslt basedir="webapps/docs"
destdir="${tomcat.build}/webapps/docs"
extension=".html"
style="webapps/docs/tomcat-docs.xsl"
filenameparameter="filename"
excludes="build.xml project.xml"
includes="*.xml">
<param name="sitedir" expression="tomcat-${version.major.minor}-doc/"/>
<param name="subdir" expression=""/>
<param name="relative-path" expression="."/>
<param name="version" expression="${version}"/>
<param name="majorversion" expression="${version.major}"/>
<param name="majorminorversion" expression="${version.major.minor}"/>
<param name="build-date" expression="${today}"/>
<param name="year" expression="${year}"/>
</xslt>
<xslt basedir="webapps/docs/appdev"
destdir="${tomcat.build}/webapps/docs/appdev"
extension=".html"
style="webapps/docs/tomcat-docs.xsl"
filenameparameter="filename"
excludes="project.xml"
includes="*.xml">
<param name="sitedir" expression="tomcat-${version.major.minor}-doc/"/>
<param name="subdir" expression="appdev/"/>
<param name="relative-path" expression=".."/>
<param name="version" expression="${version}"/>
<param name="majorversion" expression="${version.major}"/>
<param name="majorminorversion" expression="${version.major.minor}"/>
<param name="build-date" expression="${today}"/>
<param name="year" expression="${year}"/>
</xslt>
<xslt basedir="webapps/docs/funcspecs"
destdir="${tomcat.build}/webapps/docs/funcspecs"
extension=".html"
style="webapps/docs/tomcat-docs.xsl"
filenameparameter="filename"
excludes="project.xml"
includes="*.xml">
<param name="sitedir" expression="tomcat-${version.major.minor}-doc/"/>
<param name="subdir" expression="funcspecs/"/>
<param name="relative-path" expression=".."/>
<param name="version" expression="${version}"/>
<param name="majorversion" expression="${version.major}"/>
<param name="majorminorversion" expression="${version.major.minor}"/>
<param name="build-date" expression="${today}"/>
<param name="year" expression="${year}"/>
</xslt>
<xslt basedir="webapps/docs/config"
destdir="${tomcat.build}/webapps/docs/config"
extension=".html"
style="webapps/docs/tomcat-docs.xsl"
filenameparameter="filename"
excludes="project.xml"
includes="*.xml">
<param name="sitedir" expression="tomcat-${version.major.minor}-doc/"/>
<param name="subdir" expression="config/"/>
<param name="relative-path" expression=".."/>
<param name="version" expression="${version}"/>
<param name="majorversion" expression="${version.major}"/>
<param name="majorminorversion" expression="${version.major.minor}"/>
<param name="build-date" expression="${today}"/>
<param name="year" expression="${year}"/>
</xslt>
<xslt basedir="webapps/docs/architecture"
destdir="${tomcat.build}/webapps/docs/architecture"
extension=".html"
style="webapps/docs/tomcat-docs.xsl"
filenameparameter="filename"
excludes="project.xml"
includes="*.xml">
<param name="sitedir" expression="tomcat-${version.major.minor}-doc/"/>
<param name="subdir" expression="architecture/"/>
<param name="relative-path" expression=".."/>
<param name="version" expression="${version}"/>
<param name="majorversion" expression="${version.major}"/>
<param name="majorminorversion" expression="${version.major.minor}"/>
<param name="build-date" expression="${today}"/>
<param name="year" expression="${year}"/>
</xslt>
<xslt basedir="webapps/docs/tribes"
destdir="${tomcat.build}/webapps/docs/tribes"
extension=".html"
style="webapps/docs/tomcat-docs.xsl"
filenameparameter="filename"
excludes="project.xml"
includes="*.xml">
<param name="sitedir" expression="tomcat-${version.major.minor}-doc/"/>
<param name="subdir" expression="tribes/"/>
<param name="relative-path" expression=".."/>
<param name="version" expression="${version}"/>
<param name="majorversion" expression="${version.major}"/>
<param name="majorminorversion" expression="${version.major.minor}"/>
<param name="build-date" expression="${today}"/>
<param name="year" expression="${year}"/>
</xslt>
</target>
<target name="deploy" depends="package,build-docs,deploy-webapps,compile-webapp-examples"
description="Default. Builds a working Tomcat instance">
<!--
<copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
file="${tomcat-native.tar.gz}" />
<copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
file="${commons-daemon.native.src.tgz}" />
<copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
-->
<!-- Copy scripts -->
<copy todir="${tomcat.build}/bin">
<fileset dir="bin">
<exclude name="**/*.launch"/>
<exclude name="**/*.sh"/>
<exclude name="**/*.bat"/>
</fileset>
</copy>
<copy todir="${tomcat.build}/bin" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="bin">
<include name="**/*.sh"/>
<include name="**/*.bat"/>
</fileset>
</copy>
<!-- Copy doesn't retain permissions -->
<chmod dir="${tomcat.build}/bin" includes="*.sh" perm="+x"/>
<!-- Copy static resource files -->
<copy todir="${tomcat.build}/conf" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="conf">
<include name="**/*.policy"/>
<include name="**/*.xml"/>
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<target name="deploy-webapps" depends="package,build-docs">
<!-- Copy other regular webapps -->
<copy todir="${tomcat.build}/webapps">
<fileset dir="webapps">
<include name="ROOT/**"/>
<exclude name="ROOT/index.jsp"/>
<include name="examples/**"/>
<include name="manager/**"/>
<include name="host-manager/**"/>
</fileset>
</copy>
<copy todir="${tomcat.build}/webapps" encoding="ISO-8859-1">
<filterset refid="version.filters" />
<fileset dir="webapps">
<include name="ROOT/index.jsp"/>
</fileset>
</copy>
<copy tofile="${tomcat.build}/webapps/ROOT/RELEASE-NOTES.txt" file="RELEASE-NOTES" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<!-- Add sources for examples -->
<antcall target="examples-sources" />
<copy file="${tomcat-dbcp.jar}" todir="${tomcat.build}/lib"
failonerror="false"/>
<copy file="${jdt.jar}" todir="${tomcat.build}/lib" />
<!-- build the jdbc-pool jar and source jar-->
<echo message="Building Tomcat JDBC pool libraries"/>
<ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
inheritAll="false" target="build">
<property name="tomcat.pool" value="${tomcat.pool}" />
<property name="tomcat.juli.jar" value="${tomcat-juli.jar}" />
<property name="skip.download" value="set"/>
</ant>
<copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
</target>
<target name="compile-webapp-examples" >
<!-- Build classes for examples webapp -->
<mkdir dir="${tomcat.build}/webapps/examples/WEB-INF/classes"/>
<javac srcdir="webapps/examples/WEB-INF/classes"
destdir="${tomcat.build}/webapps/examples/WEB-INF/classes"
debug="${compile.debug}" deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
classpath="${tomcat.classes}"
excludes="**/CVS/**,**/.svn/**"
encoding="ISO-8859-1"
includeantruntime="false">
</javac>
<mkdir dir="${tomcat.build}/webapps/examples/jsp/plugin/applet"/>
<javac srcdir="webapps/examples/jsp/plugin/applet"
destdir="${tomcat.build}/webapps/examples/jsp/plugin/applet"
debug="${compile.debug}" deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
classpath="$tomcat.lcasses}"
excludes="**/CVS/**,**/.svn/**"
encoding="ISO-8859-1"
includeantruntime="false">
</javac>
</target>
<target name="build-tomcat-jdbc-src">
<!-- build the jdbc-pool source jar-->
<echo message="Building Tomcat JDBC pool src JAR"/>
<ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
inheritAll="false" target="build-src">
<property name="tomcat.pool" value="${tomcat.pool}" />
<property name="tomcat.juli.jar" value="${tomcat-juli.jar}" />
<property name="skip.download" value="set"/>
</ant>
</target>
<target name="examples-sources" description="Create examples sources"
unless="examples.sources.skip" >
<taskdef name="txt2html"
classname="org.apache.tomcat.buildutil.Txt2Html"
classpath="${tomcat.classes}" />
<txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/simpletag">
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples">
<include name="BookBean.java"/>
</fileset>
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/simpletag">
<include name="FindBookSimpleTag.java"/>
<include name="RepeatSimpleTag.java"/>
<include name="HelloWorldSimpleTag.java"/>
</fileset>
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/el">
<include name="Functions.java"/>
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/jspattribute">
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples">
<include name="FooBean.java"/>
</fileset>
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/simpletag">
<include name="ShuffleSimpleTag.java"/>
<include name="TileSimpleTag.java"/>
<include name="HelloWorldSimpleTag.java"/>
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples/jsp/cal">
<fileset dir="webapps/examples/WEB-INF/classes/cal">
<include name="Entries.java"/>
<include name="Entry.java"/>
<include name="JspCalendar.java"/>
<include name="TableBean.java"/>
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples/jsp/jsptoserv">
<fileset dir="webapps/examples/WEB-INF/classes">
<include name="ServletToJsp.java"/>
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/el">
<fileset dir="webapps/examples/WEB-INF/classes/examples">
<include name="ValuesTag.java"/>
</fileset>
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples">
<include name="ValuesBean.java"/>
</fileset>
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/el">
<include name="Functions.java"/>
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/misc">
<fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/simpletag">
<include name="EchoAttributesTag.java"/>
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/tagfiles">
<fileset dir="webapps/examples/WEB-INF/tags">
<include name="**/*.tag" />
</fileset>
</txt2html>
<txt2html todir="${tomcat.build}/webapps/examples">
<fileset dir="webapps/examples">
<include name="**/*.jsp" />
<include name="**/*.jspx" />
<include name="**/*.jspf" />
<exclude name="error/errorpge.jsp"/>
<exclude name="forward/one.jsp"/>
<exclude name="include/foo.jsp"/>
<exclude name="jsptoserv/hello.jsp"/>
<exclude name="security/protected/error.jsp"/>
<exclude name="security/protected/index.jsp"/>
<exclude name="security/protected/login.jsp"/>
<exclude name="source.jsp"/>
</fileset>
</txt2html>
</target>
<target name="embed-jars" description="Create experimental embedded jars"
depends="build-manifests,compile" >
<mkdir dir="${tomcat.embed}" />
<copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
<copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
<copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
failonerror="false"/>
<copy file="${jdt.jar}" todir="${tomcat.embed}" />
<!-- Note the meta-inf below will work as long as there is only one JAR
that needs to add entries. If there is more than one a more complex
solution will be required. -->
<jarIt jarfile="${tomcat-embed-core.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-core"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"/>
<jarIt jarfile="${tomcat-embed-jasper.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-jasper"
notice="${tomcat.manifests}/jsp-api.jar.notice"
license="${tomcat.manifests}/jsp-api.jar.license"/>
<jarIt jarfile="${tomcat-embed-el.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-el"/>
<jarIt jarfile="${tomcat7-embed-websocket.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat7-embed-websocket"
meta-inf="${tomcat.manifests}/tomcat7-websocket.jar"/>
<jarIt jarfile="${tomcat-embed-juli.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-juli"/>
</target>
<target name="embed-sources"
description="Create source jars for embedded jars"
depends="build-manifests" >
<mkdir dir="${tomcat.embed.sources}" />
<jarIt jarfile="${tomcat-embed-core-sources.jar}"
filesDir="java"
filesId="files.tomcat-embed-core"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"/>
<jarIt jarfile="${tomcat-embed-jasper-sources.jar}"
filesDir="java"
filesId="files.tomcat-embed-jasper"
notice="${tomcat.manifests}/jsp-api.jar.notice"
license="${tomcat.manifests}/jsp-api.jar.license"/>
<jarIt jarfile="${tomcat-embed-el-sources.jar}"
filesDir="java"
filesId="files.tomcat-embed-el"/>
<jarIt jarfile="${tomcat7-embed-websocket-sources.jar}"
filesDir="java"
filesId="files.tomcat7-embed-websocket"/>
<jarIt jarfile="${tomcat-embed-juli-sources.jar}"
filesDir="java"
filesId="files.tomcat-juli"/>
<copy file="${tomcat-dbcp-src.jar}" todir="${tomcat.embed.sources}" />
<!--No sources for ${jdt.jar} -->
</target>
<target name="embed"
description="Creates the experimental embedded release"
depends="embed-jars,embed-sources,embed-extras" >
<fixcrlf srcdir="${tomcat.embed}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<zip destfile="${tomcat.embed}/${final.name}-embed.zip">
<fileset dir="${tomcat.embed}">
<include name="**" />
<exclude name="*.md5" />
<exclude name="*.zip" />
<exclude name="*.tar.gz" />
</fileset>
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.embed}/${final.name}-embed.zip" />
</antcall>
<fixcrlf srcdir="${tomcat.embed}" eol="lf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<tar longfile="gnu" compression="gzip"
tarfile="${tomcat.embed}/${final.name}-embed.tar.gz">
<tarfileset dir="${tomcat.embed}" prefix="${final.name}-embed">
<include name="**" />
<exclude name="*.md5" />
<exclude name="*.zip" />
<exclude name="*.tar.gz" />
</tarfileset>
</tar>
<antcall target="md5sum">
<param name="file" value="${tomcat.embed}/${final.name}-embed.tar.gz" />
</antcall>
</target>
<target name="test-compile" depends="compile,download-test-compile,compile-webapp-examples" >
<mkdir dir="${test.classes}"/>
<!-- Compile -->
<javac srcdir="test" destdir="${test.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
encoding="ISO-8859-1"
includeantruntime="false">
<classpath refid="tomcat.test.classpath" />
<include name="org/apache/**" />
<include name="javax/**" />
<include name="util/**" />
<exclude unless="java.7.home" name="org/apache/catalina/websocket/**" />
<exclude unless="java.7.home" name="org/apache/tomcat/websocket/**" />
</javac>
<!-- Copy static resource files the tests need to load via the class -->
<!-- loader. -->
<copy todir="${test.classes}" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="test">
<include name="**/*.jks"/>
<include name="**/*.pem"/>
</fileset>
</copy>
</target>
<!-- Default JUnit log output formatter -->
<property name="junit.formatter.type" value="plain" />
<property name="junit.formatter.usefile" value="true" />
<property name="junit.formatter.extension" value=".txt" />
<target name="test" description="Runs the JUnit test cases"
depends="test-bio,test-nio,test-apr,cobertura-report" >
<fail if="test.result.error" message='Some tests completed with an Error. See ${tomcat.build}/logs for details, search for "FAILED".' />
<fail if="test.result.failure" message='Some tests completed with a Failure. See ${tomcat.build}/logs for details, search for "FAILED".' />
</target>
<target name="test-bio" description="Runs the JUnit test cases for BIO. Does not stop on errors."
depends="test-init,test-compile,deploy,cobertura-instrument" if="${execute.test.bio}">
<runtests protocol="org.apache.coyote.http11.Http11Protocol"
extension=".BIO" />
</target>
<target name="test-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
depends="test-init,test-compile,deploy,cobertura-instrument" if="${execute.test.nio}">
<runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
extension=".NIO" />
</target>
<target name="test-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
depends="test-init,test-compile,deploy,test-apr-exists,cobertura-instrument"
if="${apr.exists}">
<runtests protocol="org.apache.coyote.http11.Http11AprProtocol"
extension=".APR" />
</target>
<target name="test-apr-exists" description="Checks for APR lib"
if="${execute.test.apr}">
<available file="${test.apr.loc}" property="apr.exists" />
</target>
<target name="test-init1" if="java.7.home">
<property name="java.bin.path" value="${java.7.home}/bin/"/>
</target>
<target name="test-init2" unless="java.7.home">
<property name="java.bin.path" value=""/>
</target>
<target name="test-init" depends="test-init1,test-init2" />
<macrodef name="runtests"
description="Runs the unit tests using the specified connector.
Does not stop on errors, but sets 'test.result.error' and 'test.result.failure' properties.">
<attribute name="protocol"
description="The class name for the connector protocol"/>
<attribute name="extension"
description="The extension to use to distinguish the output"/>
<sequential>
<mkdir dir="${test.reports}" />
<junit printsummary="yes" fork="yes" dir="." showoutput="no"
errorproperty="test.result.error"
failureproperty="test.result.failure"
haltonfailure="${test.haltonfailure}"
jvm="${java.bin.path}java" >
<jvmarg value="${test.jvmarg.egd}"/>
<jvmarg value="-Djava.library.path=${test.apr.loc}"/>
<jvmarg value="${test.formatter}"/>
<jvmarg value="-Dapple.awt.UIElement=true"/>
<classpath refid="tomcat.test.run.classpath" />
<sysproperty key="tomcat.test.temp" value="${test.temp}" />
<sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
<sysproperty key="tomcat.test.protocol" value="@{protocol}" />
<sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
<sysproperty key="tomcat.test.reports" value="${test.reports}" />
<!-- File for Cobertura to write coverage results to -->
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<formatter type="${junit.formatter.type}"
usefile="${junit.formatter.usefile}"
extension="@{extension}${junit.formatter.extension}" />
<!-- If test.entry is defined, run a single test, otherwise run all valid tests -->
<test todir="${test.reports}" name="${test.entry}"
if="test.entry" unless="test.entry.methods"
/>
<test todir="${test.reports}" name="${test.entry}" methods="${test.entry.methods}"
if="test.entry.methods"
/>
<batchtest todir="${test.reports}" unless="test.entry">
<fileset dir="test" >
<!-- Include all by default -->
<include name="${test.name}" />
<!-- Exclude helper classes -->
<exclude name="**/Tester*.java" />
<!-- Exclude the tests known to fail -->
<exclude name="org/apache/catalina/tribes/test/**" />
<!-- Exclude both sets of WebSocket tests unless Java 7 is -->
<!-- present as the WebSocket examples (used by the tests) won't -->
<!-- build without it. -->
<exclude unless="java.7.home" name="org/apache/catalina/websocket/**" />
<exclude unless="java.7.home" name="org/apache/tomcat/websocket/**" />
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="cobertura-disabled" unless="${test.cobertura}">
<!-- Define classpath used to run tests when Cobertura is turned off. -->
<path id="tomcat.test.run.classpath">
<path refid="tomcat.test.classpath" />
</path>
</target>
<target name="cobertura-instrument" depends="compile,download-cobertura,cobertura-disabled"
if="${test.cobertura}"
description="Adds Cobertura instrumentation to the compiled bytecode">
<path id="cobertura.classpath">
<fileset dir="${cobertura.home}">
<include name="cobertura-${cobertura.version}.jar" />
<include name="lib/**/*.jar" />
<exclude name="lib/**/jetty*.jar" />
<exclude name="lib/**/servlet-api*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<cobertura-instrument datafile="${cobertura.datafile}"
todir="${tomcat.classes.cobertura}">
<fileset dir="${tomcat.classes}">
<include name="**/*.class"/>
<exclude name="**/ClassLoaderLogManager.class"/>
<exclude name="**/ClassLoaderLogManager*.class"/>
<exclude name="**/FileHandler.class"/>
<exclude name="**/AsyncFileHandler.class"/>
<exclude name="**/AsyncFileHandler*.class"/>
<exclude name="**/OneLineFormatter.class"/>
<exclude name="**/OneLineFormatter*.class"/>
<exclude name="**/DateFormatCache.class"/>
<exclude name="**/DateFormatCache*.class"/>
</fileset>
<auxClasspath path="${jdt.jar}" />
</cobertura-instrument>
<!-- Define classpath used to run tests -->
<!-- The Cobertura instrumented classes must appear first on the classpath -->
<path id="tomcat.test.run.classpath">
<path location="${tomcat.classes.cobertura}" />
<path refid="tomcat.test.classpath" />
<path refid="cobertura.classpath"/>
</path>
</target>
<target name="cobertura-report" if="${test.cobertura}"
depends="test-bio,test-nio,test-apr"
description="Creates report from gathered Cobertura results">
<cobertura-report srcdir="${basedir}/java" destdir="${cobertura.out}"
datafile="${cobertura.datafile}"
format="${cobertura.report.format}"/>
</target>
<target name="extras-prepare" >
<mkdir dir="${tomcat.extras}"/>
<mkdir dir="${tomcat.extras.sources}"/>
<mkdir dir="${tomcat.embed}"/>
<mkdir dir="${tomcat.embed.sources}"/>
<mkdir dir="${tomcat.extras}/logging"/>
<mkdir dir="${tomcat.extras}/webservices"/>
</target>
<target name="extras-commons-logging-prepare"
depends="extras-prepare"
description="Prepare to build web services extras package">
<antcall target="downloadfile-2">
<param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
<param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
<param name="destfile" value="${commons-logging-src.tar.gz}"/>
<param name="destdir" value="${commons-logging.home}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${avalon-framework.loc}"/>
<param name="destfile" value="${avalon-framework.jar}"/>
<param name="destdir" value="${avalon-framework.home}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${log4j.loc}"/>
<param name="destfile" value="${log4j.jar}"/>
<param name="destdir" value="${log4j.home}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${logkit.loc}"/>
<param name="destfile" value="${logkit.jar}"/>
<param name="destdir" value="${logkit.home}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${servletapi.loc}"/>
<param name="destfile" value="${servletapi.jar}"/>
<param name="destdir" value="${servletapi.home}"/>
</antcall>
</target>
<target name="extras-commons-logging"
depends="extras-commons-logging-prepare,compile,build-manifests"
description="Build JULI for log4j extras package">
<gunzip src="${commons-logging-src.tar.gz}"
dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
<untar src="${tomcat.extras}/logging/commons-logging-src.tar"
dest="${tomcat.extras}/logging/"/>
<replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/commons"
encoding="ISO-8859-1">
<replacefilter token="org.apache.commons"
value="org.apache.juli" />
</replace>
<mkdir dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/juli" />
<move todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/juli">
<fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/commons" />
</move>
<replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src"
encoding="ISO-8859-1">
<replacefilter token="org.apache.commons"
value="org.apache.juli" />
<replacefilter token="org/apache/commons/"
value="org/apache/juli/" />
</replace>
<copy tofile="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build2.xml"
file="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build.xml" />
<copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src">
<fileset file="${avalon-framework.jar}" />
<fileset file="${log4j.jar}" />
<fileset file="${logkit.jar}" />
<fileset file="${servletapi.jar}" />
</copy>
<ant antfile="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build2.xml"
dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src"
inheritAll="false" target="compile" />
<jar jarfile="${tomcat-juli-extras.jar}"
manifest="${tomcat.manifests}/default.manifest"
filesonly="true">
<fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/target/classes">
<include name="org/apache/juli/logging/*" />
<include name="org/apache/juli/logging/impl/LogFactoryImpl*.class" />
<include name="org/apache/juli/logging/impl/WeakHashtable*.class" />
<include name="org/apache/juli/logging/impl/SimpleLog*.class" />
<include name="org/apache/juli/logging/impl/NoOpLog*.class" />
<include name="org/apache/juli/logging/impl/Jdk14Logger.class" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<fileset dir="${tomcat.classes}">
<include name="org/apache/juli/*" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</jar>
<antcall target="md5sum">
<param name="file" value="${tomcat-juli-extras.jar}" />
</antcall>
<jarIt jarfile="${tomcat-juli-adapters.jar}"
filesDir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/target/classes"
filesId="files.tomcat-extras-juli-adapters" />
<antcall target="md5sum">
<param name="file" value="${tomcat-juli-adapters.jar}" />
</antcall>
<!-- Source JARs -->
<jar jarfile="${tomcat-juli-extras-src.jar}"
manifest="${tomcat.manifests}/default.manifest"
filesonly="true">
<fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java">
<include name="org/apache/juli/logging/*.java" />
<include name="org/apache/juli/logging/impl/LogFactoryImpl*.java" />
<include name="org/apache/juli/logging/impl/WeakHashtable*.java" />
<include name="org/apache/juli/logging/impl/SimpleLog*.java" />
<include name="org/apache/juli/logging/impl/NoOpLog*.java" />
<include name="org/apache/juli/logging/impl/Jdk14Logger.java" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<fileset dir="java">
<include name="org/apache/juli/*" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</jar>
<jarIt jarfile="${tomcat-juli-adapters-src.jar}"
filesDir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java"
filesId="files.tomcat-extras-juli-adapters" />
</target>
<target name="extras-webservices-prepare"
depends="extras-prepare"
description="Prepare to build web services extras package">
<antcall target="downloadfile">
<param name="sourcefile" value="${jaxrpc-lib.loc}"/>
<param name="destfile" value="${jaxrpc-lib.jar}"/>
<param name="destdir" value="${jaxrpc-lib.home}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${wsdl4j-lib.loc}"/>
<param name="destfile" value="${wsdl4j-lib.jar}"/>
<param name="destdir" value="${wsdl4j-lib.home}"/>
</antcall>
<copy file="${jaxrpc-lib.jar}"
tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
<copy file="${wsdl4j-lib.jar}"
tofile="${tomcat.extras}/webservices/wsdl4j.jar" />
</target>
<target name="extras-webservices"
depends="extras-webservices-prepare,compile,build-manifests"
description="Build web services extras package">
<!-- Compile web services classes components -->
<javac srcdir="java" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
encoding="ISO-8859-1"
includeantruntime="false">
<classpath refid="tomcat.webservices.classpath" />
<include name="org/apache/naming/factory/webservices/**" />
</javac>
<jarIt jarfile="${catalina-ws.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-extras-ws" />
<antcall target="md5sum">
<param name="file" value="${catalina-ws.jar}" />
</antcall>
<jarIt jarfile="${catalina-ws-src.jar}"
filesDir="java"
filesId="files.tomcat-extras-ws" />
</target>
<target name="extras-jmx-remote"
depends="extras-prepare,compile,build-manifests"
description="Build JMX remote extras package">
<jarIt jarfile="${catalina-jmx-remote.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-extras-jmxremote" />
<antcall target="md5sum">
<param name="file" value="${catalina-jmx-remote.jar}" />
</antcall>
<jarIt jarfile="${catalina-jmx-remote-src.jar}"
filesDir="java"
filesId="files.tomcat-extras-jmxremote" />
</target>
<target name="extras"
depends="extras-commons-logging,extras-webservices,extras-jmx-remote"
description="Build all extras packages">
</target>
<target name="embed-extras" depends="extras"
description="Embedded packaging for those extras that can use it">
<jar jarfile="${tomcat-embed-log4j.jar}"
manifest="${tomcat.manifests}/default.manifest"
filesonly="true">
<fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/target/classes">
<include name="org/apache/juli/logging/*" />
<include name="org/apache/juli/logging/impl/*" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<fileset dir="${tomcat.classes}">
<include name="org/apache/juli/*" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</jar>
<jar jarfile="${tomcat-embed-log4j-src.jar}"
manifest="${tomcat.manifests}/default.manifest"
filesonly="true">
<fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java">
<include name="org/apache/juli/logging/*.java" />
<include name="org/apache/juli/logging/impl/*.java" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<fileset dir="java">
<include name="org/apache/juli/*" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<zipfileset file="${tomcat.manifests}/default.notice"
fullpath="META-INF/NOTICE" />
<zipfileset file="${tomcat.manifests}/default.license"
fullpath="META-INF/LICENSE" />
</jar>
</target>
<target name="dist-prepare" depends="download-dist">
<mkdir dir="${tomcat.dist}"/>
<mkdir dir="${tomcat.dist}/bin"/>
<mkdir dir="${tomcat.dist}/conf"/>
<mkdir dir="${tomcat.dist}/lib"/>
<mkdir dir="${tomcat.dist}/logs"/>
<mkdir dir="${tomcat.dist}/temp"/>
<mkdir dir="${tomcat.dist}/webapps"/>
<mkdir dir="${tomcat.dist}/work"/>
<mkdir dir="${tomcat.release}/v${version}/bin" />
<mkdir dir="${tomcat.release}/v${version}/src" />
</target>
<target name="dist-static" depends="dist-prepare, deploy, extras, embed">
<!-- Copy the top-level documentation files -->
<copy todir="${tomcat.dist}" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir=".">
<include name="INSTALLING.txt"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
</fileset>
</copy>
<!-- Copy the contents of each "build" directory -->
<copy todir="${tomcat.dist}/bin">
<fileset dir="${tomcat.build}/bin">
</fileset>
</copy>
<copy todir="${tomcat.dist}/lib">
<fileset dir="${tomcat.build}/lib" />
</copy>
<copy todir="${tomcat.dist}/conf">
<fileset dir="${tomcat.build}/conf">
</fileset>
</copy>
<copy todir="${tomcat.dist}/webapps">
<fileset dir="${tomcat.build}/webapps">
<exclude name="**/ROOT/WEB-INF/classes/**" />
<exclude name="**/WEB-INF/src/**" />
</fileset>
</copy>
<touch file="${tomcat.dist}/temp/safeToDelete.tmp" />
<!-- Correct permissions and line endings on "bin" scripts -->
<fixcrlf srcdir="${tomcat.dist}/bin" includes="*.sh" eol="lf" encoding="ISO-8859-1" fixlast="false" />
<fixcrlf srcdir="${tomcat.dist}/bin" includes="*.bat" eol="crlf" encoding="ISO-8859-1" fixlast="false" />
<chmod dir="${tomcat.dist}/bin" includes="*.sh" perm="+x"/>
<!-- Windows binaries -->
<!-- 32 bit -->
<copy file="${commons-daemon.home}/windows/prunsrv.exe"
tofile="${tomcat.dist}/bin/tomcat${version.major}.exe" />
<copy file="${commons-daemon.home}/windows/prunmgr.exe"
tofile="${tomcat.dist}/bin/tomcat${version.major}w.exe" />
<!-- 64 bit amd -->
<copy file="${commons-daemon.home}/windows/amd64/prunsrv.exe"
tofile="${tomcat.dist}/bin/x64/tomcat${version.major}.exe" />
<!-- 64 bit ia -->
<copy file="${commons-daemon.home}/windows/ia64/prunsrv.exe"
tofile="${tomcat.dist}/bin/i64/tomcat${version.major}.exe" />
<!-- tc native -->
<copy todir="${tomcat.dist}/bin">
<fileset dir="${tomcat-native.home}/${tomcat-native.win.path}/bin">
<include name="*.dll"/>
<include name="**/*.dll"/>
</fileset>
</copy>
<!-- platform README files -->
<echo append="false" file="${tomcat.dist}/bin/i64/README">
Apache Tomcat ${version} native binaries for Win64 IA64 platform.
</echo>
<echo append="false" file="${tomcat.dist}/bin/x64/README">
Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
</echo>
</target>
<target name="javadoc" depends="dist-source,extras-webservices-prepare"
description="Create the Tomcat javadoc" >
<fail unless="java.7.home"
message="The java.7.home property must be set for javadoc build"/>
<javadoc packagenames="javax.servlet.*"
excludepackagenames="javax.servlet.jsp.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/servletapi"
version="true"
windowtitle="Servlet 3.0 API Documentation - Apache Tomcat ${version}"
doctitle="Servlet 3.0 API - Apache Tomcat ${version}"
header="<b>Servlet 3.0 - Apache Tomcat ${version}</b>"
bottom="Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="ISO-8859-1"
additionalparam="-breakiterator"
maxmemory="256m"
executable="${java.7.home}/bin/javadoc">
<classpath>
<path refid="compile.classpath"/>
<path refid="tomcat.webservices.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
</javadoc>
<javadoc packagenames="javax.servlet.jsp.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/jspapi"
version="true"
windowtitle="JSP 2.2 API Documentation - Apache Tomcat ${version}"
doctitle="JSP 2.2 API - Apache Tomcat ${version}"
header="<b>JSP 2.2 - Apache Tomcat ${version}</b>"
bottom="Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="ISO-8859-1"
additionalparam="-breakiterator"
maxmemory="256m"
executable="${java.7.home}/bin/javadoc">
<classpath>
<path refid="compile.classpath"/>
<path refid="tomcat.webservices.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
</javadoc>
<javadoc packagenames="javax.el.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/elapi"
version="true"
windowtitle="EL 2.2 API Documentation - Apache Tomcat ${version}"
doctitle="EL 2.2 API - Apache Tomcat ${version}"
header="<b>EL 2.2 - Apache Tomcat ${version}</b>"
bottom="Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="ISO-8859-1"
additionalparam="-breakiterator"
maxmemory="256m"
executable="${java.7.home}/bin/javadoc">
<classpath>
<path refid="compile.classpath"/>
<path refid="tomcat.webservices.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
</javadoc>
<javadoc packagenames="javax.websocket.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/websocketapi"
version="true"
windowtitle="WebSocket 1.0 API Documentation - Apache Tomcat ${version}"
doctitle="WebSocket 1.0 API - Apache Tomcat ${version}"
header="<b>WebSocket 1.0 - Apache Tomcat ${version}</b>"
bottom="Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="ISO-8859-1"
additionalparam="-breakiterator"
maxmemory="256m"
executable="${java.7.home}/bin/javadoc">
<classpath>
<path refid="compile.classpath"/>
<path refid="tomcat.webservices.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
</javadoc>
<javadoc packagenames="org.apache.*"
destdir="${tomcat.dist}/webapps/docs/api"
version="true"
windowtitle="Apache Tomcat ${version} API Documentation"
doctitle="Apache Tomcat ${version} API"
header="<b>Apache Tomcat ${version}</b>"
bottom="Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="ISO-8859-1"
additionalparam="-breakiterator"
maxmemory="256m"
executable="${java.7.home}/bin/javadoc">
<classpath>
<path refid="compile.classpath"/>
<path refid="tomcat.webservices.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
<link href="../servletapi"/>
<link href="../jspapi"/>
<link href="../elapi"/>
<link href="../websocketapi"/>
<link href="http://docs.oracle.com/javase/7/docs/api/"/>
<link href="http://commons.apache.org/proper/commons-io/javadocs/api-release/"/>
<link href="http://docs.oracle.com/javaee/6/api/"/>
<sourcepath>
<path location="${tomcat.dist}/src/java"/>
<!--jdbc-pool src files for javadoc-->
<path location="${tomcat.dist}/src/modules/jdbc-pool/src/main/java"/>
</sourcepath>
</javadoc>
</target>
<!--
Patch frame injection bugs in javadoc generated files - see CVE-2013-1571,
http://www.kb.cert.org/vuls/id/225657
This macro works together with the javadoc task on Ant and should be invoked
directly after its execution to patch broken javadocs, e.g.:
<patch-javadoc dir="..." docencoding="UTF-8"/>
Please make sure that the docencoding parameter uses the same charset as
javadoc's docencoding. Default is the platform default encoding (like the
javadoc task).
The specified dir is the destination directory of the javadoc task.
-->
<macrodef name="patch-javadoc">
<attribute name="dir"/>
<attribute name="docencoding" default="${file.encoding}"/>
<sequential>
<replace encoding="@{docencoding}" summary="true" taskname="patch-javadoc">
<restrict>
<fileset dir="@{dir}" casesensitive="false"
includes="**/index.html,**/index.htm,**/toc.html,**/toc.htm"/>
<!-- TODO: add encoding="@{docencoding}" to contains check, when we
are on ANT 1.9.0: -->
<not>
<contains text="function validURL(url) {" casesensitive="true" />
</not>
</restrict>
<replacetoken><![CDATA[function loadFrames() {]]></replacetoken>
<replacevalue expandProperties="false"><![CDATA[if (targetPage != "" && !validURL(targetPage))
targetPage = "undefined";
function validURL(url) {
var pos = url.indexOf(".html");
if (pos == -1 || pos != url.length - 5)
return false;
var allowNumber = false;
var allowSep = false;
var seenDot = false;
for (var i = 0; i < url.length - 5; i++) {
var ch = url.charAt(i);
if ('a' <= ch && ch <= 'z' ||
'A' <= ch && ch <= 'Z' ||
ch == '$' ||
ch == '_') {
allowNumber = true;
allowSep = true;
} else if ('0' <= ch && ch <= '9'
|| ch == '-') {
if (!allowNumber)
return false;
} else if (ch == '/' || ch == '.') {
if (!allowSep)
return false;
allowNumber = false;
allowSep = false;
if (ch == '.')
seenDot = true;
if (ch == '/' && seenDot)
return false;
} else {
return false;
}
}
return true;
}
function loadFrames() {]]></replacevalue>
</replace>
</sequential>
</macrodef>
<target name="dist-deployer" depends="dist-prepare,deploy"
description="Create the Tomcat deployer binary">
<!-- Servlet and JSP -->
<copy todir="${tomcat.deployer}/lib">
<fileset dir="${tomcat.build}/lib">
<include name="catalina-ant.jar"/>
<include name="el-api.jar"/>
<include name="jsp-api.jar"/>
<include name="jasper.jar"/>
<include name="jasper-el.jar"/>
<include name="servlet-api.jar"/>
<include name="websocket-api.jar"/>
<include name="tomcat7-websocket.jar"/>
<include name="tomcat-coyote.jar"/>
<include name="tomcat-util.jar"/>
</fileset>
<fileset dir="${tomcat.build}/bin">
<include name="tomcat-juli.jar"/>
</fileset>
</copy>
<!-- Digester and dependencies -->
<jar jarfile="${tomcat.deployer}/lib/catalina-deployer.jar"
filesonly="true">
<fileset dir="${tomcat.classes}">
<include name="org/apache/catalina/startup/DigesterFactory.class" />
<include name="org/apache/catalina/util/SchemaResolver.class" />
<include name="org/apache/catalina/util/StringManager.class" />
<include name="org/apache/tomcat/util/*" />
<include name="org/apache/tomcat/util/digester/**" />
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
</jar>
<!-- Main build script -->
<copy todir="${tomcat.deployer}">
<fileset dir="${basedir}/res/deployer" />
</copy>
<!-- Copy deployer documentation -->
<copy todir="${tomcat.deployer}">
<fileset dir="${tomcat.build}/webapps/docs">
<include name="images/asf-logo.gif" />
<include name="images/tomcat.gif" />
</fileset>
</copy>
<copy tofile="${tomcat.deployer}/deployer-howto.html"
file="${tomcat.build}/webapps/docs/deployer-howto.html"/>
</target>
<target name="dist-source" depends="compile-prepare">
<mkdir dir="${tomcat.dist}/src"/>
<!-- Tomcat source -->
<copy todir="${tomcat.dist}/src">
<fileset dir="${basedir}" defaultexcludes="true">
<not>
<or>
<filename name="**/.settings/**" />
<filename name="**/.classpath"/>
<filename name="**/.checkstyle"/>
<filename name="**/.project"/>
<filename name="**/output/**"/>
<!-- Commented out, because
test/webapp-3.0-virtual-library and
test/webapp-3.0-virtual-webapp use it:
<filename name="**/target/**"/>
-->
<filename name="**/build.properties"/>
<filename name="**/mvn.properties"/>
<filename name="**/*.iml" />
<filename name="**/*.asc" />
<filename name="**/*.tmp" />
<filename name="**/*.jj" />
<filename name="**/maven-ant-tasks-*.jar" />
<filename name="**/thumbs.db" />
<filename name="**/Thumbs.db" />
<filename name="*.launch"/>
<filename name="bin/setenv.*" />
<filename name="java/org/apache/catalina/startup/catalina.properties" />
<filename name="logs/**" />
<filename name="webapps/docs/jdbc-pool.xml" />
<filename name="work/**" />
<filename name="modules/jdbc-pool/bin/**" />
<filename name="modules/jdbc-pool/includes/**" />
<and>
<!-- exclude all modules except jdbc-pool -->
<filename name="modules/**" />
<not>
<filename name="modules/jdbc-pool/**" />
</not>
</and>
</or>
</not>
</fileset>
</copy>
</target>
<target name="installer" description="Create Windows installer"
unless="skip.installer" depends="dist-static">
<echo message="Builds a Windows installer based on Nullsoft Installer"/>
<copy todir="${tomcat.dist}">
<fileset dir="res">
<include name="INSTALLLICENSE" />
<include name="*.bmp" />
<include name="*.ico" />
<include name="confinstall/**" />
</fileset>
</copy>
<copy file="${nsis.installoptions.dll}" todir="${tomcat.dist}" />
<copy file="${nsis.nsexec.dll}" todir="${tomcat.dist}" />
<copy file="${nsis.nsisdl.dll}" todir="${tomcat.dist}" />
<copy file="res/tomcat.nsi" tofile="${tomcat.dist}/tomcat.nsi" overwrite="true" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<fixcrlf srcdir="${tomcat.dist}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
<arg value="/DNSISDIR=${nsis.home}" />
<arg value="/V2" />
<arg value="tomcat.nsi" />
</exec>
<exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
<arg value="${nsis.exe}" />
<arg value="/DNSISDIR=${nsis.home}" />
<arg value="/V2" />
<arg value="tomcat.nsi" />
</exec>
<move file="${tomcat.dist}/tomcat-installer.exe" tofile="${tomcat.release}/v${version}/bin/${final.name}.exe" />
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}.exe" />
</antcall>
</target>
<target name="release"
depends="clean,clean-depend,release-init,dist-deployer,installer,package-zip,package-winzip,package-tgz,package-deployer-zip,package-deployer-tgz,javadoc,package-docs-tgz,package-src-zip,package-src-tgz,package-src-jar"
description="Create a Tomcat 7 packaged distribution">
<copy file="KEYS"
todir="${tomcat.release}/v${version}"/>
<copy file="RELEASE-NOTES"
todir="${tomcat.release}/v${version}"
encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<copy file="res/welcome.main.html"
tofile="${tomcat.release}/v${version}/README.html"
encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<copy file="res/welcome.bin.html"
tofile="${tomcat.release}/v${version}/bin/README.html"
encoding="ISO-8859-1">
<filterset refid="version.filters"/>
</copy>
<mkdir dir="${tomcat.release}/v${version}/bin/extras" />
<copy todir="${tomcat.release}/v${version}/bin/extras">
<fileset dir="${tomcat.extras}">
<include name="*.*"/>
</fileset>
</copy>
<mkdir dir="${tomcat.release}/v${version}/bin/embed" />
<copy todir="${tomcat.release}/v${version}/bin/embed">
<fileset dir="${tomcat.embed}">
<include name="*.zip"/>
<include name="*.tar.gz"/>
<include name="*.md5"/>
<include name="*.asc"/>
</fileset>
</copy>
</target>
<!-- Sets properties only required for releases -->
<target name="release-init" depends="gpg-init-1,gpg-init-2" >
<fail unless="java.7.home"
message="The java.7.home property must be set for a release build"/>
</target>
<target name="gpg-init-1">
<available file="${gpg.exec}" property="gpg.exec.available"/>
</target>
<target name="gpg-init-2" if="${gpg.exec.available}">
<input message="Enter GPG pass-phrase" addproperty="gpg.passphrase" >
<handler type="secure"/>
</input>
</target>
<!-- Packages the core zip distro -->
<target name="package-zip" depends="dist-static">
<fixcrlf srcdir="${tomcat.dist}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<zip zipfile="${tomcat.release}/v${version}/bin/${final.name}.zip">
<zipfileset dir="${tomcat.dist}" prefix="${final.name}">
<include name="bin/**"/>
<include name="conf/**"/>
<include name="logs/**"/>
<include name="lib/**"/>
<include name="webapps/**"/>
<include name="work/**"/>
<include name="temp/**"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BENCHMARKS.txt"/>
<exclude name="bin/service.bat"/>
<exclude name="bin/x64/"/>
<exclude name="bin/i64/"/>
<exclude name="bin/*.exe"/>
<exclude name="bin/*.dll"/>
</zipfileset>
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}.zip" />
</antcall>
</target>
<!-- Packages the core windows zip distros -->
<target name="package-winzip" depends="dist-static">
<fixcrlf srcdir="${tomcat.dist}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<!-- Windows x86 package -->
<zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-windows-x86.zip">
<zipfileset dir="${tomcat.dist}" prefix="${final.name}">
<include name="bin/**"/>
<include name="conf/**"/>
<include name="logs/**"/>
<include name="lib/**"/>
<include name="webapps/**"/>
<include name="work/**"/>
<include name="temp/**"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BENCHMARKS.txt"/>
<exclude name="bin/x64/"/>
<exclude name="bin/i64/"/>
</zipfileset>
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}-windows-x86.zip" />
</antcall>
<!-- Windows x64 package -->
<zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-windows-x64.zip">
<zipfileset dir="${tomcat.dist}" prefix="${final.name}">
<include name="bin/**"/>
<include name="conf/**"/>
<include name="logs/**"/>
<include name="lib/**"/>
<include name="webapps/**"/>
<include name="work/**"/>
<include name="temp/**"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BENCHMARKS.txt"/>
<exclude name="bin/x64/"/>
<exclude name="bin/i64/"/>
<exclude name="bin/*.dll"/>
<exclude name="bin/tomcat${version.major}.exe"/>
</zipfileset>
<zipfileset dir="${tomcat.dist}/bin/x64" prefix="${final.name}/bin">
<include name="*.dll"/>
<include name="*.exe"/>
</zipfileset>
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}-windows-x64.zip" />
</antcall>
<!-- Windows i64 package -->
<zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-windows-i64.zip">
<zipfileset dir="${tomcat.dist}" prefix="${final.name}">
<include name="bin/**"/>
<include name="conf/**"/>
<include name="logs/**"/>
<include name="lib/**"/>
<include name="webapps/**"/>
<include name="work/**"/>
<include name="temp/**"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BENCHMARKS.txt"/>
<exclude name="bin/x64/"/>
<exclude name="bin/i64/"/>
<exclude name="bin/*.dll"/>
<exclude name="bin/tomcat${version.major}.exe"/>
</zipfileset>
<zipfileset dir="${tomcat.dist}/bin/i64" prefix="${final.name}/bin">
<include name="*.dll"/>
<include name="*.exe"/>
</zipfileset>
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}-windows-i64.zip" />
</antcall>
</target>
<!-- Packages the deployer distribution in zip format -->
<target name="package-deployer-zip">
<fixcrlf srcdir="${tomcat.dist}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<fixcrlf srcdir="${tomcat.deployer}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<zip zipfile="${tomcat.release}/v${version}/bin/${final.name}-deployer.zip">
<zipfileset dir="${tomcat.deployer}" prefix="${final.name}-deployer" includes="**" />
<zipfileset dir="${tomcat.dist}" prefix="${final.name}-deployer" includes="LICENSE" />
<zipfileset dir="${tomcat.dist}" prefix="${final.name}-deployer" includes="NOTICE" />
<zipfileset dir="${tomcat.dist}" prefix="${final.name}-deployer" includes="README.txt" />
<zipfileset dir="${tomcat.dist}" prefix="${final.name}-deployer" includes="RELEASE-NOTES" />
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}-deployer.zip" />
</antcall>
</target>
<!-- Packages the core tar.gz distro -->
<target name="package-tgz" depends="dist-static">
<fixcrlf srcdir="${tomcat.dist}" eol="lf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<tar longfile="gnu" compression="gzip"
tarfile="${tomcat.release}/v${version}/bin/${final.name}.tar.gz">
<tarfileset dir="${tomcat.dist}" mode="755" prefix="${final.name}">
<include name="bin/catalina.sh" />
<include name="bin/configtest.sh" />
<include name="bin/daemon.sh" />
<include name="bin/digest.sh" />
<include name="bin/jasper.sh" />
<include name="bin/jspc.sh" />
<include name="bin/setclasspath.sh" />
<include name="bin/startup.sh" />
<include name="bin/shutdown.sh" />
<include name="bin/tool-wrapper.sh" />
<include name="bin/tool-wrapper-using-launcher.sh" />
<include name="bin/shutdown-using-launcher.sh" />
<include name="bin/startup-using-launcher.sh" />
<include name="bin/version.sh" />
</tarfileset>
<tarfileset dir="${tomcat.dist}" mode="600" prefix="${final.name}">
<include name="conf/**" />
</tarfileset>
<tarfileset dir="${tomcat.dist}" prefix="${final.name}">
<include name="bin/**" />
<include name="lib/**" />
<include name="logs/**" />
<include name="temp/**" />
<include name="webapps/**" />
<include name="work/**" />
<include name="LICENSE" />
<include name="NOTICE" />
<include name="README.txt" />
<include name="RELEASE-NOTES" />
<include name="RUNNING.txt" />
<include name="BENCHMARKS.txt" />
<exclude name="bin/catalina.sh" />
<exclude name="bin/configtest.sh" />
<exclude name="bin/daemon.sh" />
<exclude name="bin/digest.sh" />
<exclude name="bin/jasper.sh" />
<exclude name="bin/jspc.sh" />
<exclude name="bin/service.bat"/>
<exclude name="bin/setclasspath.sh" />
<exclude name="bin/startup.sh" />
<exclude name="bin/shutdown.sh" />
<exclude name="bin/tool-wrapper.sh" />
<exclude name="bin/tool-wrapper-using-launcher.sh" />
<exclude name="bin/shutdown-using-launcher.sh" />
<exclude name="bin/startup-using-launcher.sh" />
<exclude name="bin/version.sh" />
<exclude name="conf/**" />
<exclude name="src/**" />
<exclude name="bin/x64/"/>
<exclude name="bin/i64/"/>
<exclude name="bin/*.exe"/>
<exclude name="bin/*.dll"/>
</tarfileset>
</tar>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}.tar.gz" />
</antcall>
</target>
<!-- Packages the deployer Tomcat distro in tar.gz format -->
<target name="package-deployer-tgz">
<fixcrlf srcdir="${tomcat.dist}" eol="lf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<fixcrlf srcdir="${tomcat.deployer}" eol="lf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<tar longfile="gnu" compression="gzip"
tarfile="${tomcat.release}/v${version}/bin/${final.name}-deployer.tar.gz">
<tarfileset dir="${tomcat.dist}" prefix="${final.name}-deployer">
<include name="LICENSE" />
<include name="NOTICE" />
<include name="README.txt" />
<include name="RELEASE-NOTES" />
</tarfileset>
<tarfileset dir="${tomcat.deployer}" prefix="${final.name}-deployer">
<include name="**" />
</tarfileset>
</tar>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}-deployer.tar.gz" />
</antcall>
</target>
<!-- Packages the documentation distro in tar.gz format -->
<target name="package-docs-tgz" depends="dist-static">
<fixcrlf srcdir="${tomcat.dist}" eol="lf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files" />
</fixcrlf>
<tar longfile="gnu" compression="gzip"
tarfile="${tomcat.release}/v${version}/bin/${final.name}-fulldocs.tar.gz">
<tarfileset dir="${tomcat.dist}" prefix="tomcat-${version.major.minor}-doc">
<include name="LICENSE" />
<include name="NOTICE" />
<include name="README.txt" />
</tarfileset>
<tarfileset dir="${tomcat.dist}/webapps/docs" prefix="tomcat-${version.major.minor}-doc">
<include name="**" />
</tarfileset>
</tar>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/bin/${final.name}-fulldocs.tar.gz" />
</antcall>
</target>
<!-- Packages the source code distribution in zip format -->
<target name="package-src-zip" depends="dist-source">
<fixcrlf srcdir="${tomcat.dist}/src" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files"/>
<include name="bin/*.bat" />
<include name="bin/*.sh" />
</fixcrlf>
<zip zipfile="${tomcat.release}/v${version}/src/${final-src.name}.zip">
<zipfileset dir="${tomcat.dist}/src" prefix="${final-src.name}" />
</zip>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/src/${final-src.name}.zip" />
</antcall>
</target>
<!-- Packages the source code distribution in tar.gz format -->
<target name="package-src-tgz" depends="dist-source">
<fixcrlf srcdir="${tomcat.dist}/src" eol="lf"
encoding="ISO-8859-1" fixlast="false" >
<patternset refid="text.files"/>
<include name="bin/*.bat" />
<include name="bin/*.sh" />
</fixcrlf>
<tar longfile="gnu" compression="gzip"
tarfile="${tomcat.release}/v${version}/src/${final-src.name}.tar.gz">
<tarfileset dir="${tomcat.dist}/src" prefix="${final-src.name}" />
</tar>
<antcall target="md5sum">
<param name="file" value="${tomcat.release}/v${version}/src/${final-src.name}.tar.gz" />
</antcall>
</target>
<!-- Packages the source code in JARs to match the binary JARs -->
<target name="package-src-jar"
depends="build-manifests,build-tomcat-jdbc-src,package-src-jar-java7">
<mkdir dir="${tomcat.src.jars}" />
<!-- Common Annotations 1.0 JAR File -->
<jarIt jarfile="${annotations-api-src.jar}"
filesDir="java"
filesId="files.annotations-api"
manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
<!-- Servlet 3.0 Implementation JAR File -->
<jarIt jarfile="${servlet-api-src.jar}"
filesDir="java"
filesId="files.servlet-api"
manifest="${tomcat.manifests}/servlet-api.jar.manifest"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license" />
<!-- JSP 2.2 Implementation JAR File -->
<jarIt jarfile="${jsp-api-src.jar}"
filesDir="java"
filesId="files.jsp-api"
manifest="${tomcat.manifests}/jsp-api.jar.manifest"
notice="${tomcat.manifests}/jsp-api.jar.notice"
license="${tomcat.manifests}/jsp-api.jar.license" />
<!-- JSP 2.2 EL Implementation JAR File -->
<jarIt jarfile="${el-api-src.jar}"
filesDir="java"
filesId="files.el-api"
manifest="${tomcat.manifests}/el-api.jar.manifest" />
<!-- Bootstrap JAR File -->
<jarIt jarfile="${bootstrap-src.jar}"
filesDir="java"
filesId="files.bootstrap"
manifest="${tomcat.manifests}/bootstrap.jar.manifest" />
<!-- Tomcat-juli JAR File -->
<jarIt jarfile="${tomcat-juli-src.jar}"
filesDir="java"
filesId="files.tomcat-juli" />
<!-- Catalina Main JAR File -->
<jarIt jarfile="${catalina-src.jar}"
filesDir="java"
filesId="files.catalina" />
<!-- Catalina GroupCom/Tribes JAR File -->
<jarIt jarfile="${catalina-tribes-src.jar}"
filesDir="java"
filesId="files.catalina-tribes" />
<!-- Catalina Cluster/HA JAR File -->
<jarIt jarfile="${catalina-ha-src.jar}"
filesDir="java"
filesId="files.catalina-ha" />
<!-- Catalina Ant Tasks JAR File -->
<jarIt jarfile="${catalina-ant-src.jar}"
filesDir="java"
filesId="files.catalina-ant" />
<!-- Tomcat API JAR File -->
<jarIt jarfile="${tomcat-api-src.jar}"
filesDir="java"
filesId="files.tomcat-api" />
<!-- Tomcat Util JAR File -->
<jarIt jarfile="${tomcat-util-src.jar}"
filesDir="java"
filesId="files.tomcat-util" />
<!-- Protocol handlers - Coyote -->
<jarIt jarfile="${tomcat-coyote-src.jar}"
filesDir="java"
filesId="files.tomcat-coyote"
notice="${tomcat.manifests}/tomcat-coyote.jar.notice"
license="${tomcat.manifests}/tomcat-coyote.license" />
<!-- Jasper Implementation JAR File -->
<jarIt jarfile="${jasper-src.jar}"
filesDir="java"
filesId="files.jasper" />
<!-- Jasper EL Implementation JAR File -->
<jarIt jarfile="${jasper-el-src.jar}"
filesDir="java"
filesId="files.jasper-el" />
<!-- Repackaged DBCP -->
<copy file="${tomcat-dbcp-src.jar}" todir="${tomcat.src.jars}" />
<!-- jdbc-pool JAR File -->
<copy file="${tomcat-jdbc-src.jar}" todir="${tomcat.src.jars}" />
</target>
<target name="package-src-jar-java7"
depends="build-manifests,build-tomcat-jdbc-src"
if="java.7.home">
<!-- WebSocket 1.0 API JAR File -->
<jarIt jarfile="${websocket-api-src.jar}"
filesDir="java"
filesId="files.websocket-api"
manifest="${tomcat.manifests}/websocket-api.jar.manifest" />
<!-- WebSocket 1.0 implementation JAR File -->
<jarIt jarfile="${tomcat7-websocket-src.jar}"
filesDir="java"
filesId="files.tomcat7-websocket" />
</target>
<!-- ========================= Cleaning Targets ========================== -->
<target name="clean-depend"
description="Deletes the dependencies that are built from source">
<delete dir="${tomcat-dbcp.home}"/>
</target>
<target name="clean"
description="Delete the default output folders">
<delete dir="${tomcat.output}" />
<!-- Remove the copied catalina.properties -->
<delete file="java/org/apache/catalina/startup/catalina.properties" />
<ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}" inheritAll="false" target="clean">
<property name="tomcat.pool" value="${tomcat.pool}" />
</ant>
<!-- remove jdbc-pool documentation -->
<delete file="webapps/docs/jdbc-pool.xml"/>
</target>
<!-- ================ Download and dependency building =================== -->
<target name="download-validate"
description="Download components necessary to validate source"
if="${execute.validate}">
<antcall target="downloadzip">
<param name="sourcefile" value="${checkstyle.loc}"/>
<param name="destfile" value="${checkstyle.jar}"/>
<param name="destdir" value="${base.path}"/>
</antcall>
</target>
<target name="download-compile"
description="Download (and build) components necessary to compile" >
<antcall target="downloadfile-2">
<param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
<param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
<param name="destfile" value="${tomcat-native.tar.gz}"/>
<param name="destdir" value="${tomcat-native.home}"/>
</antcall>
<!-- Download Commons Daemon -->
<antcall target="downloadgz-2">
<param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
<param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
<param name="destfile" value="${commons-daemon.jar}"/>
</antcall>
<antcall target="downloadfile-2">
<param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
<param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
<param name="destfile" value="${commons-daemon.native.src.tgz}"/>
<param name="destdir" value="${commons-daemon.home}"/>
</antcall>
<!-- Download src and build Tomcat DBCP bundle -->
<antcall target="downloadgz-2">
<param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
<param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
<param name="destfile" value="${commons-pool.home}/build.xml" />
</antcall>
<antcall target="downloadgz-2">
<param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
<param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
<param name="destfile" value="${commons-dbcp.home}/build.xml" />
</antcall>
<mkdir dir="${tomcat-dbcp.home}"/>
<!-- Rebuild dbcp only if built jars do not exist -->
<!-- or new versions of pool or dbcp have been downloaded. -->
<condition property="no.build.dbcp">
<and>
<uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp.jar}" />
<uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp-src.jar}" />
<uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp.jar}" />
<uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp-src.jar}" />
</and>
</condition>
<antcall target="build-tomcat-dbcp" />
<!-- Download JDT (Eclipse compiler) -->
<antcall target="downloadfile-2">
<param name="sourcefile.1" value="${jdt.loc.1}"/>
<param name="sourcefile.2" value="${jdt.loc.2}"/>
<param name="destfile" value="${jdt.jar}"/>
<param name="destdir" value="${jdt.home}"/>
</antcall>
</target>
<target name="download-test-compile"
description="Download additional components for the tests" >
<antcall target="downloadfile">
<param name="sourcefile" value="${junit.loc}"/>
<param name="destfile" value="${junit.jar}"/>
<param name="destdir" value="${junit.home}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${hamcrest.loc}"/>
<param name="destfile" value="${hamcrest.jar}"/>
<param name="destdir" value="${hamcrest.home}"/>
</antcall>
</target>
<target name="download-cobertura"
if="${test.cobertura}"
description="Download the Cobertura code coverage tool" >
<antcall target="downloadgz">
<param name="sourcefile" value="${cobertura.loc}"/>
<param name="destfile" value="${cobertura.jar}"/>
</antcall>
</target>
<target name="download-dist"
description="Download additional components for a distribution" >
<antcall target="downloadzip-2">
<param name="sourcefile.1" value="${tomcat-native.win.1}"/>
<param name="sourcefile.2" value="${tomcat-native.win.2}"/>
<param name="destfile" value="${tomcat-native.home}/${tomcat-native.win.path}/LICENSE"/>
<param name="destdir" value="${tomcat-native.home}"/>
</antcall>
<antcall target="downloadzip-2">
<param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
<param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
<param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
<param name="destdir" value="${commons-daemon.native.win.home}"/>
</antcall>
<antcall target="downloadzip">
<param name="sourcefile" value="${nsis.loc}"/>
<param name="destfile" value="${nsis.exe}"/>
<param name="destdir" value="${nsis.home}/.."/>
</antcall>
</target>
<!-- =============== Targets for dependencies that need to =============== -->
<!-- ================ be built rather than used directly ================ -->
<target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
<copy todir="${tomcat-dbcp.home}">
<fileset dir="${commons-pool.home}">
<include name="**/*.java" />
<exclude name="**/test/**" />
</fileset>
<fileset dir="${commons-dbcp.home}">
<include name="**/*.java" />
<exclude name="**/test/**" />
<exclude name="**/managed/**" />
</fileset>
</copy>
<replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
encoding="ISO-8859-1">
<replacefilter token="org.apache.commons"
value="org.apache.tomcat.dbcp" />
</replace>
<replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
encoding="ISO-8859-1">
<replacefilter token="enum"
value="enumeration" />
</replace>
<mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
<move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
<fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
</move>
<mkdir dir="${tomcat-dbcp.home}/classes"/>
<javac destdir="${tomcat-dbcp.home}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
sourcepath="${tomcat-dbcp.home}/src/java"
srcdir="${tomcat-dbcp.home}/src/java"
encoding="ISO-8859-1"
includeantruntime="false">
<include name="**" />
</javac>
<jarIt jarfile="${tomcat-dbcp.jar}"
filesDir="${tomcat-dbcp.home}/classes"
filesId="files.tomcat-dbcp" />
<jarIt jarfile="${tomcat-dbcp-src.jar}"
filesDir="${tomcat-dbcp.home}/src/java"
filesId="files.tomcat-dbcp" />
</target>
<!-- =============== Utility Targets to support downloads ================ -->
<target name="proxyflags">
<!-- check proxy parameters. -->
<condition property="useproxy">
<equals arg1="${proxy.use}" arg2="on" />
</condition>
</target>
<target name="setproxy" depends="proxyflags" if="useproxy">
<taskdef name="setproxy"
classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
<echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
</target>
<target name="testexist">
<echo message="Testing for ${destfile}"/>
<available file="${destfile}" property="exist"/>
</target>
<target name="downloadgz" unless="exist" depends="setproxy,testexist">
<!-- Download and extract the package -->
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${base.path}/file.tar.gz" />
<gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
<untar src="${base.path}/file.tar" dest="${base.path}"/>
<delete file="${base.path}/file.tar"/>
<delete file="${base.path}/file.tar.gz"/>
</target>
<target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
<!-- Download and extract the package from the two alternative locations -->
<delete file="${base.path}/file.tar" quiet="true" />
<delete file="${base.path}/file.tar.gz" quiet="true" />
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.1}" />
<param name="destfile" value="${base.path}/file.tar.gz" />
</antcall>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.2}" />
<param name="destfile" value="${base.path}/file.tar.gz" />
</antcall>
<gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
<untar src="${base.path}/file.tar" dest="${base.path}"/>
<delete file="${base.path}/file.tar"/>
<delete file="${base.path}/file.tar.gz"/>
</target>
<target name="downloadzip" unless="exist" depends="setproxy,testexist">
<!-- Download and extract the package -->
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${base.path}/file.zip" />
<mkdir dir="${destdir}" />
<unzip src="${base.path}/file.zip" dest="${destdir}"/>
<delete file="${base.path}/file.zip"/>
</target>
<target name="downloadzip-2" unless="exist" depends="testexist">
<!-- Download and extract the package from the two alternative locations -->
<delete file="${base.path}/file.zip" quiet="true" />
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.1}" />
<param name="destfile" value="${base.path}/file.zip" />
</antcall>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.2}" />
<param name="destfile" value="${base.path}/file.zip" />
</antcall>
<mkdir dir="${destdir}" />
<unzip src="${base.path}/file.zip" dest="${destdir}"/>
<delete file="${base.path}/file.zip"/>
</target>
<target name="downloadfile" unless="exist" depends="setproxy,testexist">
<!-- Download extract the file -->
<mkdir dir="${destdir}" />
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
</target>
<target name="downloadfile-2" unless="exist" depends="testexist">
<!-- Download the file from the two alternative locations -->
<mkdir dir="${destdir}" />
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.1}" />
</antcall>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.2}" />
</antcall>
<available file="${destfile}" property="exist"/>
<fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
</target>
<target name="trydownload.check" depends="setproxy">
<condition property="trydownload.run">
<and>
<not>
<available file="${destfile}" />
</not>
<http url="${sourcefile}" />
</and>
</condition>
</target>
<target name="trydownload" if="trydownload.run" depends="trydownload.check">
<!-- Downloads a file if not yet downloaded and the source URL is available -->
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
</target>
<!-- ============================ IDE Support ============================ -->
<target name="ide-eclipse"
depends="download-compile, extras-webservices-prepare, download-test-compile"
description="Prepares the source tree to be built in Eclipse">
<!-- Copy the sample project files into the root directory -->
<copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
<copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
<!-- Copy compiler settings file -->
<mkdir dir=".settings" />
<copy file="${tomcat.home}/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties" tofile="${tomcat.home}/.settings/org.eclipse.jdt.core.prefs"/>
<echo>Eclipse project files created.
Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
</target>
<target name="ide-eclipse-websocket"
depends="download-compile, extras-webservices-prepare, download-test-compile"
description="Prepares the source tree to be built in Eclipse - separate project to build classes that require Java 7">
<!-- Create directory "../tomcat-7.0.x-java7" and configure Eclipse project there -->
<property name="projectLocation" location="${tomcat.home}/../tomcat-7.0.x-java7" />
<mkdir dir="${projectLocation}" />
<mkdir dir="${projectLocation}/.settings" />
<copy file="${tomcat.home}/res/ide-support/eclipse/eclipse-websocket.project" tofile="${projectLocation}/.project"/>
<copy file="${tomcat.home}/res/ide-support/eclipse/eclipse-websocket.classpath" tofile="${projectLocation}/.classpath"/>
<copy file="${tomcat.home}/res/ide-support/eclipse/org.eclipse.jdt.core.prefs-websocket.properties" tofile="${projectLocation}/.settings/org.eclipse.jdt.core.prefs"/>
<echo>Eclipse project files created at "${projectLocation}".
Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
</target>
<!-- ======================= Macros, Taskdefs etc ======================== -->
<macrodef name="jarIt" description="utility macro for standard JAR packaging">
<attribute name="jarfile"
description="the name of the JAR file to create"/>
<attribute name="filesDir"
description="the directory from which to obtain the files "/>
<attribute name="filesId"
description="the patternset id of the files to use"/>
<attribute name="manifest" description="the manifest file use"
default="${tomcat.manifests}/default.manifest" />
<attribute name="notice" description="the LICENSE file to use"
default="${tomcat.manifests}/default.notice" />
<attribute name="license" description="the NOTICE file to use"
default="${tomcat.manifests}/default.license" />
<attribute name="meta-inf" description="additional contents for META-INF"
default="${tomcat.manifests}/default" />
<sequential>
<jar jarfile="@{jarfile}" manifest="@{manifest}" filesonly="true">
<fileset dir="@{filesDir}">
<patternset refid="@{filesId}"/>
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
<zipfileset dir="@{meta-inf}" prefix="META-INF/"
excludes=".gitignore" />
<zipfileset file="@{notice}" fullpath="META-INF/NOTICE" />
<zipfileset file="@{license}" fullpath="META-INF/LICENSE" />
</jar>
</sequential>
</macrodef>
<!-- Helper target, used to create a md5 checksum file -->
<!-- Requires 'file' as a parameter. -->
<target name="md5sum">
<fail unless="file" />
<fail if="filename" />
<fail if="value" />
<basename file="${file}" property="filename" />
<checksum file="${file}" property="value" />
<echo file="${file}.md5" message="${value}${md5sum.binary-prefix}${filename}" />
<!-- Anything that requires an md5 hash, also needs a signature -->
<antcall target="sign" >
<param name="file" value="${file}" />
</antcall>
</target>
<!-- Helper target, used to create a detached ascii OpenPGP signature. -->
<!-- Uses GPG with default key. Requires 'file' as a parameter. Only -->
<!-- executes if gpg passphrase is set which is only set when using the -->
<!-- release target. -->
<target name="sign" if="gpg.passphrase">
<fail unless="file" />
<exec executable="${gpg.exec}" failonerror="true"
inputstring="${gpg.passphrase}">
<arg value="--passphrase-fd"/>
<arg value="0"/>
<arg value="-a"/>
<arg value="-b"/>
<arg value="${file}"/>
</exec>
</target>
</project>
|