1 Star 2 Fork 3

Funcy1122/tomcat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.xml 156.16 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="Tomcat 9.0" default="deploy" basedir="."
xmlns:if="ant:if" xmlns:unless="ant:unless">
<!-- ===================== 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"/>
<!-- Check Ant Version -->
<fail message="Ant version ${ant.version.required} or newer is required (${ant.version} is installed)">
<condition>
<not><antversion atleast="${ant.version.required}" /></not>
</condition>
</fail>
<!-- 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" />
<!-- MR B but this was first 1.1 release so use FR -->
<property name="jaspic.revision" value="FR" />
<!-- MR 3 but this was first 1.3 release so use FR -->
<property name="annotation.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-nb.home" value="${basedir}/nbproject" />
<property name="tomcat.output" value="${basedir}/output"/>
<property name="tomcat.bnd" value="${basedir}/res/bnd"/>
<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.i18n" value="${tomcat.output}/i18n"/>
<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.run.classes" value="${tomcat.output}/classes"/>
<property name="test.temp" value="${tomcat.output}/test-tmp"/>
<property name="test.basedir" value="${tomcat.build}"/>
<property name="test.reports" value="${test.basedir}/logs"/>
<property name="test.apr.loc" value="${test.basedir}/bin"/>
<!-- 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"/>
<!-- build output directory for generated reflectionless code -->
<property name="tomcat.xreflect" value="${tomcat.output}/xreflect"/>
<!-- Servlet 4.0 spec requires Java 8+ -->
<property name="compile.source" value="8"/>
<property name="compile.target" value="8"/>
<property name="compile.release" value="8"/>
<property name="min.java.version" value="8"/>
<!-- 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="websocket-api.jar" value="${tomcat.build}/lib/websocket-api.jar"/>
<property name="jaspic-api.jar" value="${tomcat.build}/lib/jaspic-api.jar"/>
<property name="tomcat-websocket.jar" value="${tomcat.build}/lib/tomcat-websocket.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-ssi.jar" value="${tomcat.build}/lib/catalina-ssi.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="catalina-storeconfig.jar" value="${tomcat.build}/lib/catalina-storeconfig.jar"/>
<property name="tomcat-coyote.jar" value="${tomcat.build}/lib/tomcat-coyote.jar"/>
<property name="tomcat-dbcp.jar" value="${tomcat.build}/lib/tomcat-dbcp.jar"/>
<property name="tomcat-jni.jar" value="${tomcat.build}/lib/tomcat-jni.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="tomcat-util-scan.jar" value="${tomcat.build}/lib/tomcat-util-scan.jar"/>
<property name="jasper.jar" value="${tomcat.build}/lib/jasper.jar"/>
<property name="jasper-el.jar" value="${tomcat.build}/lib/jasper-el.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="websocket-api-src.jar" value="${tomcat.src.jars}/websocket-api-src.jar"/>
<property name="jaspic-api-src.jar" value="${tomcat.src.jars}/jaspic-api-src.jar"/>
<property name="tomcat-websocket-src.jar" value="${tomcat.src.jars}/tomcat-websocket-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-ssi-src.jar" value="${tomcat.src.jars}/catalina-ssi-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="catalina-storeconfig-src.jar" value="${tomcat.src.jars}/catalina-storeconfig-src.jar"/>
<property name="tomcat-jni-src.jar" value="${tomcat.src.jars}/tomcat-jni-src.jar"/>
<property name="tomcat-coyote-src.jar" value="${tomcat.src.jars}/tomcat-coyote-src.jar"/>
<property name="tomcat-dbcp-src.jar" value="${tomcat.src.jars}/tomcat-dbcp-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="tomcat-util-scan-src.jar" value="${tomcat.src.jars}/tomcat-util-scan-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"/>
<!-- Embedded JARs & source JARs -->
<property name="tomcat-embed-core.jar" value="${tomcat.embed}/tomcat-embed-core.jar"/>
<property name="tomcat-embed-programmatic.jar" value="${tomcat.embed}/tomcat-embed-programmatic.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="tomcat-embed-websocket.jar" value="${tomcat.embed}/tomcat-embed-websocket.jar"/>
<property name="tomcat-embed-core-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-core-src.jar"/>
<property name="tomcat-embed-programmatic-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-programmatic-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="tomcat-embed-websocket-sources.jar" value="${tomcat.embed.sources}/tomcat-embed-websocket-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"/>
<!-- Tests To Run -->
<property name="test.name" value="**/Test*.java"/>
<property name="test.formatter" value="-Dorg.apache.juli.formatter=java.util.logging.SimpleFormatter"/>
<property name="test.relaxTiming" value="false"/>
<!-- 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"/>
<!-- FindBugs settings -->
<property name="findbugs.out" value="${tomcat.output}/findbugs"/>
<property name="findbugs.report.format" value="html"/>
<property name="findbugs.report.level" value="low"/>
<!-- 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="" />
<!-- Location of OpenSSL binary (file name, not directory) -->
<!-- The OpenSSL tests cases be disabled by specifying an invalid path here -->
<property name="test.openssl.path" 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" />-->
<!-- Java 9 -->
<available classname="java.lang.reflect.InaccessibleObjectException"
property="java9.javadoc.options"
value="-html5"/>
<property name="java9.javadoc.options" value=""/>
<available classname="java.lang.reflect.InaccessibleObjectException"
property="java9.test.option.1"
value="--add-opens=java.base/java.lang=ALL-UNNAMED"/>
<property name="java9.test.option.1" value="-Dtest.1=1"/>
<available classname="java.lang.reflect.InaccessibleObjectException"
property="java9.test.option.2"
value="--add-opens=java.base/java.io=ALL-UNNAMED"/>
<property name="java9.test.option.2" value="-Dtest.2=2"/>
<available classname="java.lang.reflect.InaccessibleObjectException"
property="java9.test.option.3"
value="--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"/>
<property name="java9.test.option.3" value="-Dtest.3=3"/>
<available classname="java.lang.reflect.InaccessibleObjectException"
property="java9.test.option.4"
value="--add-opens=java.base/java.util=ALL-UNNAMED"/>
<property name="java9.test.option.4" value="-Dtest.4=4"/>
<available classname="java.lang.reflect.InaccessibleObjectException"
property="java9.test.option.5"
value="--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"/>
<property name="java9.test.option.5" value="-Dtest.5=5"/>
<!-- Classpaths -->
<path id="compile.classpath">
<pathelement location="${bnd.jar}"/>
<pathelement location="${osgi-annotations.jar}"/>
<pathelement location="${jdt.jar}"/>
<pathelement location="${jaxrpc-lib.jar}"/>
<pathelement location="${wsdl4j-lib.jar}"/>
</path>
<path id="tomcat.classpath">
<pathelement path="${test.run.classes}"/>
</path>
<path id="tomcat.test.classpath">
<pathelement location="${test.basedir}/webapps/examples/WEB-INF/classes"/>
<pathelement location="${test.classes}"/>
<pathelement location="${tomcat.i18n}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest.jar}"/>
<pathelement location="${easymock.jar}"/>
<pathelement location="${cglib.jar}"/>
<pathelement location="${objenesis.jar}"/>
<path refid="compile.classpath" />
<path refid="tomcat.classpath" />
</path>
<!-- Version info filter set -->
<tstamp>
<format property="year" pattern="yyyy" locale="en" timezone="UTC"/>
<format property="today" pattern="MMM d yyyy" locale="en" timezone="UTC"/>
<format property="today-iso-8601" pattern="yyyy-MM-dd" locale="en" timezone="UTC"/>
<format property="tstamp" pattern="HH:mm:ss" locale="en" timezone="UTC"/>
</tstamp>
<filterset id="version.filters">
<filter token="YEAR" value="${year}"/>
<filter token="VERSION" value="${version}"/>
<filter token="VERSION_NUMBER" value="${version.number}"/>
<filter token="VERSION_MAJOR" value="${version.major}"/>
<filter token="VERSION_MAJOR_MINOR" value="${version.major.minor}"/>
<filter token="VERSION_BUILT" value="${today} ${tstamp} UTC"/>
<filter token="JDT_VERSION" value="${jdt.version}"/>
<filter token="GIT_BRANCH" value="${git.branch}"/>
<filter token="MIN_JAVA_VERSION" value="${min.java.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="**/javax.servlet.ServletContainerInitializer"/>
<include name="**/javax.websocket.ContainerProvider"/>
<include name="**/javax.websocket.server.ServerEndpointConfig$Configurator"/>
<include name="**/.gitignore"/>
<include name="**/*.bnd"/>
<include name="**/*.classpath"/>
<include name="**/*.css"/>
<include name="**/*.dtd"/>
<include name="**/*.htm"/>
<include name="**/*.html"/>
<include name="**/*.iml"/>
<include name="**/*.ini"/>
<include name="**/*.java"/>
<include name="**/*.jj"/>
<include name="**/*.jjt"/>
<include name="**/*.json"/>
<include name="**/*.jsp"/>
<include name="**/*.jspf"/>
<include name="**/*.jspx"/>
<include name="**/*.launch"/>
<include name="**/*.license"/>
<include name="**/*.manifest"/>
<include name="**/*.md"/>
<include name="**/*.mdl"/>
<include name="**/*.MF"/>
<include name="**/*.notice"/>
<include name="**/*.nsi"/>
<include name="**/*.pem"/>
<include name="**/*.pl"/>
<include name="**/*.policy"/>
<include name="**/*.pom"/>
<include name="**/*.project"/>
<include name="**/*.properties"/>
<include name="**/*.properties.default"/>
<include name="**/*.shtml"/>
<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"/>
<include name="**/*.yaml"/>
<include name="**/Dockerfile"/>
<!-- Exclude files that use 16-bit encodings. -->
<!-- This prevents fixcrlf corrupting them during a release -->
<exclude name="**/bom-none-prolog-utf16?e.jspx"/>
<exclude name="**/bom-utf16?e-prolog-*.jsp*"/>
</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/**" />
</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/**" />
<exclude name="javax/servlet/jsp"/>
</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.jaspic-api">
<include name="javax/security/auth/message/**" />
</patternset>
<patternset id="files.tomcat-websocket">
<include name="org/apache/tomcat/websocket/**" />
</patternset>
<!-- This duplicates some classes in files.catalina -->
<!-- Duplicating a few classes in bootstrap.jar is simpler than excluding -->
<!-- them from files.catalina and having to manually add them to -->
<!-- files.tomcat-embed-core because of an include/exclude conflict -->
<!-- between files.catalina and files.bootstrap. -->
<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/Constants.*" />
<include name="org/apache/catalina/startup/SafeForkJoinWorkerThreadFactory.*" />
<include name="org/apache/catalina/startup/SafeForkJoinWorkerThreadFactory$*.*" />
<include name="org/apache/catalina/startup/Tool.*" />
<include name="org/apache/catalina/security/SecurityClassLoad.*" />
<include name="org/apache/catalina/webresources/war/**" />
<include name="org/apache/tomcat/util/buf/UriUtil.*" />
</patternset>
<patternset id="files.tomcat-juli">
<include name="org/apache/juli/**" />
</patternset>
<patternset id="files.tomcat-api">
<include name="org/apache/tomcat/*" />
<exclude name="org/apache/tomcat/buildutil" />
<exclude name="org/apache/tomcat/dbcp" />
<exclude name="org/apache/tomcat/jni" />
<exclude name="org/apache/tomcat/util" />
<exclude name="org/apache/tomcat/websocket" />
</patternset>
<patternset id="files.tomcat-util">
<include name="org/apache/tomcat/util/buf/**" />
<include name="org/apache/tomcat/util/codec/**" />
<include name="org/apache/tomcat/util/collections/**" />
<include name="org/apache/tomcat/util/compat/**" />
<include name="org/apache/tomcat/util/file/**" />
<include name="org/apache/tomcat/util/res/**" />
<include name="org/apache/tomcat/util/security/**" />
<include name="org/apache/tomcat/util/threads/**" />
<include name="org/apache/tomcat/util/json/**" />
<include name="org/apache/tomcat/util/*" />
<exclude name="org/apache/tomcat/util/bcel" />
<exclude name="org/apache/tomcat/util/descriptor" />
<exclude name="org/apache/tomcat/util/digester" />
<exclude name="org/apache/tomcat/util/http" />
<exclude name="org/apache/tomcat/util/log" />
<exclude name="org/apache/tomcat/util/modeler" />
<exclude name="org/apache/tomcat/util/net" />
<exclude name="org/apache/tomcat/util/scan" />
</patternset>
<patternset id="files.tomcat-util-scan">
<include name="org/apache/tomcat/util/descriptor/**" />
<include name="org/apache/tomcat/util/digester/**" />
<include name="org/apache/tomcat/util/scan/**" />
</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/tribes/**" />
<exclude name="org/apache/catalina/storeconfig/**" />
<exclude name="org/apache/catalina/ssi/**" />
</patternset>
<patternset id="files.tomcat-embed-programmatic">
<patternset refid="files.jaspic-api" />
<patternset refid="files.tomcat-juli" />
<!-- Servlet -->
<include name="javax/servlet/**" />
<include name="javax/servlet/annotation/**" />
<include name="javax/servlet/http/**" />
<exclude name="javax/servlet/descriptor/**" />
<exclude name="javax/servlet/jsp/**"/>
<exclude name="javax/servlet/resources/**" />
<!-- AprLifecycleListener is configured by default -->
<include name="**/AprLifecycleListener.*"/>
<include name="**/AprStatus.*"/>
<!-- Remove dynamic mbean descriptors -->
<exclude name="**/mbeans-descriptors.xml"/>
<exclude name="**/mbeans-descriptors.dtd"/>
<!-- No JMX Support - But we can't remove the classes -->
<include name="org/apache/tomcat/util/modeler/LocalStrings.properties" />
<include name="org/apache/tomcat/util/modeler/AttributeInfo*" />
<include name="org/apache/tomcat/util/modeler/BaseModelMBean*" />
<include name="org/apache/tomcat/util/modeler/FeatureInfo*" />
<include name="org/apache/tomcat/util/modeler/ManagedBean*" />
<include name="org/apache/tomcat/util/modeler/NoDescriptorRegistry*" />
<include name="org/apache/tomcat/util/modeler/NotificationInfo*" />
<include name="org/apache/tomcat/util/modeler/Registry*" />
<include name="org/apache/tomcat/util/modeler/RegistryMBean*" />
<include name="org/apache/tomcat/util/modeler/Util*" />
<include name="org/apache/tomcat/util/modeler/modules/ModelerSource*" />
<!-- Apache Tomcat Core Code -->
<include name="org/apache/catalina/*"/>
<include name="org/apache/catalina/authenticator/**"/>
<include name="org/apache/catalina/connector/**"/>
<include name="org/apache/catalina/core/**"/>
<include name="org/apache/catalina/deploy/**"/>
<include name="org/apache/catalina/filters/**"/>
<include name="org/apache/catalina/loader/**"/>
<include name="org/apache/catalina/mapper/**"/>
<include name="org/apache/catalina/mbeans/**"/>
<include name="org/apache/catalina/realm/**"/>
<include name="org/apache/catalina/security/**"/>
<include name="org/apache/catalina/session/**"/>
<include name="org/apache/catalina/startup/**"/>
<include name="org/apache/catalina/util/**"/>
<include name="org/apache/catalina/valves/*"/>
<include name="org/apache/catalina/webresources/**"/>
<include name="org/apache/coyote/**" />
<include name="org/apache/naming/**" />
<include name="org/apache/tomcat/*" />
<include name="org/apache/tomcat/util/*" />
<include name="org/apache/tomcat/util/bcel/**" />
<include name="org/apache/tomcat/util/buf/**" />
<include name="org/apache/tomcat/util/codec/**" />
<include name="org/apache/tomcat/util/collections/**" />
<include name="org/apache/tomcat/util/compat/**" />
<include name="org/apache/tomcat/util/descriptor/**" />
<include name="org/apache/tomcat/util/file/**" />
<include name="org/apache/tomcat/util/http/**" />
<include name="org/apache/tomcat/util/json/**" />
<include name="org/apache/tomcat/util/log/**" />
<include name="org/apache/tomcat/util/net/**" />
<include name="org/apache/tomcat/util/res/**" />
<include name="org/apache/tomcat/util/security/**" />
<include name="org/apache/tomcat/util/threads/**" />
<!-- Some of the core code depends on the jar scanner -->
<include name="org/apache/tomcat/util/scan/StandardJarScan*" />
<include name="org/apache/tomcat/util/scan/LocalStrings.properties" />
<!-- Minimize JNI to what doesn't throw an error -->
<include name="org/apache/tomcat/jni/Library.class" />
<include name="org/apache/tomcat/jni/LibraryNotFoundError*" />
<exclude name="org/apache/tomcat/jni" />
<!-- Remove connectors that are not default -->
<exclude name="**/AbstractAjpProtocol.class"/>
<exclude name="**/Ajp*.class"/>
<exclude name="**/AjpApr*.class"/>
<exclude name="**/Http11Apr*.class"/>
<exclude name="**/Http11Nio2*.class"/>
<exclude name="**/JniLifecycleListener.class"/>
<exclude name="org/apache/tomcat/**/*Nio2*.class"/>
<exclude name="org/apache/tomcat/**/Apr*.class"/>
<!-- Minimize bundles to the default set -->
<exclude name="org/apache/**/LocalStrings_*.properties"/>
<!-- Remove digester support -->
<exclude name="org/apache/catalina/**/*Rule.class" />
<exclude name="org/apache/catalina/**/*RuleSet*.class" />
<exclude name="org/apache/tomcat/**/*RuleSet*.class" />
<!-- Remove various Apache Tomcat modules not used by default in an embedded setting -->
<exclude name="org/apache/catalina/ant/**" />
<exclude name="org/apache/catalina/ha/**" />
<exclude name="org/apache/catalina/manager/**" />
<exclude name="org/apache/catalina/ssi/**" />
<exclude name="org/apache/catalina/storeconfig/**" />
<exclude name="org/apache/catalina/tribes/**" />
<exclude name="org/apache/catalina/valves/rewrite/**" />
<exclude name="org/apache/tomcat/buildutil" />
<exclude name="org/apache/tomcat/dbcp" />
<!-- Remove authenticator classes -->
<exclude name="org/apache/catalina/authenticator/BasicAuthenticator*" />
<exclude name="org/apache/catalina/authenticator/DigestAuthenticator*" />
<exclude name="org/apache/catalina/authenticator/FormAuthenticator*" />
<exclude name="org/apache/catalina/authenticator/SingleSignOnE*" />
<exclude name="org/apache/catalina/authenticator/SingleSignOnL*" />
<exclude name="org/apache/catalina/authenticator/SingleSignOnS*" />
<exclude name="org/apache/catalina/authenticator/Spnego*" />
<exclude name="org/apache/catalina/authenticator/SSLAuthenticator*" />
<exclude name="org/apache/catalina/authenticator/jaspcic/Simple*" />
<!-- Remove optional filter classes -->
<exclude name="org/apache/catalina/filters/**" />
<!-- Remove Realm classes -->
<exclude name="org/apache/catalina/realm/AuthenticatedUserRealm.class" />
<exclude name="org/apache/catalina/realm/CombinedRealm.class" />
<exclude name="org/apache/catalina/realm/DataSourceRealm.class" />
<exclude name="org/apache/catalina/realm/JAASCallbackHandler.class" />
<exclude name="org/apache/catalina/realm/JAASMemoryLoginModule.class" />
<exclude name="org/apache/catalina/realm/JAASRealm.class" />
<exclude name="org/apache/catalina/realm/JDBCRealm.class" />
<exclude name="org/apache/catalina/realm/JNDIRealm$User.class" />
<exclude name="org/apache/catalina/realm/JNDIRealm.class" />
<exclude name="org/apache/catalina/realm/LockOutRealm*" />
<exclude name="org/apache/catalina/realm/MemoryRealm.class" />
<exclude name="org/apache/catalina/realm/NestedCredentialHandler.class" />
<exclude name="org/apache/catalina/realm/UserDatabaseRealm.class" />
<!-- Remove optional servlets -->
<exclude name="org/apache/catalina/servlets/**" />
<!-- Remove all but the standard session management -->
<exclude name="org/apache/catalina/session/JDBC*" />
<exclude name="org/apache/catalina/session/File*" />
<exclude name="org/apache/catalina/session/Persistent*" />
<exclude name="org/apache/catalina/session/StoreBase*" />
<!-- Remove users -->
<exclude name="org/apache/catalina/users/**" />
<!-- Remove optional valves -->
<exclude name="org/apache/catalina/valves/Crawler*" />
<exclude name="org/apache/catalina/valves/ExtendedAccessLogValve*" />
<exclude name="org/apache/catalina/valves/ExtendedAccessLogValve*" />
<exclude name="org/apache/catalina/valves/HealthCheckValve*" />
<exclude name="org/apache/catalina/valves/JDBCAccessLogValve*" />
<exclude name="org/apache/catalina/valves/LoadBalancerDrainingValve*" />
<exclude name="org/apache/catalina/valves/PersistentValve*" />
<!-- Remove most JNDI stuff -->
<exclude name="org/apache/naming/EjbRef*" />
<exclude name="org/apache/naming/factory/BeanFactory*" />
<exclude name="org/apache/naming/factory/DataSourceLinkFactory*" />
<exclude name="org/apache/naming/factory/EjbFactory*" />
<exclude name="org/apache/naming/factory/LookupFactory*" />
<exclude name="org/apache/naming/factory/MailSessionFactory*" />
<exclude name="org/apache/naming/factory/OpenEjbFactory*" />
<exclude name="org/apache/naming/factory/ResourceEnvFactory*" />
<exclude name="org/apache/naming/factory/ResourceFactory*" />
<exclude name="org/apache/naming/factory/ResourceLinkFactory*" />
<exclude name="org/apache/naming/factory/SendMailFactory*" />
<exclude name="org/apache/naming/factory/TransactionFactory*" />
<exclude name="org/apache/naming/factory/webservices/*" />
<exclude name="org/apache/naming/LookupRef*" />
<exclude name="org/apache/naming/NameParserImpl*" />
<exclude name="org/apache/naming/NamingContextBindingsEnumeration*" />
<exclude name="org/apache/naming/NamingContext*" />
<exclude name="org/apache/naming/NamingContextEnumeration*" />
<exclude name="org/apache/naming/NamingEntry*" />
<exclude name="org/apache/naming/ResourceEnvRef*" />
<exclude name="org/apache/naming/ResourceLinkRef*" />
<exclude name="org/apache/naming/ResourceRef*" />
<exclude name="org/apache/naming/SelectorContext*" />
<exclude name="org/apache/naming/ServiceRef*" />
<exclude name="org/apache/naming/TransactionRef*" />
<!-- remove BCEL support -->
<exclude name="org/apache/tomcat/util/bcel/**" />
<!-- remove web descriptor elements -->
<exclude name="org/apache/tomcat/util/descriptor/DigesterFactory*" />
<exclude name="org/apache/tomcat/util/descriptor/InputSourceUtil*" />
<exclude name="org/apache/tomcat/util/descriptor/LocalResolver*" />
<exclude name="org/apache/tomcat/util/descriptor/web/AbsoluteOrderingRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/CallMethodMultiRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/CallParamMultiRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/ContextHandler*" />
<exclude name="org/apache/tomcat/util/descriptor/web/ContextResourceLink*" />
<exclude name="org/apache/tomcat/util/descriptor/web/ContextTransaction*" />
<exclude name="org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback*" />
<exclude name="org/apache/tomcat/util/descriptor/web/IgnoreAnnotationsRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/InjectionTarget*" />
<exclude name="org/apache/tomcat/util/descriptor/web/JspConfigDescriptorImpl*" />
<exclude name="org/apache/tomcat/util/descriptor/web/JspPropertyGroup*" />
<exclude name="org/apache/tomcat/util/descriptor/web/JspPropertyGroupDescriptorImpl*" />
<exclude name="org/apache/tomcat/util/descriptor/web/LifecycleCallbackRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/MappedNameRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/MultipartDef*" />
<exclude name="org/apache/tomcat/util/descriptor/web/NameRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/RelativeOrderingRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SecurityCollection*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SecurityRoleRef*" />
<exclude name="org/apache/tomcat/util/descriptor/web/ServiceQnameRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/ServletDef*" />
<exclude name="org/apache/tomcat/util/descriptor/web/ServletDefCreateRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SessionConfig*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetAuthConstraintRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetDenyUncoveredHttpMethodsRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetDistributableRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetJspConfig*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetLoginConfig*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetOverrideRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetPublicIdRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SetSessionConfig*" />
<exclude name="org/apache/tomcat/util/descriptor/web/SoapHeaderRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/TaglibDescriptorImpl*" />
<exclude name="org/apache/tomcat/util/descriptor/web/TaglibLocationRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/VersionRule*" />
<exclude name="org/apache/tomcat/util/descriptor/web/WebXml*" />
<exclude name="org/apache/tomcat/util/descriptor/web/WebXmlParser*" />
<exclude name="org/apache/tomcat/util/descriptor/XmlErrorHandler*" />
<exclude name="org/apache/tomcat/util/descriptor/XmlIdentifiers*" />
<!-- remove taglibrary support -->
<exclude name="org/apache/tomcat/util/descriptor/tagplugin/**"/>
<exclude name="org/apache/tomcat/util/descriptor/tld/**"/>
<!-- Remove Digester Support -->
<exclude name="org/apache/tomcat/util/digester/**"/>
<!-- TODO - For now, remove SSL until we have an example -->
<exclude name="org/apache/tomcat/util/net/jsse/**"/>
<exclude name="org/apache/tomcat/util/net/openssl/**"/>
<!-- Remove without-reflection code generator -->
<exclude name="org/apache/tomcat/util/xreflection/**" />
<!-- Remove DefaultServlet -->
<exclude name="org/apache/catalina/servlets/DefaultServlet*.*" />
</patternset>
<patternset id="files.catalina-tribes">
<include name="org/apache/catalina/tribes/**" />
</patternset>
<patternset id="files.catalina-ssi">
<include name="org/apache/catalina/ssi/**" />
</patternset>
<patternset id="files.catalina-ha">
<include name="org/apache/catalina/ha/**" />
</patternset>
<patternset id="files.catalina-ant">
<include name="org/apache/catalina/ant/**" />
</patternset>
<patternset id="files.catalina-storeconfig">
<include name="org/apache/catalina/storeconfig/**" />
</patternset>
<patternset id="files.tomcat-jni">
<include name="org/apache/tomcat/jni/**" />
</patternset>
<patternset id="files.tomcat-coyote">
<include name="org/apache/coyote/**" />
<!-- Remaining tomcat-util packages -->
<include name="org/apache/tomcat/util/bcel/**" />
<include name="org/apache/tomcat/util/http/**" />
<include name="org/apache/tomcat/util/log/**" />
<include name="org/apache/tomcat/util/modeler/**" />
<include name="org/apache/tomcat/util/net/**" />
</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.catalina" />
<patternset refid="files.servlet-api" />
<patternset refid="files.jaspic-api" />
<patternset refid="files.tomcat-api" />
<patternset refid="files.tomcat-juli" />
<!-- These pattern sets conflict so include files directly
<patternset refid="files.tomcat-coyote" />
<patternset refid="files.tomcat-util" />
<patternset refid="files.tomcat-util-scan" />
-->
<include name="org/apache/coyote/**" />
<include name="org/apache/tomcat/jni/**" />
<include name="org/apache/jk/**" />
<include name="org/apache/tomcat/util/**" />
<exclude name="org/apache/tomcat/util/descriptor/tld/**" />
</patternset>
<patternset id="files.tomcat-embed-jasper" >
<patternset refid="files.jasper" />
<patternset refid="files.jsp-api" />
<include name="org/apache/tomcat/util/descriptor/tld/**" />
</patternset>
<patternset id="files.tomcat-embed-el" >
<patternset refid="files.el-api" />
<patternset refid="files.jasper-el" />
</patternset>
<patternset id="files.tomcat-embed-websocket" >
<patternset refid="files.websocket-api" />
<patternset refid="files.tomcat-websocket" />
</patternset>
<!-- 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" />-->
<!-- Annotations API is a separate dependency to avoid JRE 9 issues -->
<!-- See BZ 61439 -->
<!--<patternset refid="files.annotations-api" />-->
<!-- =========================== Build targets =========================== -->
<!-- Output the merged properties for the current Ant environment -->
<target name="echoproperties">
<echoproperties/>
</target>
<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="${user.home}/build.properties" />
<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"/>
<available property="checkstyletask.properties" resource="checkstyletask.properties"
classpath="${checkstyle.jar}" value="checkstyletask.properties"/>
<available property="checkstyletask.properties" resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
classpath="${checkstyle.jar}" value="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"/>
<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="nbproject/**"/>
<exclude name="output/**"/>
<exclude name="modules/**"/>
<exclude name="**/*.mdl"/>
<exclude name="**/*.pem"/>
<exclude name="**/*.svg"/>
<exclude name="**/*_2.xml"/>
<exclude name="res/checkstyle/header-al2.txt"/>
<!-- Exclude auto-generated files -->
<exclude name="java/org/apache/el/parser/ELParser.jj" />
<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 name="java/org/apache/tomcat/util/json/*.java" />
<!-- Exclude simple test files -->
<exclude name="test/webapp/bug53257/**/*.txt"/>
<exclude name="test/webapp/bug49nnn/bug49464*"/>
<exclude name="test/webapp-fragments/WEB-INF/classes/*.txt"/>
<exclude name="test/webresources/**"/>
<!-- Exclude test files with unusual encodings -->
<exclude name="test/webapp/jsp/encoding/**"/>
<!-- Exclude developer specific local files -->
<exclude name="build.properties" />
<exclude name="res/maven/mvn.properties" />
</fileset>
<fileset dir="modules/jdbc-pool" >
<exclude name=".*/**"/>
<exclude name="**/MANIFEST.MF"/>
<patternset refid="text.files" />
<!-- Exclude developer specific local files -->
<exclude name="build.properties" />
</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}"
release="${compile.release}"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<!-- Uncomment this to show unchecked warnings:
<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 mode="LF">
<fileset dir="." >
<patternset refid="text.files" />
<include name="**/*.bat"/>
<include name="**/*.sh"/>
<exclude name=".*/**"/>
<exclude name="nbproject/**"/>
<exclude name="output/**"/>
<exclude name="modules/**"/>
<!-- Exclude these since some svn clients do not seem able to handle
UTF-16 line-ending conversion -->
<exclude name="test/webapp/jsp/encoding/bom-utf16*"/>
<exclude name="test/webapp/jsp/encoding/bom-none-prolog-utf16*"/>
</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="UTF-8">
<filterset>
<filter token="TOMCAT_PROJECT_DEST" value="project.xml"/>
</filterset>
</copy>
</target>
<target name="compile" depends="download-compile,validate">
<!-- Compile internal server components -->
<javac srcdir="java" destdir="${tomcat.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<!-- Uncomment this to show unchecked warnings:
<compilerarg value="-Xlint:unchecked"/>
-->
<compilerarg value="-XDignore.symbol.file"/>
<classpath refid="compile.classpath" />
</javac>
<!-- Copy static resource files -->
<copy todir="${tomcat.classes}" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir="java">
<include name="**/*.properties"/>
<exclude name="**/LocalStrings*.properties"/>
<exclude name="**/Messages*.properties"/>
<include name="**/*.dtd"/>
<include name="**/*.tasks"/>
<include name="**/*.xsd"/>
<include name="**/*.xml"/>
</fileset>
</copy>
<!-- Convert the message files from UTF-8 to ASCII. This can be removed
after upgrading to Java 9+ as the minimum JRE and specifying the encoding
when loading the ResourceBundles -->
<native2ascii src="java" dest="${tomcat.classes}" includes="**/LocalStrings.properties,**/Messages*.properties" encoding="UTF-8"/>
<native2ascii src="java" dest="${tomcat.i18n}" includes="**/LocalStrings_*.properties" encoding="UTF-8"/>
</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}"/>
<filter token="jaspic.revision" value="${jaspic.revision}"/>
<filter token="annotation.revision" value="${annotation.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" >
<!--
#### ORDER IS IMPORTANT ####
Bnd will use the built jars to resolve import package versions and
JPMS module names.
-->
<!-- Common Annotations JAR File -->
<jarIt jarfile="${annotations-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.annotations-api"
manifest="${tomcat.manifests}/annotations-api.jar.manifest"
addOSGi="true" />
<!-- Servlet 4.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"
addOSGi="true" />
<!-- EL Implementation JAR File -->
<jarIt jarfile="${el-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.el-api"
manifest="${tomcat.manifests}/el-api.jar.manifest"
addOSGi="true" />
<!-- JSP Implementation JAR File -->
<jarIt jarfile="${jsp-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.jsp-api"
manifest="${tomcat.manifests}/jsp-api.jar.manifest"
addOSGi="true" />
<!-- WebSocket API JAR File -->
<jarIt jarfile="${websocket-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.websocket-api"
manifest="${tomcat.manifests}/websocket-api.jar.manifest"
addOSGi="true" />
<!-- JASPIC 1.1 API JAR File -->
<jarIt jarfile="${jaspic-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.jaspic-api"
manifest="${tomcat.manifests}/jaspic-api.jar.manifest"
addOSGi="true" />
<!-- Tomcat-juli JAR File -->
<jarIt jarfile="${tomcat-juli.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-juli"
addOSGi="true" />
<!-- Bootstrap JAR File -->
<jarIt jarfile="${bootstrap.jar}"
filesDir="${tomcat.classes}"
filesId="files.bootstrap"
manifest="${tomcat.manifests}/bootstrap.jar.manifest" />
<!-- Tomcat Util JAR File -->
<jarIt jarfile="${tomcat-util.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-util"
addOSGi="true" />
<!-- Tomcat API JAR File -->
<jarIt jarfile="${tomcat-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-api"
addOSGi="true" />
<!-- Tomcat Util Scan JAR File -->
<jarIt jarfile="${tomcat-util-scan.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-util-scan"
addOSGi="true" />
<jarIt jarfile="${tomcat-jni.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-jni"
addOSGi="true" />
<!-- Protocol handlers - Coyote -->
<jarIt jarfile="${tomcat-coyote.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-coyote"
addOSGi="true" />
<!-- WebSocket implementation JAR File -->
<jarIt jarfile="${tomcat-websocket.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-websocket"
meta-inf="${tomcat.manifests}/tomcat-websocket.jar"
addOSGi="true" />
<!-- Catalina GroupCom/Tribes JAR File -->
<jarIt jarfile="${catalina-tribes.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-tribes"
addOSGi="true" />
<!-- Catalina Main JAR File -->
<jarIt jarfile="${catalina.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina"
addOSGi="true" />
<!-- Catalina Cluster/HA JAR File -->
<jarIt jarfile="${catalina-ha.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-ha"
addOSGi="true" />
<!-- Server-Side Includes (SSI) -->
<jarIt jarfile="${catalina-ssi.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-ssi"
addOSGi="true" />
<!-- Catalina Ant Tasks JAR File -->
<jarIt jarfile="${catalina-ant.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-ant" />
<!-- Catalina Storeconfig JAR File -->
<jarIt jarfile="${catalina-storeconfig.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-storeconfig"
addOSGi="true" />
<!-- Jasper EL Implementation JAR File -->
<jarIt jarfile="${jasper-el.jar}"
filesDir="${tomcat.classes}"
filesId="files.jasper-el"
meta-inf="${tomcat.manifests}/jasper-el.jar"
addOSGi="true" />
<!-- Jasper Implementation JAR File -->
<jarIt jarfile="${jasper.jar}"
filesDir="${tomcat.classes}"
filesId="files.jasper"
meta-inf="${tomcat.manifests}/jasper.jar"
addOSGi="true" />
<!-- Re-packaged Apache Commons DBCP 2-->
<jarIt jarfile="${tomcat-dbcp.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-dbcp"
addOSGi="true" />
<!-- i18n JARs -->
<jar jarfile="${tomcat.build}/lib/tomcat-i18n-cs.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<include name="**/LocalStrings_cs.properties" />
</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.build}/lib/tomcat-i18n-de.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<include name="**/LocalStrings_de.properties" />
</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.build}/lib/tomcat-i18n-es.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<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" />
</jar>
<jar jarfile="${tomcat.build}/lib/tomcat-i18n-fr.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<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" />
</jar>
<jar jarfile="${tomcat.build}/lib/tomcat-i18n-ja.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<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" />
</jar>
<jar jarfile="${tomcat.build}/lib/tomcat-i18n-ko.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<include name="**/LocalStrings_ko.properties" />
</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.build}/lib/tomcat-i18n-pt-BR.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<include name="**/LocalStrings_pt_BR.properties" />
</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.build}/lib/tomcat-i18n-ru.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<include name="**/LocalStrings_ru.properties" />
</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.build}/lib/tomcat-i18n-zh-CN.jar"
manifest="${tomcat.manifests}/default.manifest">
<fileset dir="${tomcat.i18n}">
<include name="**/LocalStrings_zh_CN.properties" />
</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="build-docs" depends="compile-prepare" description="Builds all documentation from XML sources">
<!-- Validation of changelog.xml -->
<xmlvalidate
file="webapps/docs/changelog.xml"
/>
<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="UTF-8">
<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/mbeans-descriptors.dtd"
file="java/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd" />
<copy tofile="${tomcat.build}/webapps/docs/appdev/sample/build.xml"
file="webapps/docs/appdev/build.xml.txt"/>
<!-- 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="build-date-iso-8601" expression="${today-iso-8601}"/>
<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="build-date-iso-8601" expression="${today-iso-8601}"/>
<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="build-date-iso-8601" expression="${today-iso-8601}"/>
<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="build-date-iso-8601" expression="${today-iso-8601}"/>
<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="build-date-iso-8601" expression="${today-iso-8601}"/>
<param name="year" expression="${year}"/>
</xslt>
</target>
<target name="deploy" depends="package,build-docs,build-tomcat-jdbc,compile-webapp-examples"
description="Default. Builds a working Tomcat instance">
<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="**/*.xsd"/>
<include name="**/*.properties"/>
</fileset>
</copy>
<!-- 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="UTF-8">
<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>
<!-- Delete all other versions of Eclipse JDT Compiler and copy the current one -->
<local name="jdt.jar.filename" />
<basename property="jdt.jar.filename" file="${jdt.jar}"/>
<delete verbose="true">
<fileset dir="${tomcat.build}/lib">
<include name="ecj-*.jar"/>
<exclude name="${jdt.jar.filename}"/>
</fileset>
</delete>
<copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
<!-- Add sources for examples -->
<antcall target="examples-sources" />
</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}"
release="${compile.release}"
classpath="${tomcat.classes}"
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}"
release="${compile.release}"
classpath="${tomcat.classes}"
encoding="ISO-8859-1"
includeantruntime="false">
</javac>
<!-- Convert the message files of the examples webapp from UTF-8 to ASCII.
This can be removed after upgrading to Java 9+ as the minimum JRE and
specifying the encoding when loading the ResourceBundles -->
<native2ascii src="webapps/examples/WEB-INF/classes"
dest="${tomcat.build}/webapps/examples/WEB-INF/classes"
includes="**/LocalStrings*.properties"
encoding="UTF-8"/>
</target>
<target name="build-tomcat-jdbc" depends="package">
<!-- 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"/>
<property name="version" value="${version}"/>
<property name="version.major" value="${version.major}"/>
<property name="version.major.minor" value="${version.major.minor}"/>
</ant>
<copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
</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"/>
</fileset>
</txt2html>
</target>
<target name="embed-jars" description="Create experimental embedded jars"
depends="build-manifests,setup-bnd,compile,package" >
<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}" />
<copy file="${annotations-api.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"
addOSGi="true"
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-core"
graalFiles="res/graal/tomcat-embed-core/native-image"
libs="embed/*.jar"/>
<jarIt jarfile="${tomcat-embed-el.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-el"
addOSGi="true"
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-el"
graalFiles="res/graal/tomcat-embed-el/native-image"
libs="embed/*.jar"/>
<jarIt jarfile="${tomcat-embed-jasper.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-jasper"
meta-inf="${tomcat.manifests}/jasper.jar"
addOSGi="true"
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-jasper"
graalFiles="res/graal/tomcat-embed-jasper/native-image"
libs="embed/*.jar"/>
<jarIt jarfile="${tomcat-embed-websocket.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-websocket"
meta-inf="${tomcat.manifests}/tomcat-websocket.jar"
addOSGi="true"
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-websocket"
graalFiles="res/graal/tomcat-embed-websocket/native-image"
libs="embed/*.jar"/>
</target>
<target name="embed-sources"
description="Create source jars for embedded jars"
depends="build-manifests,package-src-jar" >
<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-el-sources.jar}"
filesDir="java"
filesId="files.tomcat-embed-el"/>
<jarIt jarfile="${tomcat-embed-jasper-sources.jar}"
filesDir="java"
filesId="files.tomcat-embed-jasper"/>
<jarIt jarfile="${tomcat-embed-websocket-sources.jar}"
filesDir="java"
filesId="files.tomcat-embed-websocket"/>
<copy file="${tomcat-dbcp-src.jar}" todir="${tomcat.embed.sources}" />
<!--No sources for ${jdt.jar} -->
</target>
<target name="embed-programmatic-jar" description="Create non reflection embedded jar"
depends="embed-jars,embed-sources">
<!-- temporary directory to store the generated code -->
<tempfile property="xreflect.directory" destDir="${java.io.tmpdir}" prefix="apache-tomcat-xreflect-"/>
<echo>Generating Reflection Less Introspection to: ${xreflect.directory}</echo>
<mkdir dir="${xreflect.directory}"/>
<copy todir="${xreflect.directory}/sources">
<fileset dir="java"/>
</copy>
<copy todir="${xreflect.directory}/classes">
<fileset dir="${tomcat.classes}"/>
</copy>
<!-- Generate the reflection less XReflectionIntrospectionUtils .java file -->
<java classname="org.apache.tomcat.util.xreflection.ObjectReflectionPropertyInspector"
classpath="${xreflect.directory}/classes">
<arg value="${xreflect.directory}/sources"/>
</java>
<!-- Compile the generated XReflectionIntrospectionUtils.java class -->
<delete file="${xreflect.directory}/classes/org/apache/tomcat/util/XReflectionIntrospectionUtils.class"/>
<javac includes="org/apache/tomcat/util/XReflectionIntrospectionUtils.java"
srcdir="${xreflect.directory}/sources"
destdir="${xreflect.directory}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
encoding="ISO-8859-1"
includeAntRuntime="true" >
<compilerarg value="-XDignore.symbol.file"/>
<classpath refid="compile.classpath" />
</javac>
<!-- Create the binary JAR file -->
<jarIt jarfile="${tomcat-embed-programmatic.jar}"
filesDir="${xreflect.directory}/classes"
filesId="files.tomcat-embed-programmatic"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"
addOSGi="false"
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-programmatic"
graalFiles="res/graal/tomcat-embed-programmatic/native-image"
libs="embed/*.jar"/>
<!-- Create the source JAR file -->
<jarIt jarfile="${tomcat-embed-programmatic-sources.jar}"
filesDir="${xreflect.directory}/sources"
filesId="files.tomcat-embed-programmatic"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"/>
<!-- Leave generated code in an easy place for review -->
<copy todir="${tomcat.xreflect}"
file="${xreflect.directory}/sources/org/apache/tomcat/util/XReflectionIntrospectionUtils.java"
overwrite="true"/>
<!-- Delete our temporary compilation directory -->
<delete dir="${xreflect.directory}"/>
</target>
<target name="embed"
description="Creates the experimental embedded release"
depends="embed-jars,embed-sources,embed-programmatic-jar" >
<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="*.asc" />
<exclude name="*.sha512" />
<exclude name="*.zip" />
<exclude name="*.tar.gz" />
</fileset>
</zip>
<hashAndSign file="${tomcat.embed}/${final.name}-embed.zip" />
<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="*.asc" />
<exclude name="*.sha512" />
<exclude name="*.zip" />
<exclude name="*.tar.gz" />
</tarfileset>
</tar>
<hashAndSign file="${tomcat.embed}/${final.name}-embed.tar.gz" />
</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}"
release="${compile.release}"
encoding="ISO-8859-1"
includeantruntime="true">
<classpath refid="tomcat.test.classpath" />
<include name="org/apache/**" />
<include name="javax/**" />
<include name="util/**" />
<!-- Exclude these by default as Gump can't run them because the -->
<!-- classes on which they depend are not in any output JAR. -->
<exclude name="org/apache/tomcat/buildutil/**"/>
</javac>
<copy todir="${test.classes}">
<fileset dir="test">
<include name="META-INF/**"/>
<include name="**/service-config.txt"/>
<include name="**/logging-non-rotatable.properties"/>
</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-nio,test-nio2,test-apr,cobertura-report,test-status" />
<target name="test-only" description="Runs the JUnit test cases without additional processing"
depends="test-only-nio,test-only-nio2,test-only-apr,test-status" />
<target name="test-status"
description="Analyses logs directory and reports on skipped tests, test failures and test errors">
<fileset id="test.result.skippedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Skipped: 0" />
</not>
</fileset>
<fileset id="test.result.failedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Failures: 0, Errors: 0" />
</not>
</fileset>
<concat>
<header>Testsuites with skipped tests:${line.separator}</header>
<string>${toString:test.result.skippedtests}</string>
<filterchain>
<tokenfilter delimOutput="${line.separator}">
<stringtokenizer delims=";"/>
</tokenfilter>
</filterchain>
</concat>
<concat>
<header>Testsuites with failed tests:${line.separator}</header>
<string>${toString:test.result.failedtests}</string>
<filterchain>
<tokenfilter delimOutput="${line.separator}">
<stringtokenizer delims=";"/>
</tokenfilter>
</filterchain>
</concat>
<fail if="test.result.error" message='Some tests completed with an Error. See ${tomcat.build}/logs for details, search for "ERROR".' />
<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-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
depends="test-compile,deploy,cobertura-instrument,test-openssl-exists" if="${execute.test.nio}">
<runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
extension=".NIO" />
</target>
<target name="test-only-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
depends="cobertura-disabled,test-openssl-exists" if="${execute.test.nio}">
<runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
extension=".NIO" />
</target>
<target name="test-nio2" description="Runs the JUnit test cases for NIO2. Does not stop on errors."
depends="test-compile,deploy,cobertura-instrument,test-openssl-exists" if="${execute.test.nio2}">
<runtests protocol="org.apache.coyote.http11.Http11Nio2Protocol"
extension=".NIO2" />
</target>
<target name="test-only-nio2" description="Runs the JUnit test cases for NIO2. Does not stop on errors."
depends="cobertura-disabled,test-openssl-exists" if="${execute.test.nio2}">
<runtests protocol="org.apache.coyote.http11.Http11Nio2Protocol"
extension=".NIO2" />
</target>
<target name="test-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
depends="test-compile,deploy,test-apr-exists,cobertura-instrument,test-openssl-exists"
if="${apr.exists}">
<runtests protocol="org.apache.coyote.http11.Http11AprProtocol"
extension=".APR" />
</target>
<target name="test-only-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
depends="cobertura-disabled,test-openssl-exists" if="${execute.test.apr}">
<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-openssl-exists" description="Checks for the OpenSSL binary">
<property environment="env" />
<condition property="test.openssl.exists">
<or>
<and>
<length string="${test.openssl.path}" trim="true" length="0" when="gt"/>
<available file="${test.openssl.path}" property="test.openssl.exists"/>
</and>
<and>
<length string="${test.openssl.path}" trim="true" length="0" when="eq"/>
<available file="openssl" filepath="${env.PATH}" property="test.openssl.exists"/>
</and>
</or>
</condition>
</target>
<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="${test.verbose}"
errorproperty="test.result.error"
failureproperty="test.result.failure"
haltonfailure="${test.haltonfailure}"
threads="${test.threads}">
<jvmarg value="${test.jvmarg.egd}"/>
<jvmarg value="-Dfile.encoding=UTF-8"/>
<jvmarg value="-Djava.library.path=${test.apr.loc}"/>
<jvmarg value="${test.formatter}"/>
<jvmarg value="-Djava.net.preferIPv4Stack=${java.net.preferIPv4Stack}"/>
<jvmarg value="-Dorg.apache.tomcat.util.net.NioSelectorShared=${org.apache.tomcat.util.net.NioSelectorShared}"/>
<!-- Java 9 -->
<jvmarg value="${java9.test.option.1}"/>
<jvmarg value="${java9.test.option.2}"/>
<jvmarg value="${java9.test.option.3}"/>
<jvmarg value="${java9.test.option.4}"/>
<jvmarg value="${java9.test.option.5}"/>
<classpath refid="tomcat.test.run.classpath" />
<sysproperty key="tomcat.test.temp" value="${test.temp}" />
<sysproperty key="tomcat.test.basedir" value="${test.basedir}" />
<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}" />
<sysproperty key="tomcat.test.openssl.path" value="${test.openssl.path}" />
<sysproperty key="tomcat.test.openssl.unimplemented" value="${test.openssl.unimplemented}" />
<sysproperty key="tomcat.test.relaxTiming" value="${test.relaxTiming}" />
<sysproperty key="tomcat.test.sslImplementation" value="${test.sslImplementation}" />
<sysproperty key="tomcat.test.http2.loopCount" value="${test.http2.loopCount}" />
<!-- 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">
<!-- Include all by default -->
<fileset dir="test" includes="${test.name}" excludes="${test.exclude}">
<!-- Exclude helper classes -->
<exclude name="**/Tester*.java" />
<!-- Exclude the tests known to fail -->
<exclude name="org/apache/catalina/tribes/test/**" />
<!-- Exclude the OpenSSL tests unless OpenSSL is available -->
<exclude name="org/apache/tomcat/util/net/openssl/ciphers/**" unless="${test.openssl.exists}" />
<!-- Exclude performance tests. E.g. on systems with slow/inconsistent timing -->
<exclude name="**/*Performance.java" if="${test.excludePerformance}" />
<!-- Exclude tests that Gump can't compile -->
<exclude name="org/apache/tomcat/buildutil/**" />
<!--
Avoid running tests which require the SecurityManager with other
tests. See below for more details.
-->
<exclude name="**/*SecurityManager.java" />
</fileset>
</batchtest>
<!--
Run tests which require the SecurityManager in their own forked
batch to ensure that global/system security settings don't pollute
other tests. See SecurityManagerBaseTest.java for more details.
-->
<batchtest todir="${test.reports}" unless="test.entry" fork="true">
<fileset dir="test" includes="**/SecurityManager.java" excludes="${test.exclude}" />
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="cobertura-init">
<condition property="cobertura.enabled" value="true">
<and>
<istrue value="${test.cobertura}"/>
<equals arg1="1" arg2="${test.threads}"/>
</and>
</condition>
<condition property="cobertura.disabled" value="true">
<and>
<istrue value="${test.cobertura}"/>
<not>
<equals arg1="1" arg2="${test.threads}"/>
</not>
</and>
</condition>
</target>
<target name="cobertura-disabled" unless="${cobertura.enabled}"
depends="cobertura-init">
<!-- 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-disabled-log" if="${cobertura.disabled}"
depends="cobertura-init">
<echo message="Code coverage disabled because test.threads is greater than 1"/>
</target>
<target name="cobertura-instrument"
depends="compile,download-cobertura,cobertura-disabled,cobertura-disabled-log"
if="${cobertura.enabled}"
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>
<pathelement path="res/cobertura"/>
</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="${cobertura.enabled}"
depends="test-nio,test-nio2,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="findbugs"
if="${execute.findbugs}"
depends="compile,download-findbugs">
<path id="findbugs.classpath">
<fileset file="${findbugs.jar}" />
</path>
<taskdef classpathref="findbugs.classpath" name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
<mkdir dir="${findbugs.out}" />
<findbugs home="${findbugs.home}"
output="${findbugs.report.format}"
outputFile="${findbugs.out}/findbugs-report.${findbugs.report.format}"
reportLevel="${findbugs.report.level}"
excludeFilter="res/findbugs/filter-false-positives.xml" >
<sourcePath path="${basedir}/java" />
<class location="${tomcat.classes}" />
<class location="${test.classes}" />
<auxClasspath>
<fileset file="${jdt.jar}" />
<fileset file="${ant.core.lib}" />
</auxClasspath>
</findbugs>
</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, embed">
<!-- Copy the top-level documentation files -->
<copy todir="${tomcat.dist}" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
<fileset dir=".">
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="README.md"/>
<include name="BUILDING.txt" />
<include name="CONTRIBUTING.md"/>
</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" />
<!-- tc native -->
<copy todir="${tomcat.dist}/bin">
<fileset dir="${tomcat-native.home}/bin">
<include name="*.dll"/>
<include name="**/*.dll"/>
</fileset>
</copy>
<!-- Source bundles for native components -->
<copy tofile="${tomcat.dist}/bin/tomcat-native.tar.gz"
file="${tomcat-native.tar.gz}" />
<copy tofile="${tomcat.dist}/bin/commons-daemon-native.tar.gz"
file="${commons-daemon.native.src.tgz}" />
<!-- platform README files -->
<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,download-compile"
description="Create the Tomcat javadoc" >
<javadoc packagenames="javax.annotation.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/annotationapi"
version="true"
windowtitle="Common Annotations 1.3 API Documentation - Apache Tomcat ${version}"
doctitle="Common Annotations 1.3 API - Apache Tomcat ${version}"
header="&lt;b&gt;Common Annotations 1.3 - Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
source="${compile.source}"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
</javadoc>
<javadoc packagenames="javax.servlet.*"
excludepackagenames="javax.servlet.jsp.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/servletapi"
version="true"
windowtitle="Servlet 4.0 API Documentation - Apache Tomcat ${version}"
doctitle="Servlet 4.0 API - Apache Tomcat ${version}"
header="&lt;b&gt;Servlet 4.0 - Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
source="${compile.source}"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.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.3 API Documentation - Apache Tomcat ${version}"
doctitle="JSP 2.3 API - Apache Tomcat ${version}"
header="&lt;b&gt;JSP 2.3 - Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
source="${compile.source}"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.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 3.0 API Documentation - Apache Tomcat ${version}"
doctitle="EL 3.0 API - Apache Tomcat ${version}"
header="&lt;b&gt;EL 3.0 - Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
source="${compile.source}"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.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.1 API Documentation - Apache Tomcat ${version}"
doctitle="WebSocket 1.1 API - Apache Tomcat ${version}"
header="&lt;b&gt;WebSocket 1.1 - Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
source="${compile.source}"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.classpath"/>
<path location="${ant.core.lib}"/>
</classpath>
</javadoc>
<javadoc packagenames="javax.security.auth.message.*"
sourcepath="${tomcat.dist}/src/java"
destdir="${tomcat.dist}/webapps/docs/jaspicapi"
version="true"
windowtitle="JASPIC 1.1 API Documentation - Apache Tomcat ${version}"
doctitle="JASPIC 1.1 API - Apache Tomcat ${version}"
header="&lt;b&gt;JASPIC 1.1 - Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.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="&lt;b&gt;Apache Tomcat ${version}&lt;/b&gt;"
bottom="Copyright &amp;#169; 2000-${year} Apache Software Foundation. All Rights Reserved."
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
source="${compile.source}"
maxmemory="512m"
failonerror="true"
failonwarning="true">
<classpath>
<path refid="compile.classpath"/>
<path location="${ant.core.lib}"/>
<path location="${osgi-annotations.jar}"/>
</classpath>
<link href="../annotationapi"/>
<link href="../servletapi"/>
<link href="../jspapi"/>
<link href="../elapi"/>
<link href="../websocketapi"/>
<link href="../jaspicapi"/>
<link href="https://docs.oracle.com/javase/8/docs/api/"/>
<link href="https://javaee.github.io/javaee-spec/javadocs/"/>
<packageset dir="${tomcat.dist}/src/java/">
<include name="org/**"/>
<exclude name="org/apache/el/parser/**"/>
<exclude name="org/apache/tomcat/util/json/**"/>
</packageset>
<!--jdbc-pool src files for javadoc-->
<packageset dir="${tomcat.dist}/src/modules/jdbc-pool/src/main/java"/>
</javadoc>
</target>
<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="jaspic-api.jar"/>
<include name="servlet-api.jar"/>
<include name="websocket-api.jar"/>
<include name="tomcat-websocket.jar"/>
<include name="tomcat-coyote.jar"/>
<include name="tomcat-util.jar"/>
<include name="tomcat-util-scan.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">
<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="org/apache/tomcat/util/bcel" />
<exclude name="org/apache/tomcat/util/buf" />
<exclude name="org/apache/tomcat/util/codec" />
<exclude name="org/apache/tomcat/util/collections" />
<exclude name="org/apache/tomcat/util/compat" />
<exclude name="org/apache/tomcat/util/descriptor" />
<exclude name="org/apache/tomcat/util/file" />
<exclude name="org/apache/tomcat/util/http" />
<exclude name="org/apache/tomcat/util/log" />
<exclude name="org/apache/tomcat/util/modeler" />
<exclude name="org/apache/tomcat/util/net" />
<exclude name="org/apache/tomcat/util/res" />
<exclude name="org/apache/tomcat/util/scan" />
<exclude name="org/apache/tomcat/util/security" />
<exclude name="org/apache/tomcat/util/threads" />
<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.svg" />
<include name="images/tomcat.png" />
<include name="images/docs-stylesheet.css" />
</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="**/nbproject/**"/>
<filename name="**/output/**"/>
<!-- Commented out, because
test/webapp-virtual-library and
test/webapp-virtual-webapp use it:
<filename name="**/target/**"/>
-->
<filename name="**/build.properties"/>
<filename name="**/mvn.properties"/>
<and>
<!-- Don't exclude the ide support sample files for idea -->
<filename name="**/*.iml" />
<not>
<filename name="res/ide-support/idea/**" />
</not>
</and>
<filename name="**/*.asc" />
<filename name="**/*.tmp" />
<filename name="**/maven-resolver-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="java/org/apache/el/parser/ELParser.jj" />
<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-pre-init">
<property environment="env" />
<condition property="wine.ok">
<or>
<os family="windows" />
<available file="wine" filepath="${env.PATH}" />
<isset property="skip.installer"/>
</or>
</condition>
</target>
<target name="-installer-init" depends="-installer-pre-init" unless="${wine.ok}">
<fail message="The executable wine was not found on the current path.
Wine is required to build the Windows installer when running a release build on
a non-Windows platform. To skip building the Windows installer, set the
skip.installer property in build.properties" />
</target>
<target name="-installer-prep"
unless="skip.installer" depends="dist-static,-installer-init">
<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="${nsis.system.dll}" todir="${tomcat.dist}" />
<copy file="${nsis.nsdialogs.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>
</target>
<target name="-installer-create-tempinstaller"
unless="skip.installer" depends="-installer-prep">
<exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
<arg value="/DUNINSTALLONLY" />
<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="/DUNINSTALLONLY" />
<arg value="/DNSISDIR=${nsis.home}" />
<arg value="/V2" />
<arg value="tomcat.nsi" />
</exec>
</target>
<target name="-installer-create-uninstaller"
unless="skip.installer" depends="-installer-create-tempinstaller">
<!-- Execute the temporary installer to create the uninstaller -->
<exec dir="${tomcat.dist}" executable="${tomcat.dist}/tempinstaller.exe"
osfamily="windows" />
<exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
<arg value="${tomcat.dist}/tempinstaller.exe" />
</exec>
</target>
<target name="-installer-sign-uninstaller"
unless="skip.installer" depends="-installer-create-uninstaller"
if="${do.codesigning}">
<exec executable="${codesigning.exec}" failonerror="true">
<arg value="sign"/>
<arg value="/sha1"/>
<arg value="${codesigning.certificate.thumbprint}"/>
<arg value="/fd"/>
<arg value="sha512"/>
<arg value="/tr"/>
<arg value="http://timestamp.digicert.com"/>
<arg value="${tomcat.dist}/Uninstall.exe"/>
</exec>
</target>
<target name="-installer" unless="skip.installer"
depends="-installer-sign-uninstaller">
<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" />
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
</target>
<target name="installer-sign"
description="Builds and optionally signs the Windows installer"
depends="-installer" if="${do.codesigning}" >
<exec executable="${codesigning.exec}" failonerror="true">
<arg value="sign"/>
<arg value="/sha1"/>
<arg value="${codesigning.certificate.thumbprint}"/>
<arg value="/fd"/>
<arg value="sha512"/>
<arg value="/tr"/>
<arg value="http://timestamp.digicert.com"/>
<arg value="${tomcat.release}/v${version}/bin/${final.name}.exe"/>
</exec>
<!-- .exe has changed so need to redo checksums and OpenPGP signature -->
<delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.asc" />
<delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sha512" />
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
</target>
<target name="release"
depends="clean,release-init,dist-deployer,installer-sign,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 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="UTF-8">
<filterset refid="version.filters"/>
</copy>
<copy file="res/welcome.bin.html"
tofile="${tomcat.release}/v${version}/bin/README.html"
encoding="UTF-8">
<filterset refid="version.filters"/>
</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="*.asc"/>
<include name="*.sha512"/>
</fileset>
</copy>
</target>
<!-- Sets properties only required for releases -->
<target name="release-init" depends="gpg-init-1,gpg-init-2" />
<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.md"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BUILDING.txt" />
<include name="CONTRIBUTING.md"/>
<exclude name="bin/service.bat"/>
<exclude name="bin/x64/"/>
<exclude name="bin/*.exe"/>
<exclude name="bin/*.dll"/>
</zipfileset>
</zip>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.zip" />
</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.md"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BUILDING.txt" />
<include name="CONTRIBUTING.md"/>
<exclude name="bin/x64/"/>
<exclude name="bin/commons-daemon-native.tar.gz"/>
<exclude name="bin/tomcat-native.tar.gz"/>
</zipfileset>
</zip>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}-windows-x86.zip" />
<!-- 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.md"/>
<include name="RELEASE-NOTES"/>
<include name="RUNNING.txt"/>
<include name="BUILDING.txt" />
<include name="CONTRIBUTING.md"/>
<exclude name="bin/x64/"/>
<exclude name="bin/*.dll"/>
<exclude name="bin/tomcat${version.major}.exe"/>
<exclude name="bin/commons-daemon-native.tar.gz"/>
<exclude name="bin/tomcat-native.tar.gz"/>
</zipfileset>
<zipfileset dir="${tomcat.dist}/bin/x64" prefix="${final.name}/bin">
<include name="*.dll"/>
<include name="*.exe"/>
</zipfileset>
</zip>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}-windows-x64.zip" />
</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.md" />
<zipfileset dir="${tomcat.dist}" prefix="${final.name}-deployer" includes="RELEASE-NOTES" />
</zip>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}-deployer.zip" />
</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}" dirmode="700" filemode="600" prefix="${final.name}">
<include name="conf/**" />
</tarfileset>
<tarfileset dir="${tomcat.dist}" dirmode="750" filemode="640" 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.md" />
<include name="RELEASE-NOTES" />
<include name="RUNNING.txt" />
<include name="BUILDING.txt" />
<include name="CONTRIBUTING.md"/>
<exclude name="conf/**" />
<exclude name="src/**" />
<exclude name="bin/service.bat"/>
<exclude name="bin/*.sh"/>
<exclude name="bin/x64/"/>
<exclude name="bin/*.exe"/>
<exclude name="bin/*.dll"/>
</tarfileset>
<!-- These need to be added after the bin directory is added else the -->
<!-- bin directory will pick up the wrong permissions. -->
<tarfileset dir="${tomcat.dist}" dirmode="750" filemode="750" prefix="${final.name}">
<include name="bin/*.sh" />
</tarfileset>
</tar>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.tar.gz" />
</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.md" />
<include name="RELEASE-NOTES" />
</tarfileset>
<tarfileset dir="${tomcat.deployer}" prefix="${final.name}-deployer">
<include name="**" />
</tarfileset>
</tar>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}-deployer.tar.gz" />
</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.md" />
</tarfileset>
<tarfileset dir="${tomcat.dist}/webapps/docs" prefix="tomcat-${version.major.minor}-doc">
<include name="**" />
</tarfileset>
</tar>
<hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}-fulldocs.tar.gz" />
</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>
<hashAndSign file="${tomcat.release}/v${version}/src/${final-src.name}.zip" />
</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>
<hashAndSign file="${tomcat.release}/v${version}/src/${final-src.name}.tar.gz" />
</target>
<!-- Packages the source code in JARs to match the binary JARs -->
<target name="package-src-jar"
depends="build-manifests,build-tomcat-jdbc-src">
<mkdir dir="${tomcat.src.jars}" />
<!-- Common Annotations 1.3 JAR File -->
<jarIt jarfile="${annotations-api-src.jar}"
filesDir="java"
filesId="files.annotations-api"
manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
<!-- Servlet 4.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 EL Implementation JAR File -->
<jarIt jarfile="${el-api-src.jar}"
filesDir="java"
filesId="files.el-api"
manifest="${tomcat.manifests}/el-api.jar.manifest" />
<!-- JSP 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" />
<!-- WebSocket API JAR File -->
<jarIt jarfile="${websocket-api-src.jar}"
filesDir="java"
filesId="files.websocket-api"
manifest="${tomcat.manifests}/websocket-api.jar.manifest" />
<!-- JASPIC API JAR File -->
<jarIt jarfile="${jaspic-api-src.jar}"
filesDir="java"
filesId="files.jaspic-api"
manifest="${tomcat.manifests}/jaspic-api.jar.manifest"
notice="${tomcat.manifests}/jaspic-api.jar.notice"
license="${tomcat.manifests}/jaspic-api.jar.license" />
<!-- Tomcat-juli JAR File -->
<jarIt jarfile="${tomcat-juli-src.jar}"
filesDir="java"
filesId="files.tomcat-juli" />
<!-- Bootstrap JAR File -->
<jarIt jarfile="${bootstrap-src.jar}"
filesDir="java"
filesId="files.bootstrap"
manifest="${tomcat.manifests}/bootstrap.jar.manifest" />
<!-- Tomcat Util JAR File -->
<jarIt jarfile="${tomcat-util-src.jar}"
filesDir="java"
filesId="files.tomcat-util" />
<!-- Tomcat API JAR File -->
<jarIt jarfile="${tomcat-api-src.jar}"
filesDir="java"
filesId="files.tomcat-api" />
<!-- Tomcat Util Scan JAR File -->
<jarIt jarfile="${tomcat-util-scan-src.jar}"
filesDir="java"
filesId="files.tomcat-util-scan" />
<!-- JNI -->
<jarIt jarfile="${tomcat-jni-src.jar}"
filesDir="java"
filesId="files.tomcat-jni" />
<!-- Protocol handlers - Coyote -->
<jarIt jarfile="${tomcat-coyote-src.jar}"
filesDir="java"
filesId="files.tomcat-coyote" />
<!-- WebSocket implementation JAR File -->
<jarIt jarfile="${tomcat-websocket-src.jar}"
filesDir="java"
filesId="files.tomcat-websocket" />
<!-- Catalina GroupCom/Tribes JAR File -->
<jarIt jarfile="${catalina-tribes-src.jar}"
filesDir="java"
filesId="files.catalina-tribes" />
<!-- Catalina Main JAR File -->
<jarIt jarfile="${catalina-src.jar}"
filesDir="java"
filesId="files.catalina" />
<!-- Catalina Cluster/HA JAR File -->
<jarIt jarfile="${catalina-ha-src.jar}"
filesDir="java"
filesId="files.catalina-ha" />
<!-- Catalina SSI JAR File -->
<jarIt jarfile="${catalina-ssi-src.jar}"
filesDir="java"
filesId="files.catalina-ssi" />
<!-- Catalina Ant Tasks JAR File -->
<jarIt jarfile="${catalina-ant-src.jar}"
filesDir="java"
filesId="files.catalina-ant" />
<!-- Catalina Storeconfig JAR File -->
<jarIt jarfile="${catalina-storeconfig-src.jar}"
filesDir="java"
filesId="files.catalina-storeconfig" />
<!-- Jasper EL Implementation JAR File -->
<jarIt jarfile="${jasper-el-src.jar}"
filesDir="java"
filesId="files.jasper-el" />
<!-- Jasper Implementation JAR File -->
<jarIt jarfile="${jasper-src.jar}"
filesDir="java"
filesId="files.jasper" />
<!-- Repackaged DBCP 2 -->
<jarIt jarfile="${tomcat-dbcp-src.jar}"
filesDir="java"
filesId="files.tomcat-dbcp" />
<!-- jdbc-pool JAR File -->
<copy file="${tomcat-jdbc-src.jar}" todir="${tomcat.src.jars}" />
</target>
<!-- ========================= Cleaning Targets ========================== -->
<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="downloadfile">
<param name="sourcefile" value="${checkstyle.loc}"/>
<param name="destfile" value="${checkstyle.jar}"/>
<param name="destdir" value="${base.path}"/>
<param name="checksum.enabled" value="${checkstyle.checksum.enabled}"/>
<param name="checksum.algorithm" value="${checkstyle.checksum.algorithm}"/>
<param name="checksum.value" value="${checkstyle.checksum.value}"/>
</antcall>
</target>
<target name="download-compile"
description="Download components necessary to compile"
depends="setup-bnd">
<!-- 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}"/>
<param name="checksum.enabled" value="${commons-daemon.bin.checksum.enabled}"/>
<param name="checksum.algorithm" value="${commons-daemon.bin.checksum.algorithm}"/>
<param name="checksum.value" value="${commons-daemon.bin.checksum.value}"/>
</antcall>
<!-- 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}"/>
<param name="checksum.enabled" value="${jdt.checksum.enabled}"/>
<param name="checksum.algorithm" value="${jdt.checksum.algorithm}"/>
<param name="checksum.value" value="${jdt.checksum.value}"/>
</antcall>
<!-- Download WS API -->
<antcall target="downloadfile">
<param name="sourcefile" value="${jaxrpc-lib.loc}"/>
<param name="destfile" value="${jaxrpc-lib.jar}"/>
<param name="destdir" value="${jaxrpc-lib.home}"/>
<param name="checksum.enabled" value="${jaxrpc-lib.checksum.enabled}"/>
<param name="checksum.algorithm" value="${jaxrpc-lib.checksum.algorithm}"/>
<param name="checksum.value" value="${jaxrpc-lib.checksum.value}"/>
</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}"/>
<param name="checksum.enabled" value="${wsdl4j-lib.checksum.enabled}"/>
<param name="checksum.algorithm" value="${wsdl4j-lib.checksum.algorithm}"/>
<param name="checksum.value" value="${wsdl4j-lib.checksum.value}"/>
</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}"/>
<param name="checksum.enabled" value="${junit.checksum.enabled}"/>
<param name="checksum.algorithm" value="${junit.checksum.algorithm}"/>
<param name="checksum.value" value="${junit.checksum.value}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${hamcrest.loc}"/>
<param name="destfile" value="${hamcrest.jar}"/>
<param name="destdir" value="${hamcrest.home}"/>
<param name="checksum.enabled" value="${hamcrest.checksum.enabled}"/>
<param name="checksum.algorithm" value="${hamcrest.checksum.algorithm}"/>
<param name="checksum.value" value="${hamcrest.checksum.value}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${easymock.loc}"/>
<param name="destfile" value="${easymock.jar}"/>
<param name="destdir" value="${easymock.home}"/>
<param name="checksum.enabled" value="${easymock.checksum.enabled}"/>
<param name="checksum.algorithm" value="${easymock.checksum.algorithm}"/>
<param name="checksum.value" value="${easymock.checksum.value}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${cglib.loc}"/>
<param name="destfile" value="${cglib.jar}"/>
<param name="destdir" value="${cglib.home}"/>
<param name="checksum.enabled" value="${cglib.checksum.enabled}"/>
<param name="checksum.algorithm" value="${cglib.checksum.algorithm}"/>
<param name="checksum.value" value="${cglib.checksum.value}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${objenesis.loc}"/>
<param name="destfile" value="${objenesis.jar}"/>
<param name="destdir" value="${objenesis.home}"/>
<param name="checksum.enabled" value="${objenesis.checksum.enabled}"/>
<param name="checksum.algorithm" value="${objenesis.checksum.algorithm}"/>
<param name="checksum.value" value="${objenesis.checksum.value}"/>
</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}"/>
<param name="checksum.enabled" value="${cobertura.checksum.enabled}"/>
<param name="checksum.algorithm" value="${cobertura.checksum.algorithm}"/>
<param name="checksum.value" value="${cobertura.checksum.value}"/>
</antcall>
</target>
<target name="download-findbugs"
if="${execute.findbugs}"
description="Download FindBugs" >
<antcall target="downloadgz">
<param name="sourcefile" value="${findbugs.loc}"/>
<param name="destfile" value="${findbugs.jar}"/>
<param name="checksum.enabled" value="${findbugs.checksum.enabled}"/>
<param name="checksum.algorithm" value="${findbugs.checksum.algorithm}"/>
<param name="checksum.value" value="${findbugs.checksum.value}"/>
</antcall>
</target>
<target name="download-dist"
description="Download additional components for a distribution" >
<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}"/>
<param name="checksum.enabled" value="${tomcat-native.src.checksum.enabled}"/>
<param name="checksum.algorithm" value="${tomcat-native.src.checksum.algorithm}"/>
<param name="checksum.value" value="${tomcat-native.src.checksum.value}"/>
</antcall>
<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}/LICENSE"/>
<param name="destdir" value="${tomcat-native.home}"/>
<param name="checksum.enabled" value="${tomcat-native.win.checksum.enabled}"/>
<param name="checksum.algorithm" value="${tomcat-native.win.checksum.algorithm}"/>
<param name="checksum.value" value="${tomcat-native.win.checksum.value}"/>
</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}"/>
<param name="checksum.enabled" value="${commons-daemon.native.src.checksum.enabled}"/>
<param name="checksum.algorithm" value="${commons-daemon.native.src.checksum.algorithm}"/>
<param name="checksum.value" value="${commons-daemon.native.src.checksum.value}"/>
</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}"/>
<param name="checksum.enabled" value="${commons-daemon.native.win.checksum.enabled}"/>
<param name="checksum.algorithm" value="${commons-daemon.native.win.checksum.algorithm}"/>
<param name="checksum.value" value="${commons-daemon.native.win.checksum.value}"/>
</antcall>
<antcall target="downloadzip">
<param name="sourcefile" value="${nsis.loc}"/>
<param name="destfile" value="${nsis.exe}"/>
<param name="destdir" value="${nsis.home}/.."/>
<param name="checksum.enabled" value="${nsis.checksum.enabled}"/>
<param name="checksum.algorithm" value="${nsis.checksum.algorithm}"/>
<param name="checksum.value" value="${nsis.checksum.value}"/>
</antcall>
</target>
<!-- =============== Utility Targets to support downloads ================ -->
<target name="setproxy" if="${proxy.use}">
<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>
<macrodef name="verifyChecksum">
<attribute name="file" />
<attribute name="name" default="@{file}"/>
<attribute name="enabled" />
<attribute name="algorithm" />
<attribute name="value" />
<sequential>
<local name="name" />
<basename property="name" file="@{name}" />
<sequential if:true="@{enabled}">
<local name="check.md5" />
<local name="check.sha1" />
<local name="check.sha256" />
<local name="check.sha384" />
<local name="check.sha512" />
<local name="value.md5" />
<local name="value.sha1" />
<local name="value.sha256" />
<local name="value.sha384" />
<local name="value.sha512" />
<local name="check.success" />
<condition property="check.md5">
<or>
<equals arg1="@{algorithm}" arg2="MD5" />
<equals arg1="@{algorithm}" arg2="MD5|SHA-1" />
</or>
</condition>
<condition property="check.sha1">
<or>
<equals arg1="@{algorithm}" arg2="SHA-1" />
<equals arg1="@{algorithm}" arg2="MD5|SHA-1" />
</or>
</condition>
<condition property="check.sha256">
<equals arg1="@{algorithm}" arg2="SHA-256" />
</condition>
<condition property="check.sha384">
<equals arg1="@{algorithm}" arg2="SHA-384" />
</condition>
<condition property="check.sha512">
<equals arg1="@{algorithm}" arg2="SHA-512" />
</condition>
<!-- Check that any checksum algorithm is selected -->
<fail message="Unknown algorithm: @{algorithm}">
<condition>
<not>
<or>
<equals arg1="${check.md5}" arg2="true" />
<equals arg1="${check.sha1}" arg2="true" />
<equals arg1="${check.sha256}" arg2="true" />
<equals arg1="${check.sha384}" arg2="true" />
<equals arg1="${check.sha512}" arg2="true" />
</or>
</not>
</condition>
</fail>
<!-- Calculate requested checksums -->
<checksum file="@{file}" if:true="${check.md5}" property="value.md5" algorithm="MD5" />
<checksum file="@{file}" if:true="${check.sha1}" property="value.sha1" algorithm="SHA-1" />
<checksum file="@{file}" if:true="${check.sha256}" property="value.sha256" algorithm="SHA-256" />
<checksum file="@{file}" if:true="${check.sha384}" property="value.sha384" algorithm="SHA-384" />
<checksum file="@{file}" if:true="${check.sha512}" property="value.sha512" algorithm="SHA-512" />
<!-- Check actual checksum value -->
<condition property="check.success">
<or>
<and>
<equals arg1="@{algorithm}" arg2="MD5" />
<equals arg1="@{value}" arg2="${value.md5}" />
</and>
<and>
<equals arg1="@{algorithm}" arg2="SHA-1" />
<equals arg1="@{value}" arg2="${value.sha1}" />
</and>
<and>
<equals arg1="@{algorithm}" arg2="MD5|SHA-1" />
<equals arg1="@{value}" arg2="${value.md5}|${value.sha1}" />
</and>
<and>
<equals arg1="@{algorithm}" arg2="SHA-256" />
<equals arg1="@{value}" arg2="${value.sha256}" />
</and>
<and>
<equals arg1="@{algorithm}" arg2="SHA-384" />
<equals arg1="@{value}" arg2="${value.sha384}" />
</and>
<and>
<equals arg1="@{algorithm}" arg2="SHA-512" />
<equals arg1="@{value}" arg2="${value.sha512}" />
</and>
</or>
</condition>
<!-- Fail or display a success message -->
<sequential unless:true="${check.success}">
<!-- Generate checksums for an error message -->
<checksum file="@{file}" unless:set="value.md5" property="value.md5" algorithm="MD5" />
<checksum file="@{file}" unless:set="value.sha1" property="value.sha1" algorithm="SHA-1" />
<checksum file="@{file}" unless:set="value.sha256" property="value.sha256" algorithm="SHA-256" />
<checksum file="@{file}" unless:set="value.sha384" property="value.sha384" algorithm="SHA-384" />
<checksum file="@{file}" unless:set="value.sha512" property="value.sha512" algorithm="SHA-512" />
<fail>
Checksum check failure for ${name} (@{file}).
Algorithm: @{algorithm}
Expected value: @{value}
Actual values:
SHA-512: ${value.sha512}
SHA-384: ${value.sha384}
SHA-256: ${value.sha256}
SHA-1: ${value.sha1}
MD5: ${value.md5}
</fail>
</sequential>
<echo level="info" message="Checksum check for ${name}, algorithm @{algorithm}: OK" />
</sequential>
<echo unless:true="@{enabled}" message="WARNING: Checksum verification is disabled for ${name}"/>
</sequential>
</macrodef>
<target name="downloadgz" unless="exist" depends="testexist,setproxy">
<!-- Download and extract the package -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-"/>
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${temp.file}.tar.gz" />
<verifyChecksum
enabled="${checksum.enabled}"
algorithm="${checksum.algorithm}" value="${checksum.value}"
file="${temp.file}.tar.gz" name="${sourcefile}" />
<gunzip src="${temp.file}.tar.gz" dest="${temp.file}.tar"/>
<untar src="${temp.file}.tar" dest="${base.path}"/>
<delete file="${temp.file}.tar"/>
<delete file="${temp.file}.tar.gz"/>
</target>
<target name="downloadgz-2" unless="exist" depends="testexist">
<!-- Download and extract the package from the two alternative locations -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-"/>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.1}" />
<param name="destfile" value="${temp.file}.tar.gz" />
</antcall>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.2}" />
<param name="destfile" value="${temp.file}.tar.gz" />
</antcall>
<verifyChecksum
enabled="${checksum.enabled}"
algorithm="${checksum.algorithm}" value="${checksum.value}"
file="${temp.file}.tar.gz" name="${sourcefile.1}" />
<gunzip src="${temp.file}.tar.gz" dest="${temp.file}.tar"/>
<untar src="${temp.file}.tar" dest="${base.path}"/>
<delete file="${temp.file}.tar"/>
<delete file="${temp.file}.tar.gz"/>
</target>
<target name="downloadzip" unless="exist" depends="testexist,setproxy">
<!-- Download and extract the package -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-" suffix=".zip"/>
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${temp.file}"/>
<verifyChecksum
enabled="${checksum.enabled}"
algorithm="${checksum.algorithm}" value="${checksum.value}"
file="${temp.file}" name="${sourcefile}" />
<mkdir dir="${destdir}"/>
<unzip src="${temp.file}" dest="${destdir}"/>
<delete file="${temp.file}"/>
</target>
<target name="downloadzip-2" unless="exist" depends="testexist">
<!-- Download and extract the package from the two alternative locations -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-" suffix=".zip"/>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.1}" />
<param name="destfile" value="${temp.file}" />
</antcall>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.2}" />
<param name="destfile" value="${temp.file}" />
</antcall>
<verifyChecksum
enabled="${checksum.enabled}"
algorithm="${checksum.algorithm}" value="${checksum.value}"
file="${temp.file}" name="${sourcefile.1}" />
<mkdir dir="${destdir}" />
<unzip src="${temp.file}" dest="${destdir}"/>
<delete file="${temp.file}"/>
</target>
<target name="downloadfile" unless="exist" depends="testexist,setproxy">
<!-- Download the file -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-" suffix=".tmp"/>
<get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${temp.file}"/>
<verifyChecksum
enabled="${checksum.enabled}"
algorithm="${checksum.algorithm}" value="${checksum.value}"
file="${temp.file}" name="${destfile}" />
<mkdir dir="${destdir}"/>
<move file="${temp.file}" tofile="${destfile}"/>
</target>
<target name="downloadfile-2" unless="exist" depends="testexist">
<!-- Download the file from the two alternative locations -->
<local name="temp.file"/>
<mkdir dir="${base.path}"/>
<tempfile property="temp.file" destdir="${base.path}" prefix="download-" suffix=".tmp"/>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.1}" />
<param name="destfile" value="${temp.file}" />
</antcall>
<antcall target="trydownload">
<param name="sourcefile" value="${sourcefile.2}" />
<param name="destfile" value="${temp.file}" />
</antcall>
<available file="${temp.file}" property="exist"/>
<fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
<verifyChecksum
enabled="${checksum.enabled}"
algorithm="${checksum.algorithm}" value="${checksum.value}"
file="${temp.file}" name="${destfile}" />
<mkdir dir="${destdir}"/>
<move file="${temp.file}" tofile="${destfile}"/>
</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 ============================ -->
<!-- ============================ Eclipse ================================ -->
<target name="ide-eclipse"
depends="download-compile, 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="${tomcat.home}/.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 workspace.</echo>
</target>
<!-- ============================ IntelliJ IDEA=========================== -->
<target name="ide-intellij"
depends="download-compile, download-test-compile"
description="Creates project directory .idea for IntelliJ IDEA">
<copy todir="${tomcat.home}/.idea">
<fileset dir="${tomcat.home}/res/ide-support/idea"/>
</copy>
<echo>IntelliJ IDEA project directory created. Please create PATH VARIABLES for
ANT_HOME = ${ant.home}
TOMCAT_BUILD_LIBS = ${base.path}
</echo>
</target>
<!-- ============================ NetBeans =============================== -->
<target name="ide-netbeans"
depends="-ide-netbeans-protect,-ide-netbeans-create"
description="Create NetBeans project files only if none exist">
</target>
<target name="-ide-netbeans-protect"
if="tomcat-nb.home.exists"
depends="-ide-netbeans-check">
<!-- Protect existing NetBeans project files -->
<echo>NetBeans project files already exist and have been protected!
Use the "ide-netbeans-replace" target if you wish to overwrite them.</echo>
</target>
<target name="-ide-netbeans-check">
<!-- protect existing files if the NetBeans project directory exists -->
<condition property="tomcat-nb.home.exists">
<available file="${tomcat-nb.home}" type="dir"/>
</condition>
</target>
<target name="ide-netbeans-replace" depends="-ide-netbeans-create">
<!-- Bypass protection of any existing NetBeans project files -->
</target>
<target name="-ide-netbeans-create"
unless="tomcat-nb.home.exists">
<!-- Unconditionally create or overwrite default NetBeans project files -->
<property name="tomcat-nb.dist" value="${tomcat.home}/res/ide-support/netbeans" />
<mkdir dir="${tomcat-nb.home}/"/>
<copy todir="${tomcat-nb.home}" overwrite="true">
<fileset dir="${tomcat-nb.dist}"/>
</copy>
<echo>NetBeans project files created.
Read the Building page on the Apache Tomcat documentation site for details on how to customise your NetBeans project.</echo>
</target>
<!-- ======================= Macros, Taskdefs etc ======================== -->
<target name="download-bnd" >
<!-- Download bnd -->
<antcall target="downloadfile">
<param name="sourcefile" value="${bnd.loc}"/>
<param name="destfile" value="${bnd.jar}"/>
<param name="destdir" value="${bnd.home}"/>
<param name="checksum.enabled" value="${bnd.checksum.enabled}"/>
<param name="checksum.algorithm" value="${bnd.checksum.algorithm}"/>
<param name="checksum.value" value="${bnd.checksum.value}"/>
</antcall>
<!-- Download OSGi annotations -->
<antcall target="downloadfile">
<param name="sourcefile" value="${osgi-annotations.loc}"/>
<param name="destfile" value="${osgi-annotations.jar}"/>
<param name="destdir" value="${osgi-annotations.home}"/>
<param name="checksum.enabled" value="${osgi-annotations.checksum.enabled}"/>
<param name="checksum.algorithm" value="${osgi-annotations.checksum.algorithm}"/>
<param name="checksum.value" value="${osgi-annotations.checksum.value}"/>
</antcall>
</target>
<target name="setup-bnd" depends="download-bnd">
<!-- Add bnd tasks to project -->
<path id="bnd.classpath">
<fileset file="${bnd.jar}" />
</path>
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpathref="bnd.classpath" />
</target>
<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" />
<attribute name="addOSGi" description="generate OSGi metadata"
default="false" />
<attribute name="addGraal" description="add Graal resource/reflection files if set"
default="false" />
<attribute name="graalPrefix" description="Graal resource/reflection location prefix (group_id/artifact_id)"
default="" />
<attribute name="graalFiles" description="Graal resource/reflection file location"
default="" />
<attribute name="libs" description="libraries to use for bnd classpath analysis relative to ${tomcat.output}"
default="build/lib/*.jar,build/bin/tomcat-juli.jar" />
<sequential>
<local name="jar.uptodate"/>
<uptodate property="jar.uptodate" targetfile="@{jarfile}" >
<srcfiles dir="@{filesDir}">
<patternset refid="@{filesId}"/>
<!-- Javadoc exclusions -->
<exclude name="**/package.html" />
</srcfiles>
<srcfiles dir="@{meta-inf}" excludes=".gitignore" />
<srcfiles file="@{notice}" />
<srcfiles file="@{license}" />
</uptodate>
<sequential unless:true="${jar.uptodate}">
<jar jarfile="@{jarfile}" manifest="@{manifest}" >
<fileset dir="@{filesDir}">
<patternset refid="@{filesId}"/>
<!-- Javadoc exclusions -->
<exclude name="**/package.html" />
</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>
<antcall target="add-osgi" >
<param name="jarfile" value="@{jarfile}" />
<param name="addOSGi" value="@{addOSGi}" />
<param name="libs" value="@{libs}" />
</antcall>
<antcall target="add-graal">
<param name="jarfile" value="@{jarfile}" />
<param name="addGraal" value="@{addGraal}" />
<param name="graalFiles" value="@{graalFiles}" />
<param name="graalPrefix" value="@{graalPrefix}" />
</antcall>
</sequential>
</sequential>
</macrodef>
<target name="add-osgi" if="${addOSGi}" >
<echo message="add-osgi ${jarfile} ${addOSGi}"></echo>
<local name="filename"/>
<basename property="filename" file="${jarfile}"/>
<bnd
basedir="${basedir}"
output="${jarfile}.tmp"
>
<classpath>
<pathelement location="${bnd.jar}"/>
<fileset dir="${tomcat.output}" includes="${libs}" />
</classpath>
<bndfiles>
<pathelement location="${tomcat.bnd}/${filename}.tmp.bnd"/>
</bndfiles>
</bnd>
<delete file="${jarfile}" />
<move file="${jarfile}.tmp" tofile="${jarfile}" />
</target>
<target name="add-graal" if="${addGraal}">
<echo message="add-graal ${addGraal} ${jarfile} ${graalFiles} ${graalPrefix}"></echo>
<zip destfile="${jarfile}" update="true">
<zipfileset dir="${basedir}/${graalFiles}" prefix="META-INF/native-image/${graalPrefix}" includes="*.*"/>
</zip>
</target>
<!-- Macro, used to create checksum and signature files -->
<!-- Requires 'file' as a parameter. -->
<macrodef name="hashAndSign">
<attribute name="file" />
<sequential>
<local name="filename" />
<local name="sha512value" />
<basename file="@{file}" property="filename" />
<checksum algorithm="SHA-512" file="@{file}" property="sha512value" />
<echo file="@{file}.sha512" message="${sha512value}${md5sum.binary-prefix}${filename}" />
<antcall target="sign" >
<param name="file" value="@{file}" />
</antcall>
</sequential>
</macrodef>
<!-- 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="--batch"/>
<arg value="--pinentry-mode"/>
<arg value="loopback"/>
<arg value="--passphrase-fd"/>
<arg value="0"/>
<arg value="-a"/>
<arg value="-b"/>
<arg value="${file}"/>
</exec>
</target>
</project>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/funcy/tomcat.git
git@gitee.com:funcy/tomcat.git
funcy
tomcat
tomcat
9.0.43.LEARN

搜索帮助

0d507c66 1850385 C8b1a773 1850385