maven.scm 160 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018-2021 Julien Lepiller <julien@lepiller.eu>
  3. ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
  5. ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
  6. ;;;
  7. ;;; This file is part of GNU Guix.
  8. ;;;
  9. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  10. ;;; under the terms of the GNU General Public License as published by
  11. ;;; the Free Software Foundation; either version 3 of the License, or (at
  12. ;;; your option) any later version.
  13. ;;;
  14. ;;; GNU Guix is distributed in the hope that it will be useful, but
  15. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;;; GNU General Public License for more details.
  18. ;;;
  19. ;;; You should have received a copy of the GNU General Public License
  20. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  21. (define-module (gnu packages maven)
  22. #:use-module ((guix licenses) #:prefix license:)
  23. #:use-module (guix packages)
  24. #:use-module (guix download)
  25. #:use-module (guix git-download)
  26. #:use-module (guix utils)
  27. #:use-module (guix build-system ant)
  28. #:use-module (gnu packages)
  29. #:use-module (gnu packages base)
  30. #:use-module (gnu packages compression)
  31. #:use-module (gnu packages java)
  32. #:use-module (gnu packages maven-parent-pom)
  33. #:use-module (gnu packages web)
  34. #:use-module (gnu packages xml)
  35. #:use-module (ice-9 match))
  36. (define-public maven-resolver-api
  37. (package
  38. (name "maven-resolver-api")
  39. (version "1.3.1")
  40. (source (origin
  41. (method git-fetch)
  42. (uri (git-reference
  43. (url "https://github.com/apache/maven-resolver")
  44. (commit (string-append "maven-resolver-" version))))
  45. (file-name (git-file-name name version))
  46. (sha256
  47. (base32
  48. "1x1gll8nkfl6zgnab78fxxvvhg42b2grxgdh1wp2h4qxsjkxg93d"))))
  49. (build-system ant-build-system)
  50. (arguments
  51. `(#:jar-name "maven-resolver-api.jar"
  52. #:source-dir "maven-resolver-api/src/main/java"
  53. #:test-dir "maven-resolver-api/src/test"
  54. #:phases
  55. (modify-phases %standard-phases
  56. (replace 'install
  57. (install-from-pom "maven-resolver-api/pom.xml")))))
  58. (native-inputs
  59. `(("java-asm" ,java-asm)
  60. ("java-cglib" ,java-cglib)
  61. ("java-hamcrest-core" ,java-hamcrest-core)
  62. ("java-junit" ,java-junit)
  63. ("java-mockito-1" ,java-mockito-1)
  64. ("java-objenesis" ,java-objenesis)))
  65. (propagated-inputs
  66. `(("maven-resolver-parent-pom" ,maven-resolver-parent-pom)))
  67. (home-page "https://github.com/apache/maven-resolver")
  68. (synopsis "Maven repository system API")
  69. (description "This package contains the API for the maven repository system.")
  70. (license license:asl2.0)))
  71. (define maven-resolver-parent-pom
  72. (package
  73. (inherit maven-resolver-api)
  74. (name "maven-resolver-parent-pom")
  75. (arguments
  76. `(#:tests? #f
  77. #:phases
  78. (modify-phases %standard-phases
  79. (delete 'configure)
  80. (delete 'build)
  81. (add-before 'install 'fix-pom
  82. (lambda _
  83. (substitute* "pom.xml"
  84. (("<classifier>no_aop</classifier>") ""))
  85. #t))
  86. (replace 'install
  87. (install-pom-file "pom.xml")))))
  88. (propagated-inputs '())))
  89. (define-public maven-resolver-spi
  90. (package
  91. (inherit maven-resolver-api)
  92. (name "maven-resolver-spi")
  93. (arguments
  94. `(#:jar-name "maven-resolver-spi.jar"
  95. #:source-dir "maven-resolver-spi/src/main/java"
  96. #:test-dir "maven-resolver-spi/src/test"
  97. #:phases
  98. (modify-phases %standard-phases
  99. (replace 'install
  100. (install-from-pom "maven-resolver-spi/pom.xml")))))
  101. (propagated-inputs
  102. `(("maven-resolver-api" ,maven-resolver-api)))
  103. (synopsis "Maven repository system SPI")
  104. (description "This package contains the service provider interface (SPI)
  105. for repository system implementations and repository connectors.")))
  106. (define-public maven-resolver-test-util
  107. (package
  108. (inherit maven-resolver-api)
  109. (name "maven-resolver-test-util")
  110. (arguments
  111. `(#:jar-name "maven-resolver-test-util.jar"
  112. #:source-dir "maven-resolver-test-util/src/main/java"
  113. #:test-dir "maven-resolver-test-util/src/test"
  114. #:jdk ,icedtea-8))
  115. (inputs
  116. `(("maven-resolver-api" ,maven-resolver-api)
  117. ("maven-resolver-spi" ,maven-resolver-spi)))
  118. (synopsis "Utility classes for testing the maven repository system")
  119. (description "This package contains a collection of utility classes to
  120. ease testing of the repository system.")))
  121. (define-public maven-resolver-util
  122. (package
  123. (inherit maven-resolver-api)
  124. (name "maven-resolver-util")
  125. (arguments
  126. `(#:jar-name "maven-resolver-util.jar"
  127. #:source-dir "maven-resolver-util/src/main/java"
  128. #:test-dir "maven-resolver-util/src/test"
  129. #:phases
  130. (modify-phases %standard-phases
  131. (replace 'install
  132. (install-from-pom "maven-resolver-util/pom.xml")))))
  133. (propagated-inputs
  134. `(("maven-resolver-api" ,maven-resolver-api)))
  135. (native-inputs
  136. `(("java-junit" ,java-junit)
  137. ("java-hamcrest-core" ,java-hamcrest-core)
  138. ("maven-resolver-test-util" ,maven-resolver-test-util)))
  139. (synopsis "Utility classes for the maven repository system")
  140. (description "This package contains a collection of utility classes to
  141. ease usage of the repository system.")))
  142. (define-public maven-resolver-connector-basic
  143. (package
  144. (inherit maven-resolver-api)
  145. (name "maven-resolver-connector-basic")
  146. (arguments
  147. `(#:jar-name "maven-resolver-connector-basic.jar"
  148. #:source-dir "maven-resolver-connector-basic/src/main/java"
  149. #:test-dir "maven-resolver-connector-basic/src/test"
  150. #:jdk ,icedtea-8
  151. #:phases
  152. (modify-phases %standard-phases
  153. (add-before 'build 'generate-sisu
  154. (lambda _
  155. (mkdir-p "build/classes/META-INF/sisu")
  156. (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
  157. (lambda _
  158. (display "org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory\n")))
  159. #t))
  160. (replace 'install
  161. (install-from-pom "maven-resolver-connector-basic/pom.xml")))))
  162. (propagated-inputs
  163. `(("maven-resolver-api" ,maven-resolver-api)
  164. ("maven-resolver-spi" ,maven-resolver-spi)
  165. ("maven-resolver-util" ,maven-resolver-util)
  166. ("java-slf4j-api" ,java-slf4j-api)))
  167. (native-inputs
  168. `(("java-javax-inject" ,java-javax-inject)
  169. ("java-junit" ,java-junit)
  170. ("maven-resolver-test-util" ,maven-resolver-test-util)))
  171. (synopsis "Maven repository connector implementation")
  172. (description "This package contains a repository connector implementation
  173. for repositories using URI-based layouts.")))
  174. (define-public maven-resolver-impl
  175. (package
  176. (inherit maven-resolver-api)
  177. (name "maven-resolver-impl")
  178. (arguments
  179. `(#:jar-name "maven-resolver-impl.jar"
  180. #:source-dir "maven-resolver-impl/src/main/java"
  181. #:test-dir "maven-resolver-impl/src/test"
  182. #:phases
  183. (modify-phases %standard-phases
  184. (add-before 'build 'generate-sisu
  185. (lambda _
  186. (mkdir-p "build/classes/META-INF/sisu")
  187. (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
  188. (lambda _
  189. (display
  190. (string-append
  191. ;; Build this list by looking for files containing "@Named"
  192. "org.eclipse.aether.internal.impl.DefaultArtifactResolver\n"
  193. "org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector\n"
  194. "org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider\n"
  195. "org.eclipse.aether.internal.impl.DefaultDeployer\n"
  196. "org.eclipse.aether.internal.impl.DefaultFileProcessor\n"
  197. "org.eclipse.aether.internal.impl.DefaultInstaller\n"
  198. "org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider\n"
  199. "org.eclipse.aether.internal.impl.DefaultMetadataResolver\n"
  200. "org.eclipse.aether.internal.impl.DefaultOfflineController\n"
  201. "org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager\n"
  202. "org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider\n"
  203. "org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher\n"
  204. "org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider\n"
  205. "org.eclipse.aether.internal.impl.DefaultRepositorySystem\n"
  206. "org.eclipse.aether.internal.impl.DefaultSyncContextFactory\n"
  207. "org.eclipse.aether.internal.impl.DefaultTransporterProvider\n"
  208. "org.eclipse.aether.internal.impl.DefaultUpdateCheckManager\n"
  209. "org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer\n"
  210. "org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory\n"
  211. "org.eclipse.aether.internal.impl.LoggerFactoryProvider\n"
  212. "org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory\n"
  213. "org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory\n"
  214. "org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory"))))
  215. #t))
  216. (replace 'install
  217. (install-from-pom "maven-resolver-impl/pom.xml")))))
  218. (propagated-inputs
  219. `(("maven-resolver-api" ,maven-resolver-api)
  220. ("maven-resolver-spi" ,maven-resolver-spi)
  221. ("maven-resolver-util" ,maven-resolver-util)
  222. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  223. ("java-javax-inject" ,java-javax-inject)
  224. ("java-guice" ,java-guice)
  225. ("java-slf4j-api" ,java-slf4j-api)
  226. ("maven-resolver-parent-pom" ,maven-resolver-parent-pom)))
  227. (native-inputs
  228. `(("java-junit" ,java-junit)
  229. ("maven-resolver-test-util" ,maven-resolver-test-util)))))
  230. (define-public maven-resolver-transport-wagon
  231. (package
  232. (inherit maven-resolver-api)
  233. (name "maven-resolver-transport-wagon")
  234. (arguments
  235. `(#:jar-name "maven-resolver-transport-wagon.jar"
  236. #:source-dir "maven-resolver-transport-wagon/src/main/java"
  237. #:test-dir "maven-resolver-transport-wagon/src/test"
  238. #:jdk ,icedtea-8
  239. #:phases
  240. (modify-phases %standard-phases
  241. (add-before 'build 'generate-sisu
  242. (lambda _
  243. (mkdir-p "build/classes/META-INF/sisu")
  244. (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
  245. (lambda _
  246. (display "org.eclipse.aether.transport.wagon.WagonTransporterFactory\n")))
  247. #t))
  248. (add-before 'build 'generate-components.xml
  249. (lambda _
  250. (mkdir-p "build/classes/META-INF/plexus")
  251. (with-output-to-file "build/classes/META-INF/plexus/components.xml"
  252. (lambda _
  253. (display
  254. (string-append
  255. "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
  256. <component-set>
  257. <components>
  258. <component>
  259. <role>org.eclipse.aether.transport.wagon.WagonConfigurator</role>
  260. <role-hint>plexus</role-hint>
  261. <implementation>org.eclipse.aether.internal.transport.wagon.PlexusWagonConfigurator</implementation>
  262. <description />
  263. <isolated-realm>false</isolated-realm>
  264. <requirements>
  265. <requirement>
  266. <role>org.codehaus.plexus.PlexusContainer</role>
  267. <role-hint />
  268. <field-name>container</field-name>
  269. </requirement>
  270. </requirements>
  271. </component>
  272. <component>
  273. <role>org.eclipse.aether.transport.wagon.WagonProvider</role>
  274. <role-hint>plexus</role-hint>
  275. <implementation>org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider</implementation>
  276. <description />
  277. <isolated-realm>false</isolated-realm>
  278. <requirements>
  279. <requirement>
  280. <role>org.codehaus.plexus.PlexusContainer</role>
  281. <role-hint />
  282. <field-name>container</field-name>
  283. </requirement>
  284. </requirements>
  285. </component>
  286. </components>
  287. </component-set>\n"))))
  288. #t)))))
  289. (inputs
  290. `(("maven-resolver-api" ,maven-resolver-api)
  291. ("maven-resolver-spi" ,maven-resolver-spi)
  292. ("maven-resolver-util" ,maven-resolver-util)
  293. ("java-javax-inject" ,java-javax-inject)
  294. ("mavne-wagon-provider-api" ,maven-wagon-provider-api)
  295. ("java-plexus-component-annotation" ,java-plexus-component-annotations)
  296. ("java-plexus-classworld" ,java-plexus-classworlds)
  297. ("java-plexus-plexus-util" ,java-plexus-utils)
  298. ("java-slf4j-api" ,java-slf4j-api)
  299. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  300. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)))
  301. (native-inputs
  302. `(("java-junit" ,java-junit)
  303. ("java-hamcrest-core" ,java-hamcrest-core)
  304. ("maven-resolver-test-util" ,maven-resolver-test-util)
  305. ("java-guava" ,java-guava)
  306. ("java-cglib" ,java-cglib)
  307. ("java-asm" ,java-asm)
  308. ("java-aopalliance" ,java-aopalliance)
  309. ("java-guice" ,java-guice)))
  310. (synopsis "Transport implementation for Maven")
  311. (description "This package contains a transport implementation based on
  312. Maven Wagon, for use in Maven.")))
  313. ;; aether is the parent project that was forked into maven-resolver. It used
  314. ;; to be used with older versions of Maven, and is still required for some
  315. ;; plugins and their dependencies. This version is required for the plugins,
  316. ;; even though there are newer versions of this project.
  317. (define-public java-sonatype-aether-api
  318. (package
  319. (name "java-sonatype-aether-api")
  320. (version "1.7")
  321. (source (origin
  322. (method git-fetch)
  323. (uri (git-reference
  324. (url "https://github.com/sonatype/sonatype-aether")
  325. (commit (string-append "aether-" version))))
  326. (file-name (git-file-name name version))
  327. (sha256
  328. (base32
  329. "1wn9fv91n40bvlwbzy0dmh0xqibxl2mpzpnbibhqss3c0zlr1ccq"))))
  330. (build-system ant-build-system)
  331. (arguments
  332. `(#:jar-name "aether-api.jar"
  333. #:source-dir "aether-api/src/main/java"
  334. #:test-dir "aether-api/src/test"
  335. #:phases
  336. (modify-phases %standard-phases
  337. (add-before 'install 'install-parent (install-pom-file "pom.xml"))
  338. (replace 'install (install-from-pom "aether-api/pom.xml")))))
  339. (propagated-inputs
  340. `(("java-sonatype-forge-parent-pom" ,java-sonatype-forge-parent-pom-6)))
  341. (native-inputs `(("java-junit" ,java-junit)))
  342. (home-page "https://github.com/sonatype/sonatype-aether")
  343. (synopsis "Maven repository system API")
  344. (description "This package contains the API for the maven repository system.")
  345. (license license:asl2.0)))
  346. (define-public java-sonatype-aether-spi
  347. (package
  348. (inherit java-sonatype-aether-api)
  349. (name "java-sonatype-aether-spi")
  350. (arguments
  351. `(#:jar-name "aether-spi.jar"
  352. #:source-dir "aether-spi/src/main/java"
  353. #:tests? #f; no tests
  354. #:phases
  355. (modify-phases %standard-phases
  356. (replace 'install (install-from-pom "aether-spi/pom.xml")))))
  357. (propagated-inputs
  358. `(("java-sonatype-aether-api" ,java-sonatype-aether-api)))
  359. (synopsis "Maven repository system SPI")
  360. (description "This package contains the service provider interface (SPI)
  361. for repository system implementations and repository connectors.")))
  362. (define-public java-sonatype-aether-test-util
  363. (package
  364. (inherit java-sonatype-aether-api)
  365. (name "java-sonatype-aether-test-util")
  366. (arguments
  367. `(#:jar-name "java-sonatype-aether-test-util.jar"
  368. #:source-dir "aether-test-util/src/main/java"
  369. #:test-dir "aether-test-util/src/test"))
  370. (inputs
  371. `(("java-sonatype-aether-api" ,java-sonatype-aether-api)
  372. ("java-sonatype-aether-spi" ,java-sonatype-aether-spi)))
  373. (synopsis "Utility classes for testing the maven repository system")
  374. (description "This package contains a collection of utility classes to
  375. ease testing of the repository system.")))
  376. (define-public java-sonatype-aether-util
  377. (package
  378. (inherit java-sonatype-aether-api)
  379. (name "java-sonatype-aether-util")
  380. (arguments
  381. `(#:jar-name "aether-util.jar"
  382. #:source-dir "aether-util/src/main/java"
  383. #:test-dir "aether-util/src/test"
  384. #:phases
  385. (modify-phases %standard-phases
  386. (replace 'install (install-from-pom "aether-util/pom.xml")))))
  387. (propagated-inputs
  388. `(("java-sonatype-aether-api" ,java-sonatype-aether-api)))
  389. (native-inputs
  390. `(("java-junit" ,java-junit)
  391. ("java-sonatype-aether-test-util" ,java-sonatype-aether-test-util)))
  392. (synopsis "Utility classes for the maven repository system")
  393. (description "This package contains a collection of utility classes to
  394. ease usage of the repository system.")))
  395. (define-public java-sonatype-aether-impl
  396. (package
  397. (inherit java-sonatype-aether-api)
  398. (name "java-sonatype-aether-impl")
  399. (arguments
  400. `(#:jar-name "aether-impl.jar"
  401. #:source-dir "aether-impl/src/main/java"
  402. #:test-dir "aether-impl/src/test"
  403. #:phases
  404. (modify-phases %standard-phases
  405. (add-before 'install 'fix-pom
  406. (lambda _
  407. (substitute* "aether-impl/pom.xml"
  408. (("org.sonatype.sisu") "org.codehaus.plexus")
  409. (("sisu-inject-plexus") "plexus-container-default"))
  410. #t))
  411. (add-after 'build 'generate-metadata
  412. (lambda _
  413. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  414. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  415. "--source" "src/main/java"
  416. "--output" "build/classes/META-INF/plexus/components.xml"
  417. "--classes" "build/classes"
  418. "--descriptors" "build/classes/META-INF")
  419. #t))
  420. (add-after 'generate-metadata 'rebuild
  421. (lambda _
  422. (invoke "ant" "jar")
  423. #t))
  424. (replace 'install (install-from-pom "aether-impl/pom.xml")))))
  425. (propagated-inputs
  426. `(("java-sonatype-aether-api" ,java-sonatype-aether-api)
  427. ("java-sonatype-aether-spi" ,java-sonatype-aether-spi)
  428. ("java-sonatype-aether-util" ,java-sonatype-aether-util)
  429. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  430. ("java-plexus-container-default" ,java-plexus-container-default)
  431. ("java-slf4j-api" ,java-slf4j-api)))
  432. (native-inputs
  433. `(("java-junit" ,java-junit)
  434. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  435. ("java-sonatype-aether-test-util" ,java-sonatype-aether-test-util)))))
  436. ;; Again, this old version is required by some maven plugins
  437. (define-public java-eclipse-aether-api
  438. (package
  439. (name "java-eclipse-aether-api")
  440. (version "1.0.2")
  441. (source (origin
  442. (method git-fetch)
  443. (uri (git-reference
  444. (url "https://github.com/eclipse/aether-core")
  445. (commit "aether-1.0.2.v20150114")))
  446. (file-name (git-file-name name version))
  447. (sha256
  448. (base32
  449. "14d336nn0kh5ddf23j37va3hd8gaai19llrpxhf4bcc7g7sgdqxs"))))
  450. (build-system ant-build-system)
  451. (arguments
  452. `(#:jar-name "aether-api.jar"
  453. #:source-dir "aether-api/src/main/java"
  454. #:test-dir "aether-api/src/test"
  455. #:phases
  456. (modify-phases %standard-phases
  457. (add-before 'install 'install-parent (install-pom-file "pom.xml"))
  458. (replace 'install (install-from-pom "aether-api/pom.xml")))))
  459. (native-inputs `(("java-junit" ,java-junit)))
  460. (home-page "https://github.com/sonatype/sonatype-aether")
  461. (synopsis "Maven repository system API")
  462. (description "This package contains the API for the maven repository system.")
  463. (license license:asl2.0)))
  464. (define-public java-eclipse-aether-spi
  465. (package
  466. (inherit java-eclipse-aether-api)
  467. (name "java-eclipse-aether-spi")
  468. (arguments
  469. `(#:jar-name "aether-spi.jar"
  470. #:source-dir "aether-spi/src/main/java"
  471. #:test-dir "aether-spi/src/test"
  472. #:phases
  473. (modify-phases %standard-phases
  474. (replace 'install (install-from-pom "aether-spi/pom.xml")))))
  475. (propagated-inputs
  476. `(("java-eclipse-aether-api" ,java-eclipse-aether-api)))
  477. (synopsis "Maven repository system SPI")
  478. (description "This package contains the service provider interface (SPI)
  479. for repository system implementations and repository connectors.")))
  480. (define-public java-eclipse-aether-test-util
  481. (package
  482. (inherit java-eclipse-aether-api)
  483. (name "java-eclipse-aether-test-util")
  484. (arguments
  485. `(#:jar-name "aether-test-util.jar"
  486. #:source-dir "aether-test-util/src/main/java"
  487. #:test-dir "aether-test-util/src/test"
  488. #:phases
  489. (modify-phases %standard-phases
  490. (replace 'install (install-from-pom "aether-util/pom.xml")))))
  491. (propagated-inputs
  492. `(("java-eclipse-aether-api" ,java-eclipse-aether-api)
  493. ("java-eclipse-aether-spi" ,java-eclipse-aether-spi)))
  494. (synopsis "Utility classes for testing the maven repository system")
  495. (description "This package contains a collection of utility classes to
  496. ease testing of the repository system.")))
  497. (define-public java-eclipse-aether-util
  498. (package
  499. (inherit java-eclipse-aether-api)
  500. (name "java-eclipse-aether-util")
  501. (arguments
  502. `(#:jar-name "aether-util.jar"
  503. #:source-dir "aether-util/src/main/java"
  504. #:test-dir "aether-util/src/test"
  505. #:phases
  506. (modify-phases %standard-phases
  507. (replace 'install (install-from-pom "aether-util/pom.xml")))))
  508. (propagated-inputs
  509. `(("java-eclipse-aether-api" ,java-eclipse-aether-api)))
  510. (native-inputs
  511. `(("java-eclipse-aether-test-util" ,java-eclipse-aether-test-util)
  512. ("java-junit" ,java-junit)))
  513. (synopsis "Utility classes for the maven repository system")
  514. (description "This package contains a collection of utility classes to
  515. ease usage of the repository system.")))
  516. (define-public java-eclipse-aether-impl
  517. (package
  518. (inherit java-eclipse-aether-api)
  519. (name "java-eclipse-aether-impl")
  520. (arguments
  521. `(#:jar-name "aether-impl.jar"
  522. #:source-dir "aether-impl/src/main/java"
  523. #:test-dir "aether-impl/src/test"
  524. #:phases
  525. (modify-phases %standard-phases
  526. (replace 'install (install-from-pom "aether-impl/pom.xml")))))
  527. (propagated-inputs
  528. `(("java-eclipse-aether-api" ,java-eclipse-aether-api)
  529. ("java-eclipse-aether-spi" ,java-eclipse-aether-spi)
  530. ("java-eclipse-aether-util" ,java-eclipse-aether-util)
  531. ("java-javax-inject" ,java-javax-inject)
  532. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  533. ("java-guice" ,java-guice)
  534. ("java-slf4j-api" ,java-slf4j-api)))
  535. (native-inputs
  536. `(("java-eclipse-aether-test-util" ,java-eclipse-aether-test-util)
  537. ("java-junit" ,java-junit)))))
  538. (define-public maven-shared-utils
  539. (package
  540. (name "maven-shared-utils")
  541. (version "3.2.1")
  542. (source (origin
  543. (method url-fetch)
  544. (uri (string-append "mirror://apache/maven/shared/"
  545. "maven-shared-utils-" version "-source-release.zip"))
  546. (sha256
  547. (base32
  548. "1kzmj68wwdcznb36hm6kfz57wbavw7g1rp236pz10znkjljn6rf6"))))
  549. (build-system ant-build-system)
  550. (arguments
  551. `(#:jar-name "maven-shared-utils.jar"
  552. #:source-dir "src/main/java"
  553. #:phases
  554. (modify-phases %standard-phases
  555. (add-before 'build 'fix-/bin/sh-invocation
  556. (lambda _
  557. (substitute* (find-files "src" ".*.java$")
  558. (("/bin/sh") (which "sh")))
  559. #t))
  560. (add-before 'check 'remove-cyclic-dep
  561. (lambda _
  562. (delete-file
  563. "src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java")
  564. #t))
  565. (replace 'install
  566. (install-from-pom "pom.xml")))))
  567. (propagated-inputs
  568. `(("java-jansi" ,java-jansi)
  569. ("java-commons-io" ,java-commons-io)
  570. ("java-jsr305" ,java-jsr305)
  571. ("java-plexus-container-default" ,java-plexus-container-default)
  572. ("maven-parent-pom-30" ,maven-parent-pom-30)))
  573. (native-inputs
  574. `(("unzip" ,unzip)
  575. ("java-junit" ,java-junit)
  576. ("java-hamcrest-core" ,java-hamcrest-core)
  577. ("java-commons-lang3" ,java-commons-lang3)))
  578. (home-page "https://maven.apache.org/shared/maven-shared-utils/")
  579. (synopsis "Plexus-util replacement for maven")
  580. (description "This project aims to be a functional replacement for
  581. plexus-utils in Maven. It is not a 100% API compatible replacement but a
  582. replacement with improvements.")
  583. (license license:asl2.0)))
  584. (define-public maven-plugin-annotations
  585. (package
  586. (name "maven-plugin-annotations")
  587. (version "3.5")
  588. (source (origin
  589. (method url-fetch)
  590. (uri (string-append "mirror://apache/maven/"
  591. "plugin-tools/maven-plugin-tools-" version
  592. "-source-release.zip"))
  593. (sha256 (base32 "1ryqhs62j5pas93brhf5dsnvp99hxbvssf681yj5rk3r9h24hqm2"))))
  594. (build-system ant-build-system)
  595. (arguments
  596. `(#:jar-name "maven-plugin-annotations.jar"
  597. #:source-dir "maven-plugin-annotations/src/main/java"
  598. #:tests? #f
  599. #:phases
  600. (modify-phases %standard-phases
  601. (replace 'install
  602. (install-from-pom "maven-plugin-annotations/pom.xml")))))
  603. (propagated-inputs
  604. `(("maven-artifact" ,maven-artifact)
  605. ("maven-plugin-tools-parent-pom" ,maven-plugin-tools-parent-pom)))
  606. (native-inputs
  607. `(("unzip" ,unzip)))
  608. (home-page "https://maven.apache.org/plugin-tools/maven-plugin-annotations/")
  609. (synopsis "Java 5 annotations to use in Mojos")
  610. (description "This package contains Java 5 annotations for use in Mojos.")
  611. (license license:asl2.0)))
  612. (define maven-plugin-tools-parent-pom
  613. (package
  614. (inherit maven-plugin-annotations)
  615. (name "maven-plugin-tools-parent-pom")
  616. (arguments
  617. `(#:tests? #f
  618. #:phases
  619. (modify-phases %standard-phases
  620. (delete 'configure)
  621. (delete 'build)
  622. (replace 'install
  623. (install-pom-file "pom.xml")))))
  624. (propagated-inputs '())))
  625. (define-public maven-wagon-provider-api
  626. (package
  627. (name "maven-wagon-provider-api")
  628. (version "3.3.4")
  629. (source (origin
  630. (method url-fetch)
  631. (uri (string-append "https://archive.apache.org/dist/maven/wagon/"
  632. "wagon-" version "-source-release.zip"))
  633. (sha256
  634. (base32
  635. "1iq9bilgfklzbxwwhzi3f19mkbaaf9dh9f83h3yz5gbmvypask9a"))))
  636. (build-system ant-build-system)
  637. (arguments
  638. `(#:jar-name "maven-wagon-provider-api.jar"
  639. #:source-dir "wagon-provider-api/src/main/java"
  640. #:test-dir "wagon-provider-api/src/test"
  641. #:phases
  642. (modify-phases %standard-phases
  643. (replace 'install
  644. (install-from-pom "wagon-provider-api/pom.xml")))))
  645. (propagated-inputs
  646. `(("java-plexus-utils" ,java-plexus-utils)
  647. ("maven-wagon-parent-pom" ,maven-wagon-parent-pom)))
  648. (native-inputs
  649. `(("unzip" ,unzip)
  650. ("java-junit" ,java-junit)
  651. ("java-easymock" ,java-easymock)))
  652. (home-page "https://maven.apache.org/wagon")
  653. (synopsis "Transport abstraction for Maven")
  654. (description "Maven Wagon is a transport abstraction that is used in Maven's
  655. artifact and repository handling code.")
  656. (license license:asl2.0)))
  657. (define maven-wagon-parent-pom
  658. (package
  659. (inherit maven-wagon-provider-api)
  660. (arguments
  661. `(#:tests? #f
  662. #:phases
  663. (modify-phases %standard-phases
  664. (delete 'configure)
  665. (delete 'build)
  666. (replace 'install
  667. (install-pom-file "pom.xml")))))
  668. (propagated-inputs
  669. `(("maven-parent-pom-33" ,maven-parent-pom-33)))
  670. (native-inputs
  671. `(("unzip" ,unzip)))))
  672. (define-public maven-wagon-provider-test
  673. (package
  674. (inherit maven-wagon-provider-api)
  675. (name "maven-wagon-provider-test")
  676. (arguments
  677. `(#:jar-name "maven-wagon-provider-test.jar"
  678. #:source-dir "wagon-provider-test/src/main/java"
  679. #:tests? #f; no tests
  680. #:jdk ,icedtea-8))
  681. (inputs
  682. `(("java-plexus-utils" ,java-plexus-utils)
  683. ("java-plexus-container-default" ,java-plexus-container-default)
  684. ("java-eclipse-jetty-http-9.2" ,java-eclipse-jetty-http-9.2)
  685. ("java-eclipse-jetty-util-9.2" ,java-eclipse-jetty-util-9.2)
  686. ("java-eclipse-jetty-security-9.2" ,java-eclipse-jetty-security-9.2)
  687. ("java-eclipse-jetty-server-9.2" ,java-eclipse-jetty-server-9.2)
  688. ("java-eclipse-jetty-servlet-9.2" ,java-eclipse-jetty-servlet-9.2)
  689. ("java-slf4j-api" ,java-slf4j-api)
  690. ("java-javaee-servletapi" ,java-javaee-servletapi)
  691. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  692. (synopsis "Test classes from maven-wagon")
  693. (description "Maven Wagon is a transport abstraction that is used in Maven's
  694. artifact and repository handling code. This package contains common test
  695. classes used in multiple maven-wagon components.")))
  696. (define-public maven-wagon-file
  697. (package
  698. (inherit maven-wagon-provider-api)
  699. (name "maven-wagon-file")
  700. (arguments
  701. `(#:jar-name "maven-wagon-file.jar"
  702. #:source-dir "wagon-providers/wagon-file/src/main/java"
  703. #:test-dir "wagon-providers/wagon-file/src/test"
  704. #:jdk ,icedtea-8
  705. #:phases
  706. (modify-phases %standard-phases
  707. (add-before 'check 'fix-paths
  708. (lambda _
  709. ;; Tests assume they are run by maven, which copies test resources
  710. ;; to target. Our ant-build-system does the same, but with the
  711. ;; build directory.
  712. (substitute* "wagon-providers/wagon-file/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java"
  713. (("target") "build"))
  714. #t))
  715. (add-after 'build 'generate-metadata
  716. (lambda _
  717. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  718. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  719. "--source" "wagon-providers/wagon-file/src/main/java"
  720. "--output" "build/classes/META-INF/plexus/components.xml"
  721. "--classes" "build/classes"
  722. "--descriptors" "build/classes/META-INF")
  723. #t))
  724. (add-after 'generate-metadata 'rebuild
  725. (lambda _
  726. (invoke "ant" "jar")
  727. #t)))))
  728. (inputs
  729. `(("java-plexus-utils" ,java-plexus-utils)
  730. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  731. (native-inputs
  732. `(("maven-wagon-provider-test" ,maven-wagon-provider-test)
  733. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  734. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  735. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  736. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  737. ("java-plexus-classworlds" ,java-plexus-classworlds)
  738. ("java-guava" ,java-guava)
  739. ("java-guice" ,java-guice)
  740. ("java-javax-inject" ,java-javax-inject)
  741. ("java-cglib" ,java-cglib)
  742. ("java-slf4j-api" ,java-slf4j-api)
  743. ("java-plexus-utils" ,java-plexus-utils)
  744. ("java-plexus-cli" ,java-plexus-cli)
  745. ("maven-plugin-api" ,maven-plugin-api)
  746. ("maven-plugin-annotations" ,maven-plugin-annotations)
  747. ("maven-core" ,maven-core)
  748. ("maven-model" ,maven-model)
  749. ("java-commons-cli" ,java-commons-cli)
  750. ("java-qdox" ,java-qdox)
  751. ("java-jdom2" ,java-jdom2)
  752. ("java-asm" ,java-asm)
  753. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  754. ,@(package-native-inputs maven-wagon-provider-api)))
  755. (synopsis "Wagon provider that gets and puts artifacts using the file system")
  756. (description "Maven Wagon is a transport abstraction that is used in Maven's
  757. artifact and repository handling code. It uses providers, that are tools to
  758. manage artifacts and deployment. This package contains the file provider which
  759. gets and puts artifacts using the file system.")))
  760. (define-public maven-wagon-tck-http
  761. (package
  762. (inherit maven-wagon-provider-api)
  763. (name "maven-wagon-tck-http")
  764. (arguments
  765. `(#:jar-name "maven-wagon-tck-http.jar"
  766. #:source-dir "wagon-tcks/wagon-tck-http/src/main/java"
  767. #:tests? #f; no tests
  768. #:jdk ,icedtea-8))
  769. (inputs
  770. `(("java-plexus-util" ,java-plexus-utils)
  771. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  772. ("java-javaee-servletapi" ,java-javaee-servletapi)
  773. ("java-slf4j-api" ,java-slf4j-api)
  774. ("java-commons-codec" ,java-commons-codec)
  775. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  776. ("java-plexus-classworlds" ,java-plexus-classworlds)
  777. ("java-eclipse-jetty-util-9.2" ,java-eclipse-jetty-util-9.2)
  778. ("java-eclipse-jetty-webapp-9.2" ,java-eclipse-jetty-webapp-9.2)
  779. ("java-eclipse-jetty-security-9.2" ,java-eclipse-jetty-security-9.2)
  780. ("java-eclipse-jetty-server-9.2" ,java-eclipse-jetty-server-9.2)
  781. ("java-eclipse-jetty-servlet-9.2" ,java-eclipse-jetty-servlet-9.2)))
  782. (synopsis "Wagon HTTP Test Compatibility Kit")
  783. (description "Maven Wagon is a transport abstraction that is used in Maven's
  784. artifact and repository handling code. This package contains the HTTP
  785. Test Compatibility Kit.")))
  786. (define-public maven-wagon-http-shared
  787. (package
  788. (inherit maven-wagon-provider-api)
  789. (name "maven-wagon-http-shared")
  790. (arguments
  791. `(#:jar-name "maven-wagon-http-shared.jar"
  792. #:source-dir "wagon-providers/wagon-http-shared/src/main/java"
  793. #:test-dir "wagon-providers/wagon-http-shared/src/test"
  794. #:jdk ,icedtea-8
  795. #:phases
  796. (modify-phases %standard-phases
  797. (add-after 'build 'generate-metadata
  798. (lambda _
  799. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  800. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  801. "--source" "wagon-providers/wagon-http-shared/src/main/java"
  802. "--output" "build/classes/META-INF/plexus/components.xml"
  803. "--classes" "build/classes"
  804. "--descriptors" "build/classes/META-INF")
  805. #t))
  806. (add-after 'generate-metadata 'rebuild
  807. (lambda _
  808. (invoke "ant" "jar")
  809. #t)))))
  810. (inputs
  811. `(("java-plexus-utils" ,java-plexus-utils)
  812. ("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
  813. ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
  814. ("java-commons-io" ,java-commons-io)
  815. ("java-jsoup" ,java-jsoup)
  816. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  817. (native-inputs
  818. `(("maven-wagon-provider-test" ,maven-wagon-provider-test)
  819. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  820. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  821. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  822. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  823. ("java-plexus-classworlds" ,java-plexus-classworlds)
  824. ("java-guava" ,java-guava)
  825. ("java-guice" ,java-guice)
  826. ("java-javax-inject" ,java-javax-inject)
  827. ("java-cglib" ,java-cglib)
  828. ("java-slf4j-api" ,java-slf4j-api)
  829. ("java-plexus-utils" ,java-plexus-utils)
  830. ("java-plexus-cli" ,java-plexus-cli)
  831. ("maven-plugin-api" ,maven-plugin-api)
  832. ("maven-plugin-annotations" ,maven-plugin-annotations)
  833. ("maven-core" ,maven-core)
  834. ("maven-model" ,maven-model)
  835. ("java-commons-cli" ,java-commons-cli)
  836. ("java-qdox" ,java-qdox)
  837. ("java-jdom2" ,java-jdom2)
  838. ("java-asm" ,java-asm)
  839. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  840. ,@(package-native-inputs maven-wagon-provider-api)))
  841. (synopsis "Shared Library for wagon providers supporting HTTP.")
  842. (description "Maven Wagon is a transport abstraction that is used in Maven's
  843. artifact and repository handling code. It uses providers, that are tools to
  844. manage artifacts and deployment. This package contains a shared library for
  845. wagon providers supporting HTTP.")))
  846. (define-public maven-wagon-http
  847. (package
  848. (inherit maven-wagon-provider-api)
  849. (name "maven-wagon-http")
  850. (arguments
  851. `(#:jar-name "maven-wagon-http.jar"
  852. #:source-dir "wagon-providers/wagon-http/src/main/java"
  853. #:test-dir "wagon-providers/wagon-http/src/test"
  854. #:test-exclude (list
  855. "**/Abstract*.java"
  856. ;; FIXME: javax.net.ssl.SSLHandshakeException:
  857. ;; sun.security.validator.ValidatorException:
  858. ;; PKIX path building failed:
  859. ;; sun.security.provider.certpath.SunCertPathBuilderException:
  860. ;; unable to find valid certification path to requested target
  861. "**/HttpsWagonPreemptiveTest.java"
  862. "**/HttpsWagonTest.java"
  863. ;; Timeout
  864. "**/HugeFileDownloadTest.java"
  865. ;; Injection errors
  866. "**/TckTest.java")
  867. #:jdk ,icedtea-8
  868. #:phases
  869. (modify-phases %standard-phases
  870. (add-before 'build 'copy-resources
  871. (lambda _
  872. (install-file "wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml"
  873. "build/classes/META-INF/plexus")
  874. #t))
  875. (add-before 'check 'fix-resource-path
  876. (lambda _
  877. (substitute* '("wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java"
  878. "wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java")
  879. (("src/test") "wagon-providers/wagon-http/src/test"))
  880. #t)))))
  881. (inputs
  882. `(("java-plexus-utils" ,java-plexus-utils)
  883. ("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
  884. ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
  885. ("maven-wagon-http-shared" ,maven-wagon-http-shared)
  886. ("maven-wagon-tck-http" ,maven-wagon-tck-http)
  887. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  888. (native-inputs
  889. `(("maven-wagon-provider-test" ,maven-wagon-provider-test)
  890. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  891. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  892. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  893. ("java-plexus-container-default" ,java-plexus-container-default)
  894. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  895. ("java-plexus-classworlds" ,java-plexus-classworlds)
  896. ("java-guava" ,java-guava)
  897. ("java-guice" ,java-guice)
  898. ("java-inject" ,java-javax-inject)
  899. ("java-cglib" ,java-cglib)
  900. ("java-slf4j-api" ,java-slf4j-api)
  901. ("java-plexus-utils" ,java-plexus-utils)
  902. ("java-plexus-cli" ,java-plexus-cli)
  903. ("maven-plugin-api" ,maven-plugin-api)
  904. ("maven-plugin-annotations" ,maven-plugin-annotations)
  905. ("maven-core" ,maven-core)
  906. ("maven-model" ,maven-model)
  907. ("java-commons-cli" ,java-commons-cli)
  908. ("java-qdox" ,java-qdox)
  909. ("java-jdom2" ,java-jdom2)
  910. ("java-asm" ,java-asm)
  911. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  912. ("java-javaee-servletapi" ,java-javaee-servletapi)
  913. ("java-eclipse-jetty-util-9.2" ,java-eclipse-jetty-util-9.2)
  914. ("java-eclipse-jetty-io-9.2" ,java-eclipse-jetty-io-9.2)
  915. ("java-eclipse-jetty-http-9.2" ,java-eclipse-jetty-http-9.2)
  916. ("java-eclipse-jetty-server-9.2" ,java-eclipse-jetty-server-9.2)
  917. ("java-eclipse-jetty-servlet-9.2" ,java-eclipse-jetty-servlet-9.2)
  918. ("java-eclipse-jetty-security-9.2" ,java-eclipse-jetty-security-9.2)
  919. ("java-hamcrest-core" ,java-hamcrest-core)
  920. ("java-commons-logging-minimal" ,java-commons-logging-minimal)
  921. ("java-commons-codec" ,java-commons-codec)
  922. ("java-commons-io" ,java-commons-io)
  923. ("java-jsoup" ,java-jsoup)
  924. ("java-slf4j-simple" ,java-slf4j-simple)
  925. ,@(package-native-inputs maven-wagon-provider-api)))
  926. (synopsis "Wagon provider that gets and puts artifacts through HTTP(S)")
  927. (description "Maven Wagon is a transport abstraction that is used in Maven's
  928. artifact and repository handling code. It uses providers, that are tools to
  929. manage artifacts and deployment. This package contains a Wagon provider that
  930. gets and puts artifacts through HTTP(S) using Apache HttpClient-4.x.")))
  931. (define maven-pom
  932. (package
  933. (name "maven-pom")
  934. (version "3.6.1")
  935. (source (origin
  936. (method url-fetch)
  937. (uri (string-append "mirror://apache/maven/"
  938. "maven-3/" version "/source/"
  939. "apache-maven-" version "-src.tar.gz"))
  940. (sha256 (base32 "0grw9zp166ci53rd7qkyy2qmwmik37xhiz1z84jpm0msyvzj2n82"))
  941. (modules '((guix build utils)))
  942. (snippet
  943. '(begin
  944. (for-each delete-file (find-files "." "\\.jar$"))
  945. #t))
  946. (patches
  947. (search-patches "maven-generate-component-xml.patch"
  948. "maven-generate-javax-inject-named.patch"))))
  949. (build-system ant-build-system)
  950. (arguments
  951. `(#:tests? #f
  952. #:phases
  953. (modify-phases %standard-phases
  954. (delete 'configure)
  955. (delete 'build)
  956. (add-before 'install 'fix-dependencies
  957. (lambda _
  958. (substitute* "pom.xml"
  959. (("classWorldsVersion>.*")
  960. (string-append
  961. "classWorldsVersion>"
  962. ,(package-version java-plexus-classworlds)
  963. "</classWorldsVersion>\n"))
  964. (("commonsCliVersion>.*")
  965. (string-append
  966. "commonsCliVersion>"
  967. ,(package-version java-commons-cli)
  968. "</commonsCliVersion>\n"))
  969. (("commonsLangVersion>.*")
  970. (string-append
  971. "commonsLangVersion>"
  972. ,(package-version java-commons-lang3)
  973. "</commonsLangVersion>\n"))
  974. (("plexusUtilsVersion>.*")
  975. (string-append
  976. "plexusUtilsVersion>"
  977. ,(package-version java-plexus-utils)
  978. "</plexusUtilsVersion>\n"))
  979. (("plexusInterpolationVersion>.*")
  980. (string-append
  981. "plexusInterpolationVersion>"
  982. ,(package-version java-plexus-interpolation)
  983. "</plexusInterpolationVersion>\n"))
  984. (("guiceVersion>.*")
  985. (string-append
  986. "guiceVersion>"
  987. ,(package-version java-guice)
  988. "</guiceVersion>\n"))
  989. (("sisuInjectVersion>.*")
  990. (string-append
  991. "sisuInjectVersion>"
  992. ,(package-version java-eclipse-sisu-inject)
  993. "</sisuInjectVersion>\n"))
  994. (("securityDispatcherVersion>.*")
  995. (string-append
  996. "securityDispatcherVersion>"
  997. ,(package-version java-plexus-sec-dispatcher)
  998. "</securityDispatcherVersion>\n"))
  999. (("cipherVersion>.*")
  1000. (string-append
  1001. "cipherVersion>"
  1002. ,(package-version java-plexus-cipher)
  1003. "</cipherVersion>\n"))
  1004. (("slf4jVersion>.*")
  1005. (string-append
  1006. "slf4jVersion>"
  1007. ,(package-version java-slf4j-api)
  1008. "</slf4jVersion>\n"))
  1009. (("<classifier>no_aop</classifier>") ""))
  1010. #t))
  1011. (replace 'install
  1012. (install-pom-file "pom.xml")))))
  1013. (propagated-inputs
  1014. `(("maven-parent-pom-33" ,maven-parent-pom-33)))
  1015. (home-page "https://maven.apache.org/")
  1016. (synopsis "Build system")
  1017. (description "Apache Maven is a software project management and comprehension
  1018. tool. This package contains the Maven pom file, used by all maven components.")
  1019. (license license:asl2.0)))
  1020. (define-public maven-artifact
  1021. (package
  1022. (inherit maven-pom)
  1023. (name "maven-artifact")
  1024. (arguments
  1025. `(#:jar-name "maven-artifact.jar"
  1026. #:source-dir "maven-artifact/src/main/java"
  1027. #:test-dir "maven-artifact/src/test"
  1028. #:main-class "org.apache.maven.artifact.versioning.ComparableVersion"
  1029. #:phases
  1030. (modify-phases %standard-phases
  1031. (replace 'install
  1032. (install-from-pom "maven-artifact/pom.xml")))))
  1033. (propagated-inputs
  1034. `(("java-plexus-utils" ,java-plexus-utils)
  1035. ("java-commons-lang3" ,java-commons-lang3)
  1036. ("maven-pom" ,maven-pom)))
  1037. (native-inputs
  1038. `(("java-junit" ,java-junit)))
  1039. (description "Apache Maven is a software project management and comprehension
  1040. tool. This package contains the Maven Artifact classes, providing the
  1041. @code{Artifact} interface, with its @code{DefaultArtifact} implementation. The
  1042. jar file is executable and provides a little tool to display how Maven parses
  1043. and compares versions:")))
  1044. (define-public maven-model
  1045. (package
  1046. (inherit maven-artifact)
  1047. (name "maven-model")
  1048. (arguments
  1049. `(#:jar-name "maven-model.jar"
  1050. #:source-dir "maven-model/src/main/java"
  1051. #:test-dir "maven-model/src/test"
  1052. #:phases
  1053. (modify-phases %standard-phases
  1054. (add-before 'build 'generate-models
  1055. (lambda* (#:key inputs #:allow-other-keys)
  1056. (define (modello-single-mode file version mode)
  1057. (invoke "java" "org.codehaus.modello.ModelloCli"
  1058. file mode "maven-model/src/main/java" version
  1059. "false" "true"))
  1060. (let ((file "maven-model/src/main/mdo/maven.mdo"))
  1061. (modello-single-mode file "4.0.0" "java")
  1062. (modello-single-mode file "4.0.0" "xpp3-reader")
  1063. (modello-single-mode file "4.0.0" "xpp3-writer")
  1064. (modello-single-mode file "4.0.0" "xpp3-extended-reader"))
  1065. #t))
  1066. (replace 'install (install-from-pom "maven-model/pom.xml")))))
  1067. (propagated-inputs
  1068. `(("java-commons-lang3" ,java-commons-lang3)
  1069. ("java-plexus-utils" ,java-plexus-utils)
  1070. ("maven-pom" ,maven-pom)))
  1071. (native-inputs
  1072. `(("java-modello-core" ,java-modello-core)
  1073. ;; for modello:
  1074. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1075. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1076. ("java-guice" ,java-guice)
  1077. ("java-cglib" ,java-cglib)
  1078. ("java-asm" ,java-asm)
  1079. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1080. ("java-javax-inject" ,java-javax-inject)
  1081. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1082. ("java-guava" ,java-guava)
  1083. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1084. ("java-sisu-build-api" ,java-sisu-build-api)
  1085. ;; modello plugins:
  1086. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1087. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1088. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1089. ;; for tests
  1090. ("java-junit" ,java-junit)))
  1091. (description "Apache Maven is a software project management and comprehension
  1092. tool. This package contains the model for Maven @dfn{POM} (Project Object Model),
  1093. so really just plain Java objects.")))
  1094. (define-public maven-builder-support
  1095. (package
  1096. (inherit maven-artifact)
  1097. (name "maven-builder-support")
  1098. (arguments
  1099. `(#:jar-name "maven-builder-support.jar"
  1100. #:source-dir "maven-builder-support/src/main/java"
  1101. #:jdk ,icedtea-8
  1102. #:test-dir "maven-builder-support/src/test"
  1103. #:phases
  1104. (modify-phases %standard-phases
  1105. (add-before 'check 'fix-paths
  1106. (lambda _
  1107. (with-directory-excursion "maven-builder-support/src/test/java"
  1108. (substitute*
  1109. '("org/apache/maven/building/FileSourceTest.java"
  1110. "org/apache/maven/building/UrlSourceTest.java")
  1111. (("target/test-classes") "maven-builder-support/src/test/resources")))
  1112. #t))
  1113. (replace 'install (install-from-pom "maven-builder-support/pom.xml")))))
  1114. (propagated-inputs
  1115. `(("maven-pom" ,maven-pom)))
  1116. (native-inputs
  1117. `(("java-junit" ,java-junit)))
  1118. (description "Apache Maven is a software project management and comprehension
  1119. tool. This package contains a support library for descriptor builders (model,
  1120. setting, toolchains)")))
  1121. (define-public maven-settings
  1122. (package
  1123. (inherit maven-artifact)
  1124. (name "maven-settings")
  1125. (arguments
  1126. `(#:jar-name "maven-settings.jar"
  1127. #:source-dir "maven-settings/src/main/java"
  1128. #:tests? #f; no tests
  1129. #:phases
  1130. (modify-phases %standard-phases
  1131. (add-before 'build 'generate-models
  1132. (lambda* (#:key inputs #:allow-other-keys)
  1133. (define (modello-single-mode file version mode)
  1134. (invoke "java" "org.codehaus.modello.ModelloCli"
  1135. file mode "maven-settings/src/main/java" version
  1136. "false" "true"))
  1137. (let ((file "maven-settings/src/main/mdo/settings.mdo"))
  1138. (modello-single-mode file "1.1.0" "java")
  1139. (modello-single-mode file "1.1.0" "xpp3-reader")
  1140. (modello-single-mode file "1.1.0" "xpp3-writer"))
  1141. #t))
  1142. (replace 'install (install-from-pom "maven-settings/pom.xml")))))
  1143. (propagated-inputs
  1144. `(("java-plexus-utils" ,java-plexus-utils)
  1145. ("maven-pom" ,maven-pom)))
  1146. (native-inputs
  1147. `(("java-modello-core" ,java-modello-core)
  1148. ;; for modello:
  1149. ;("container" ,java-plexus-container-default)
  1150. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1151. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1152. ("java-guice" ,java-guice)
  1153. ("java-cglib" ,java-cglib)
  1154. ("java-asm" ,java-asm)
  1155. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1156. ("java-javax-inject" ,java-javax-inject)
  1157. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1158. ("java-plexus-utils" ,java-plexus-utils)
  1159. ("java-guava" ,java-guava)
  1160. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1161. ("java-sisu-build-api" ,java-sisu-build-api)
  1162. ;; modello plugins:
  1163. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1164. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1165. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)))
  1166. (description "Apache Maven is a software project management and comprehension
  1167. tool. This package contains strictly the model for Maven settings, that is
  1168. simply plain java objects.")))
  1169. (define-public maven-settings-builder
  1170. (package
  1171. (inherit maven-artifact)
  1172. (name "maven-settings-builder")
  1173. (arguments
  1174. `(#:jar-name "maven-settings-builder.jar"
  1175. #:source-dir "maven-settings-builder/src/main/java"
  1176. #:jdk ,icedtea-8
  1177. #:test-dir "maven-settings-builder/src/test"
  1178. #:phases
  1179. (modify-phases %standard-phases
  1180. (add-before 'build 'generate-components.xml
  1181. (lambda _
  1182. (mkdir-p "build/classes/META-INF/plexus")
  1183. (chmod "components.sh" #o755)
  1184. (invoke "./components.sh" "maven-settings-builder/src/main/java"
  1185. "build/classes/META-INF/plexus/components.xml")
  1186. #t))
  1187. (replace 'install (install-from-pom "maven-settings-builder/pom.xml")))))
  1188. (propagated-inputs
  1189. `(("java-plexus-utils" ,java-plexus-utils)
  1190. ("java-plexus-interpolation" ,java-plexus-interpolation)
  1191. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1192. ("maven-builder-support" ,maven-builder-support)
  1193. ("maven-settings" ,maven-settings)
  1194. ("maven-pom" ,maven-pom)))
  1195. (native-inputs
  1196. `(("java-junit" ,java-junit)
  1197. ("java-plexus-component-annotations" ,java-plexus-component-annotations)))
  1198. (description "Apache Maven is a software project management and comprehension
  1199. tool. This package contains the effective model builder, with profile activation,
  1200. inheritance, interpolation, @dots{}")))
  1201. (define-public maven-model-builder
  1202. (package
  1203. (inherit maven-artifact)
  1204. (name "maven-model-builder")
  1205. (arguments
  1206. `(#:jar-name "maven-model-builder.jar"
  1207. #:source-dir "maven-model-builder/src/main/java"
  1208. #:jdk ,icedtea-8
  1209. #:test-dir "maven-model-builder/src/test"
  1210. #:phases
  1211. (modify-phases %standard-phases
  1212. (add-before 'build 'copy-resources
  1213. (lambda _
  1214. (copy-recursively "maven-model-builder/src/main/resources"
  1215. "build/classes")
  1216. #t))
  1217. (add-before 'build 'generate-components.xml
  1218. (lambda _
  1219. (mkdir-p "build/classes/META-INF/plexus")
  1220. (chmod "components.sh" #o755)
  1221. (invoke "./components.sh" "maven-model-builder/src/main/java"
  1222. "build/classes/META-INF/plexus/components.xml")
  1223. #t))
  1224. (add-before 'check 'fix-paths
  1225. (lambda _
  1226. (substitute* (find-files "maven-model-builder/src/test/java" ".*.java")
  1227. (("src/test") "maven-model-builder/src/test"))
  1228. #t))
  1229. (replace 'install
  1230. (install-from-pom "maven-model-builder/pom.xml")))))
  1231. (propagated-inputs
  1232. `(("java-plexus-interpolation" ,java-plexus-interpolation)
  1233. ("java-plexus-utils" ,java-plexus-utils)
  1234. ("maven-artifact" ,maven-artifact)
  1235. ("maven-builder-support" ,maven-builder-support)
  1236. ("maven-model" ,maven-model)
  1237. ("maven-pom" ,maven-pom)))
  1238. (native-inputs
  1239. `(("java-junit" ,java-junit)
  1240. ("java-guava" ,java-guava)
  1241. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1242. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1243. ("guice" ,java-guice)
  1244. ("java-cglib" ,java-cglib)
  1245. ("java-asm" ,java-asm)
  1246. ("sisu-inject" ,java-eclipse-sisu-inject)
  1247. ("javax-inject" ,java-javax-inject)
  1248. ("java-xmlunit" ,java-xmlunit)
  1249. ("java-xmlunit-matchers" ,java-xmlunit-matchers)
  1250. ("xbean" ,java-geronimo-xbean-reflect)
  1251. ("classworlds" ,java-plexus-classworlds)))
  1252. (description "Apache Maven is a software project management and comprehension
  1253. tool. This package contains the effective model builder, with profile activation,
  1254. inheritance, interpolation, @dots{}")))
  1255. (define-public maven-repository-metadata
  1256. (package
  1257. (inherit maven-artifact)
  1258. (name "maven-repository-metadata")
  1259. (arguments
  1260. `(#:jar-name "maven-repository-metadata.jar"
  1261. #:source-dir "maven-repository-metadata/src/main/java"
  1262. #:jdk ,icedtea-8
  1263. #:tests? #f; no tests
  1264. #:phases
  1265. (modify-phases %standard-phases
  1266. (add-before 'build 'generate-models
  1267. (lambda* (#:key inputs #:allow-other-keys)
  1268. (define (modello-single-mode file version mode)
  1269. (invoke "java" "org.codehaus.modello.ModelloCli"
  1270. file mode "maven-repository-metadata/src/main/java" version
  1271. "false" "true"))
  1272. (let ((file "maven-repository-metadata/src/main/mdo/metadata.mdo"))
  1273. (modello-single-mode file "1.1.0" "java")
  1274. (modello-single-mode file "1.1.0" "xpp3-reader")
  1275. (modello-single-mode file "1.1.0" "xpp3-writer"))
  1276. #t))
  1277. (replace 'install
  1278. (install-from-pom "maven-repository-metadata/pom.xml")))))
  1279. (propagated-inputs
  1280. `(("java-plexus-utils" ,java-plexus-utils)
  1281. ("maven-pom" ,maven-pom)))
  1282. (native-inputs
  1283. `(("modello" ,java-modello-core)
  1284. ;; for modello:
  1285. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1286. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1287. ("java-guice" ,java-guice)
  1288. ("java-cglib" ,java-cglib)
  1289. ("java-asm" ,java-asm)
  1290. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1291. ("java-javax-inject" ,java-javax-inject)
  1292. ("java-plexus-utils" ,java-plexus-utils)
  1293. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1294. ("java-guava" ,java-guava)
  1295. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1296. ("java-sisu-build-api" ,java-sisu-build-api)
  1297. ;; modello plugins:
  1298. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1299. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1300. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)))
  1301. (description "Apache Maven is a software project management and comprehension
  1302. tool. This package contains strictly the model for Maven Repository Metadata,
  1303. so really just plain objects.")))
  1304. (define-public maven-resolver-provider
  1305. (package
  1306. (inherit maven-artifact)
  1307. (name "maven-resolver-provider")
  1308. (arguments
  1309. `(#:jar-name "maven-resolver-provider.jar"
  1310. #:source-dir "maven-resolver-provider/src/main/java"
  1311. #:test-dir "maven-resolver-provider/src/test"
  1312. #:jdk ,icedtea-8
  1313. #:tests? #f; dependency loop on maven-core (@Component RepositorySystem)
  1314. #:phases
  1315. (modify-phases %standard-phases
  1316. (add-before 'build 'generate-sisu-named
  1317. (lambda _
  1318. (mkdir-p "build/classes/META-INF/sisu")
  1319. (chmod "./sisu.sh" #o755)
  1320. (invoke "./sisu.sh" "maven-resolver-provider/src/main/java"
  1321. "build/classes/META-INF/sisu/javax.inject.Named")
  1322. #t))
  1323. (replace 'install
  1324. (install-from-pom "maven-resolver-provider/pom.xml")))))
  1325. (propagated-inputs
  1326. `(("maven-model" ,maven-model)
  1327. ("maven-model-builder" ,maven-model-builder)
  1328. ("maven-resolver-spi" ,maven-resolver-spi)
  1329. ("maven-resolver-api" ,maven-resolver-api)
  1330. ("maven-resolver-impl" ,maven-resolver-impl)
  1331. ("maven-resolver-util" ,maven-resolver-util)
  1332. ("maven-builder-support" ,maven-builder-support)
  1333. ("maven-repository-metadata" ,maven-repository-metadata)
  1334. ("java-plexus-utils" ,java-plexus-utils)
  1335. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1336. ("java-guice" ,java-guice)
  1337. ("java-javax-inject" ,java-javax-inject)))))
  1338. (define-public maven-plugin-api
  1339. (package
  1340. (inherit maven-artifact)
  1341. (name "maven-plugin-api")
  1342. (arguments
  1343. `(#:jar-name "maven-plugin-api.jar"
  1344. #:source-dir "maven-plugin-api/src/main/java"
  1345. #:jdk ,icedtea-8
  1346. #:test-dir "maven-plugin-api/src/test"
  1347. #:phases
  1348. (modify-phases %standard-phases
  1349. (add-before 'build 'generate-models
  1350. (lambda* (#:key inputs #:allow-other-keys)
  1351. (define (modello-single-mode file version mode)
  1352. (invoke "java" "org.codehaus.modello.ModelloCli"
  1353. file mode "maven-plugin-api/src/main/java" version
  1354. "false" "true"))
  1355. (let ((file "maven-plugin-api/src/main/mdo/lifecycle.mdo"))
  1356. (modello-single-mode file "1.0.0" "java")
  1357. (modello-single-mode file "1.0.0" "xpp3-reader")
  1358. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1359. #t))
  1360. (replace 'install
  1361. (install-from-pom "maven-plugin-api/pom.xml")))))
  1362. (propagated-inputs
  1363. `(("maven-artifact" ,maven-artifact)
  1364. ("maven-model" ,maven-model)
  1365. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1366. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1367. ("guice" ,java-guice)
  1368. ("java-cglib" ,java-cglib)
  1369. ("java-asm" ,java-asm)
  1370. ("sisu-inject" ,java-eclipse-sisu-inject)
  1371. ("javax-inject" ,java-javax-inject)
  1372. ("utils" ,java-plexus-utils)))
  1373. (native-inputs
  1374. `(("modello" ,java-modello-core)
  1375. ;; for modello:
  1376. ("classworlds" ,java-plexus-classworlds)
  1377. ("guava" ,java-guava)
  1378. ("xbean" ,java-geronimo-xbean-reflect)
  1379. ("build-api" ,java-sisu-build-api)
  1380. ;; modello plugins:
  1381. ("java" ,java-modello-plugins-java)
  1382. ("xml" ,java-modello-plugins-xml)
  1383. ("xpp3" ,java-modello-plugins-xpp3)
  1384. ;; for tests
  1385. ("java-junit" ,java-junit)))
  1386. (description "Apache Maven is a software project management and comprehension
  1387. tool. This package contains strictly the API for plugins -- composed of goals
  1388. implemented by Mojos -- development.
  1389. A plugin is described in a @file{META-INF/maven/plugin.xml} plugin descriptor,
  1390. generally generated from plugin sources using maven-plugin-plugin.")))
  1391. (define-public maven-core-bootstrap
  1392. (hidden-package
  1393. (package
  1394. (inherit maven-artifact)
  1395. (name "maven-core")
  1396. (arguments
  1397. `(#:jar-name "maven-core.jar"
  1398. #:source-dir "src/main/java"
  1399. #:jdk ,icedtea-8
  1400. ;; Tests need maven-compat, which requires maven-core
  1401. #:tests? #f
  1402. #:phases
  1403. (modify-phases %standard-phases
  1404. (add-before 'configure 'chdir
  1405. (lambda _
  1406. ;; Required for generating components.xml in maven-core
  1407. (chdir "maven-core")
  1408. #t))
  1409. (add-before 'build 'copy-resources
  1410. (lambda _
  1411. (mkdir-p "build/classes/")
  1412. (copy-recursively "src/main/resources" "build/classes")
  1413. #t))
  1414. (add-after 'copy-resources 'fill-properties
  1415. (lambda _
  1416. ;; This file controls the output of some mvn subcommands, such as
  1417. ;; mvn -version.
  1418. (substitute* "build/classes/org/apache/maven/messages/build.properties"
  1419. (("\\$\\{buildNumber\\}") "guix_build")
  1420. (("\\$\\{timestamp\\}") "0")
  1421. (("\\$\\{project.version\\}") ,(package-version maven-artifact))
  1422. (("\\$\\{distributionId\\}") "apache-maven")
  1423. (("\\$\\{distributionShortName\\}") "Maven")
  1424. (("\\$\\{distributionName\\}") "Apache Maven"))
  1425. #t))
  1426. (add-before 'build 'generate-sisu-named
  1427. (lambda _
  1428. (mkdir-p "build/classes/META-INF/sisu")
  1429. (chmod "../sisu.sh" #o755)
  1430. (invoke "../sisu.sh" "src/main/java"
  1431. "build/classes/META-INF/sisu/javax.inject.Named")
  1432. #t))
  1433. (add-before 'build 'generate-models
  1434. (lambda* (#:key inputs #:allow-other-keys)
  1435. (define (modello-single-mode file version mode)
  1436. (invoke "java" "org.codehaus.modello.ModelloCli"
  1437. file mode "src/main/java" version
  1438. "false" "true"))
  1439. (let ((file "src/main/mdo/toolchains.mdo"))
  1440. (modello-single-mode file "1.1.0" "java")
  1441. (modello-single-mode file "1.1.0" "xpp3-reader")
  1442. (modello-single-mode file "1.1.0" "xpp3-writer"))
  1443. #t))
  1444. (add-before 'install 'fix-pom
  1445. (lambda _
  1446. (substitute* "pom.xml"
  1447. (("<classifier>no_aop</classifier>") ""))
  1448. #t))
  1449. (replace 'install
  1450. (install-from-pom "pom.xml")))))
  1451. (propagated-inputs
  1452. `(("maven-artifact" ,maven-artifact)
  1453. ("maven-resolver-provider" ,maven-resolver-provider)
  1454. ("maven-builder-support" ,maven-builder-support)
  1455. ("maven-model" ,maven-model)
  1456. ("maven-model-builder" ,maven-model-builder)
  1457. ("maven-settings" ,maven-settings)
  1458. ("maven-settings-builder" ,maven-settings-builder)
  1459. ("maven-plugin-api" ,maven-plugin-api)
  1460. ("maven-repository-metadata" ,maven-repository-metadata)
  1461. ("maven-shared-utils" ,maven-shared-utils)
  1462. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1463. ("java-plexus-utils" ,java-plexus-utils)
  1464. ("java-commons-lang3" ,java-commons-lang3)
  1465. ("java-guava" ,java-guava)
  1466. ("java-guice" ,java-guice)
  1467. ("maven-resolver-api" ,maven-resolver-api)
  1468. ("maven-resolver-spi" ,maven-resolver-spi)
  1469. ("maven-resolver-util" ,maven-resolver-util)
  1470. ("maven-resolver-impl" ,maven-resolver-impl)
  1471. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1472. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1473. ("java-javax-inject" ,java-javax-inject)
  1474. ("java-plexus-classworld" ,java-plexus-classworlds)))
  1475. (native-inputs
  1476. `(("java-modello-core" ,java-modello-core)
  1477. ("java-cglib" ,java-cglib)
  1478. ("java-asm" ,java-asm)
  1479. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1480. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1481. ("java-sisu-build-api" ,java-sisu-build-api)
  1482. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1483. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1484. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1485. ;; tests
  1486. ("java-junit" ,java-junit)
  1487. ("java-mockito-1" ,java-mockito-1)
  1488. ("java-commons-jxpath" ,java-commons-jxpath)))
  1489. (description "Apache Maven is a software project management and comprehension
  1490. tool. This package contains the maven core classes managing the whole build
  1491. process."))))
  1492. (define-public maven-core
  1493. (package
  1494. (inherit maven-core-bootstrap)
  1495. (arguments
  1496. (substitute-keyword-arguments (package-arguments maven-core-bootstrap)
  1497. ((#:phases phases)
  1498. `(modify-phases ,phases
  1499. (add-before 'build 'modify-metainf
  1500. (lambda _
  1501. (substitute* "build.xml"
  1502. (("message=\"\"")
  1503. (string-append "message=\"Implementation-Version: "
  1504. (package-version maven) "\n\"")))
  1505. #t))
  1506. (add-before 'build 'add-maven-files
  1507. (lambda _
  1508. (mkdir-p "build/classes/META-INF/maven/org.apache.maven/maven-core")
  1509. (copy-file "pom.xml"
  1510. "build/classes/META-INF/maven/org.apache.maven/maven-core/pom.xml")
  1511. (with-output-to-file "build/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties"
  1512. (lambda _
  1513. (format #t "version=~a~%
  1514. groupId=org.apache.maven~%
  1515. artifactId=maven-core" ,(package-version maven-core-bootstrap))))
  1516. #t))
  1517. (add-after 'build 'generate-metadata
  1518. (lambda _
  1519. (define (components file)
  1520. (let ((sxml (with-input-from-file file
  1521. (lambda _ (xml->sxml (current-input-port)
  1522. #:trim-whitespace? #t)))))
  1523. ;; Select the list of <component>s inside the <component-set>
  1524. ;; and <components>.
  1525. ((@ (ice-9 match) match) sxml
  1526. (('*TOP*
  1527. ('*PI* foo ...)
  1528. ('component-set
  1529. ('components x ...))) x))))
  1530. (use-modules (sxml simple))
  1531. (delete-file "build/classes/META-INF/plexus/components.xml")
  1532. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  1533. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  1534. "--source" "build/classes/META-INF/plexus"
  1535. "--output" "build/classes/META-INF/plexus/components.t.xml"
  1536. "--classes" "build/classes"
  1537. "--descriptors" "build/classes")
  1538. ;; Now we merge all other components from hand-written xml
  1539. (let ((generated-xml (components "build/classes/META-INF/plexus/components.t.xml"))
  1540. (components-xml (components "src/main/resources/META-INF/plexus/components.xml"))
  1541. (default-bindings-xml (components "src/main/resources/META-INF/plexus/default-bindings.xml"))
  1542. (artifact-handlers-xml (components "src/main/resources/META-INF/plexus/artifact-handlers.xml")))
  1543. (with-output-to-file "build/classes/META-INF/plexus/components.xml"
  1544. (lambda _
  1545. (display "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
  1546. (sxml->xml
  1547. `(component-set
  1548. (components
  1549. ,@(append generated-xml components-xml
  1550. default-bindings-xml
  1551. artifact-handlers-xml)))))))
  1552. #t))
  1553. (add-after 'generate-metadata 'fix-plugin-versions
  1554. (lambda _
  1555. ;; This file controls the default plugins used by Maven. Ensure
  1556. ;; we use the versions we have packaged by default
  1557. (substitute* '("build/classes/META-INF/plexus/default-bindings.xml"
  1558. "build/classes/META-INF/plexus/components.xml")
  1559. (("maven-install-plugin:[0-9.]+")
  1560. (string-append "maven-install-plugin:"
  1561. ,(package-version maven-install-plugin)))
  1562. (("maven-resources-plugin:[0-9.]+")
  1563. (string-append "maven-resources-plugin:"
  1564. ,(package-version maven-resources-plugin)))
  1565. (("maven-compiler-plugin:[0-9.]+")
  1566. (string-append "maven-compiler-plugin:"
  1567. ,(package-version maven-compiler-plugin)))
  1568. (("maven-surefire-plugin:[0-9.]+")
  1569. (string-append "maven-surefire-plugin:"
  1570. ,(package-version maven-surefire-plugin)))
  1571. (("maven-jar-plugin:[0-9.]+")
  1572. (string-append "maven-jar-plugin:"
  1573. ,(package-version maven-jar-plugin))))))
  1574. (add-after 'fix-plugin-versions 'rebuild
  1575. (lambda _
  1576. (invoke "ant" "jar")
  1577. #t))))))
  1578. (native-inputs
  1579. `(("java-plexus-component-metadata" ,java-plexus-component-metadata)
  1580. ("java-commons-cli" ,java-commons-cli)
  1581. ("java-plexus-cli" ,java-plexus-cli)
  1582. ("java-jdom2" ,java-jdom2)
  1583. ("java-qdox" ,java-qdox)
  1584. ("maven-core-boot" ,maven-core-bootstrap)
  1585. ,@(package-native-inputs maven-core-bootstrap)))))
  1586. (define-public maven-embedder
  1587. (package
  1588. (inherit maven-artifact)
  1589. (name "maven-embedder")
  1590. (arguments
  1591. `(#:jar-name "maven-embedder.jar"
  1592. #:source-dir "maven-embedder/src/main/java"
  1593. #:test-dir "maven-embedder/src/test"
  1594. #:test-exclude (list "**/MavenCliTest.java")
  1595. #:jdk ,icedtea-8
  1596. #:phases
  1597. (modify-phases %standard-phases
  1598. (add-before 'build 'generate-sisu-named
  1599. (lambda _
  1600. (mkdir-p "build/classes/META-INF/sisu")
  1601. (chmod "sisu.sh" #o755)
  1602. (invoke "./sisu.sh" "maven-embedder/src/main/java"
  1603. "build/classes/META-INF/sisu/javax.inject.Named")
  1604. #t))
  1605. (add-before 'build 'generate-models
  1606. (lambda* (#:key inputs #:allow-other-keys)
  1607. (define (modello-single-mode file version mode)
  1608. (invoke "java" "org.codehaus.modello.ModelloCli"
  1609. file mode "maven-embedder/src/main/java" version
  1610. "false" "true"))
  1611. (let ((file "maven-embedder/src/main/mdo/core-extensions.mdo"))
  1612. (modello-single-mode file "1.0.0" "java")
  1613. (modello-single-mode file "1.0.0" "xpp3-reader")
  1614. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1615. #t))
  1616. (add-before 'check 'fix-test-paths
  1617. (lambda _
  1618. (substitute* "maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java"
  1619. (("target/test-classes") "build/test-classes"))
  1620. #t))
  1621. (add-before 'check 'fix-test-compilation
  1622. (lambda _
  1623. ;; Tests are in the java/ subdir. Other subdirectories contain
  1624. ;; additional test plugins, with duplicate classes, so we can't
  1625. ;; compile them. Also, they are meant to be built with maven, to
  1626. ;; test its build process.
  1627. (substitute* "build.xml"
  1628. (("srcdir=\"maven-embedder/src/test\"")
  1629. "srcdir=\"maven-embedder/src/test/java\""))
  1630. #t))
  1631. (replace 'install
  1632. (install-from-pom "maven-embedder/pom.xml")))))
  1633. (propagated-inputs
  1634. `(("maven-core" ,maven-core)
  1635. ("maven-artifact" ,maven-artifact)
  1636. ("maven-plugin-api" ,maven-plugin-api)
  1637. ("maven-builder-support" ,maven-builder-support)
  1638. ("maven-model" ,maven-model)
  1639. ("maven-model-builder" ,maven-model-builder)
  1640. ("maven-settings" ,maven-settings)
  1641. ("maven-settings-builder" ,maven-settings-builder)
  1642. ("maven-shared-utils" ,maven-shared-utils)
  1643. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1644. ("java-plexus-util" ,java-plexus-utils)
  1645. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1646. ("java-plexus-cipher" ,java-plexus-cipher)
  1647. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1648. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1649. ("maven-resolevr-util" ,maven-resolver-util)
  1650. ("maven-resolevr-api" ,maven-resolver-api)
  1651. ("java-logback-core" ,java-logback-core)
  1652. ("java-logback-classic" ,java-logback-classic)
  1653. ("java-commons-cli" ,java-commons-cli)
  1654. ("java-commons-io" ,java-commons-io)
  1655. ("java-commons-lang3" ,java-commons-lang3)
  1656. ("java-guava" ,java-guava)
  1657. ("java-guice" ,java-guice)
  1658. ("java-javax-inject" ,java-javax-inject)
  1659. ("java-slf4j-api" ,java-slf4j-api)
  1660. ("java-slf4j-simple" ,java-slf4j-simple)
  1661. ("java-jsr250" ,java-jsr250)))
  1662. (native-inputs
  1663. `(("java-modello-core" ,java-modello-core)
  1664. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1665. ("java-sisu-build-api" ,java-sisu-build-api)
  1666. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1667. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1668. ("java-cglib" ,java-cglib)
  1669. ("java-asm" ,java-asm)
  1670. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1671. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1672. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1673. ;; tests
  1674. ("java-junit" ,java-junit)
  1675. ("java-objenesis" ,java-objenesis)
  1676. ("java-mockito-1" ,java-mockito-1)
  1677. ("java-hamcrest-core" ,java-hamcrest-core)))
  1678. (description "Apache Maven is a software project management and comprehension
  1679. tool. This package contains a Maven embeddable component, with CLI and
  1680. logging support.")))
  1681. (define-public maven-compat
  1682. (package
  1683. (inherit maven-artifact)
  1684. (name "maven-compat")
  1685. (arguments
  1686. `(#:jar-name "maven-compat.jar"
  1687. #:source-dir "src/main/java"
  1688. #:jdk ,icedtea-8
  1689. #:test-dir "src/test"
  1690. #:phases
  1691. (modify-phases %standard-phases
  1692. ;; Tests assume we're in this directory
  1693. (add-before 'configure 'chdir
  1694. (lambda _
  1695. (chdir "maven-compat")
  1696. #t))
  1697. (add-before 'build 'recreate-removed-jar
  1698. (lambda _
  1699. (with-output-to-file "src/test/repository-system/maven-core-2.1.0.jar"
  1700. (const #t))
  1701. (with-directory-excursion "src/test/resources"
  1702. (with-output-to-file "artifact-install/artifact-1.0.jar"
  1703. (lambda _
  1704. (format #t "dummy~%")))
  1705. (for-each
  1706. (lambda (file)
  1707. (with-output-to-file file
  1708. (lambda _
  1709. (format #t "foo~%"))))
  1710. '("local-repo/maven-test/jars/maven-test-a-1.0.jar"
  1711. "local-repo/maven-test/jars/maven-test-c-1.0.jar"
  1712. "local-repo/maven-test/jars/maven-test-d-1.0.jar"
  1713. "inheritance-repo/t04/maven-test/jars/t04-a-1.0.jar"
  1714. "inheritance-repo/t04/maven-test/jars/t04-b-1.0.jar"
  1715. "inheritance-repo/t04/maven-test/jars/t04-b-2.0.jar"
  1716. "inheritance-repo/t04/maven-test/jars/t04-c-1.0.jar"
  1717. "inheritance-repo/t04/maven-test/jars/t04-c-2.0.jar"
  1718. "inheritance-repo/t05/maven-test/jars/t05-a-1.0.jar"
  1719. "inheritance-repo/t05/maven-test/jars/t05-a-2.0.jar"
  1720. "inheritance-repo/t05/maven-test/jars/t05-b-1.0.jar"
  1721. "inheritance-repo/t05/maven-test/jars/t05-b-1.1.jar"
  1722. "inheritance-repo/t05/maven-test/jars/t05-b-2.0.jar"
  1723. "inheritance-repo/t05/maven-test/jars/t05-c-1.0.jar"
  1724. "inheritance-repo/t05/maven-test/jars/t05-d-1.0.jar"
  1725. "inheritance-repo/t05/maven-test/jars/t05-d-1.1.jar"
  1726. "inheritance-repo/t05/maven-test/jars/t05-d-1.2.jar"
  1727. "inheritance-repo/t06/maven-test/jars/t06-a-1.0.jar"
  1728. "inheritance-repo/t06/maven-test/jars/t06-b-1.0.jar"
  1729. "inheritance-repo/t06/maven-test/jars/t06-b-1.1.jar"
  1730. "inheritance-repo/t06/maven-test/jars/t06-c-1.0.jar"
  1731. "inheritance-repo/t06/maven-test/jars/t06-d-1.0.jar"
  1732. "inheritance-repo/t06/maven-test/jars/t06-d-1.1.jar"
  1733. "inheritance-repo/t06/maven-test/jars/t06-d-1.2.jar"
  1734. "inheritance-repo/t07/maven-test/jars/t07-a-1.0.jar"
  1735. "inheritance-repo/t07/maven-test/jars/t07-b-1.0.jar"
  1736. "inheritance-repo/t07/maven-test/jars/t07-b-1.1.jar"
  1737. "inheritance-repo/t07/maven-test/jars/t07-c-1.0.jar"
  1738. "inheritance-repo/t07/maven-test/jars/t07-d-1.0.jar"
  1739. "inheritance-repo/t07/maven-test/jars/t07-d-1.1.jar"
  1740. "inheritance-repo/t07/maven-test/jars/t07-d-1.2.jar"
  1741. "inheritance-repo/t08/maven-test/jars/t08-a-1.0.jar"
  1742. "inheritance-repo/t08/maven-test/jars/t08-b-1.0.jar"
  1743. "inheritance-repo/t08/maven-test/jars/t08-b-1.1.jar"
  1744. "inheritance-repo/t08/maven-test/jars/t08-c-1.0.jar"
  1745. "inheritance-repo/t08/maven-test/jars/t08-d-1.0.jar"
  1746. "inheritance-repo/t08/maven-test/jars/t08-d-1.1.jar"
  1747. "inheritance-repo/t08/maven-test/jars/t08-d-1.2.jar"
  1748. "inheritance-repo/t09/maven-test/jars/t09-a-1.0.jar"
  1749. "inheritance-repo/t09/maven-test/jars/t09-b-1.0.jar"
  1750. "inheritance-repo/t09/maven-test/jars/t09-c-1.0.jar"
  1751. "inheritance-repo/t09/maven-test/jars/t09-d-1.0.jar"
  1752. "inheritance-repo/t10/maven-test/jars/t10-a-1.0.jar"
  1753. "inheritance-repo/t10/maven-test/jars/t10-b-1.0.jar"
  1754. "inheritance-repo/t10/maven-test/jars/t10-c-1.0.jar"))
  1755. (with-directory-excursion "local-repo/snapshot-test/jars"
  1756. (for-each
  1757. (lambda (file)
  1758. (with-output-to-file file
  1759. (lambda _
  1760. ;; No end-of-line
  1761. (format #t "local"))))
  1762. '("maven-snapshot-e-1.0-SNAPSHOT.jar"
  1763. "maven-snapshot-b-1.0-SNAPSHOT.jar"
  1764. "maven-snapshot-a-1.0-SNAPSHOT.jar"))))
  1765. (for-each
  1766. (lambda (letter)
  1767. (with-directory-excursion
  1768. (string-append "src/test/remote-repo/org/apache/maven/its/"
  1769. letter "/0.1")
  1770. (let ((dir (string-append "META-INF/maven/org.apache.maven.its/"
  1771. letter)))
  1772. (mkdir-p dir)
  1773. (copy-file (string-append letter "-0.1.pom")
  1774. (string-append dir "/pom.xml"))
  1775. (with-output-to-file (string-append dir "/pom.properties")
  1776. (lambda _
  1777. (format #t "version=0.1~%")
  1778. (format #t "groupId=org.apache.maven.its")
  1779. (format #t (string-append "artifactId=" letter))))
  1780. (with-output-to-file "META-INF/MANIFEST.MF"
  1781. (lambda _
  1782. (format #t "Manifest-Version: 1.0~%"))))
  1783. (invoke "jar" "cmf" "META-INF/MANIFEST.MF"
  1784. (string-append letter "-0.1.jar") "META-INF")))
  1785. '("a" "b"))
  1786. #t))
  1787. (add-before 'build 'generate-models
  1788. (lambda* (#:key inputs #:allow-other-keys)
  1789. (define (modello-single-mode file version mode)
  1790. (invoke "java" "org.codehaus.modello.ModelloCli"
  1791. file mode "src/main/java" version
  1792. "false" "true"))
  1793. (let ((file "src/main/mdo/profiles.mdo"))
  1794. (modello-single-mode file "1.0.0" "java")
  1795. (modello-single-mode file "1.0.0" "xpp3-reader")
  1796. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1797. (let ((file "src/main/mdo/paramdoc.mdo"))
  1798. (modello-single-mode file "1.0.0" "java")
  1799. (modello-single-mode file "1.0.0" "xpp3-reader")
  1800. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1801. #t))
  1802. (add-after 'build 'generate-metadata
  1803. (lambda _
  1804. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  1805. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  1806. "--source" "src/main/java"
  1807. "--output" "build/classes/META-INF/plexus/components.xml"
  1808. "--classes" "build/classes"
  1809. "--descriptors" "build/classes/META-INF")
  1810. #t))
  1811. (add-before 'check 'build-tests
  1812. (lambda _
  1813. (invoke "ant" "compile-tests")
  1814. #t))
  1815. (add-after 'build-tests 'generate-test-metadata
  1816. (lambda _
  1817. (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
  1818. ":build/classes"
  1819. ":build/test-classes")
  1820. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  1821. "--source" "src/test/java"
  1822. "--output" "build/test-classes/META-INF/plexus/components.xml"
  1823. "--classes" "build/test-classes"
  1824. "--descriptors" "build/test-classes/META-INF")
  1825. #t))
  1826. (add-after 'generate-metadata 'rebuild
  1827. (lambda _
  1828. (invoke "ant" "jar")
  1829. #t))
  1830. (replace 'install
  1831. (install-from-pom "pom.xml")))))
  1832. (propagated-inputs
  1833. `(("maven-artifact" ,maven-artifact)
  1834. ("maven-repository-metadata" ,maven-repository-metadata)
  1835. ("maven-builder-support" ,maven-builder-support)
  1836. ("maven-model" ,maven-model)
  1837. ("maven-model-builder" ,maven-model-builder)
  1838. ("maven-settings" ,maven-settings)
  1839. ("maven-settings-builder" ,maven-settings-builder)
  1840. ("maven-core" ,maven-core)
  1841. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  1842. ("maven-wagon-file" ,maven-wagon-file)
  1843. ("maven-resolver-api" ,maven-resolver-api)
  1844. ("maven-resolver-util" ,maven-resolver-util)
  1845. ("maven-resolver-spi" ,maven-resolver-spi)
  1846. ("java-plexus-interpolation" ,java-plexus-interpolation)))
  1847. (native-inputs
  1848. `(("java-modello-core" ,java-modello-core)
  1849. ("java-plexus-utils" ,java-plexus-utils)
  1850. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1851. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1852. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1853. ("java-sisu-build-api" ,java-sisu-build-api)
  1854. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1855. ("java-exclispe-sisu-inject" ,java-eclipse-sisu-inject)
  1856. ("java-javax-inject" ,java-javax-inject)
  1857. ("java-guice" ,java-guice)
  1858. ("java-guava" ,java-guava)
  1859. ("java-cglib" ,java-cglib)
  1860. ("java-asm" ,java-asm)
  1861. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1862. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1863. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1864. ;; metadata
  1865. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  1866. ("java-commons-cli" ,java-commons-cli)
  1867. ("java-plexus-cli" ,java-plexus-cli)
  1868. ("java-jdom2" ,java-jdom2)
  1869. ("maven-plugin-api" ,maven-plugin-api)
  1870. ("java-qdox" ,java-qdox)
  1871. ;; tests
  1872. ("java-plexus-cipher" ,java-plexus-cipher)
  1873. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1874. ("java-jsr250" ,java-jsr250)
  1875. ("java-cdi-api" ,java-cdi-api)
  1876. ("java-junit" ,java-junit)
  1877. ("maven-resolver-impl" ,maven-resolver-impl)
  1878. ("maven-resolver-connector-basic" ,maven-resolver-connector-basic)
  1879. ("maven-resolver-transport-wagon" ,maven-resolver-transport-wagon)
  1880. ("java-commons-lang3" ,java-commons-lang3)
  1881. ("java-aop" ,java-aopalliance)
  1882. ("maven-resolver-provider" ,maven-resolver-provider)
  1883. ("java-slf4j-api" ,java-slf4j-api)
  1884. ("java-slf4j-simple" ,java-slf4j-simple)
  1885. ,@(package-inputs java-slf4j-api)))
  1886. (description "Apache Maven is a software project management and comprehension
  1887. tool. This package contains Maven2 classes maintained as compatibility
  1888. layer for plugins that need to keep Maven2 compatibility.")))
  1889. (define-public maven
  1890. (package
  1891. (inherit maven-artifact)
  1892. (name "maven")
  1893. (arguments
  1894. `(#:phases
  1895. (modify-phases %standard-phases
  1896. (replace 'build
  1897. (lambda* (#:key inputs #:allow-other-keys)
  1898. ;; Recreate the configuration for the loader
  1899. (with-output-to-file "apache-maven/src/bin/m2.conf"
  1900. (lambda _
  1901. (format #t "main is org.apache.maven.cli.MavenCli from plexus.core~%")
  1902. (format #t "~%")
  1903. (format #t "set maven.conf default ${maven.home}/conf~%")
  1904. (format #t "~%")
  1905. (format #t "[plexus.core]~%")
  1906. (format #t "load ${maven.conf}/logging~%")
  1907. (format #t "optionally ${maven.home}/lib/ext/*.jar~%")
  1908. ;; Reference every jar so plexus-classworlds can find them.
  1909. (for-each
  1910. (lambda (dependency)
  1911. (for-each
  1912. (lambda (file)
  1913. (format #t "load ~a~%" file))
  1914. (find-files (assoc-ref inputs dependency) ".*.jar$")))
  1915. '("maven-artifact" "maven-embedder" "maven-core" "maven-compat"
  1916. "maven-builder-support" "maven-model" "maven-model-builder"
  1917. "maven-settings" "maven-settings-builder" "maven-plugin-api"
  1918. "maven-repository-metadata" "maven-shared-utils" "maven-resolver-api"
  1919. "maven-resolver-spi" "maven-resolver-util" "maven-resolver-impl"
  1920. "maven-resolver-connector-basic" "maven-resolver-provider"
  1921. "maven-resolver-transport-wagon" "maven-wagon-provider-api"
  1922. "maven-wagon-file" "maven-wagon-http" "java-commons-logging-minimal"
  1923. "java-httpcomponents-httpclient" "java-httpcomponents-httpcore"
  1924. "maven-wagon-http-shared" "maven-wagon-tck-http"
  1925. "java-eclipse-sisu-plexus" "java-guice" "java-aopalliance"
  1926. "java-cglib" "java-asm" "java-eclipse-sisu-inject"
  1927. "java-javax-inject" "java-plexus-component-annotations"
  1928. "java-plexus-utils" "java-plexus-interpolation"
  1929. "java-plexus-sec-dispatcher" "java-plexus-cipher" "java-guava"
  1930. "java-jansi" "java-jsr250" "java-cdi-api" "java-commons-cli"
  1931. "java-commons-io" "java-commons-lang3" "java-slf4j-api"
  1932. "java-slf4j-simple"))))
  1933. (substitute* "apache-maven/src/bin/mvn"
  1934. (("cygwin=false;")
  1935. (string-append
  1936. "CLASSPATH="
  1937. (car (find-files
  1938. (assoc-ref inputs "java-plexus-classworlds")
  1939. ".*.jar"))
  1940. "\ncygwin=false;"))
  1941. (("-classpath.*") "-classpath ${CLASSPATH} \\\n"))
  1942. #t))
  1943. (delete 'check)
  1944. (replace 'install
  1945. (lambda* (#:key outputs #:allow-other-keys)
  1946. (let ((bin (string-append (assoc-ref outputs "out") "/bin/"))
  1947. (conf (string-append (assoc-ref outputs "out") "/conf/")))
  1948. (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
  1949. (for-each (lambda (file)
  1950. (install-file (string-append "apache-maven/src/bin/" file)
  1951. bin)
  1952. (chmod (string-append bin file) #o755))
  1953. '("mvn" "mvnDebug" "mvnyjp"))
  1954. (install-file "apache-maven/src/bin/m2.conf" bin)
  1955. (copy-recursively "apache-maven/src/conf" conf))
  1956. #t)))))
  1957. (inputs
  1958. `(("java-plexus-classworlds" ,java-plexus-classworlds)
  1959. ("maven-artifact" ,maven-artifact)
  1960. ("maven-embedder" ,maven-embedder)
  1961. ("maven-core" ,maven-core)
  1962. ("maven-compat" ,maven-compat)
  1963. ("maven-builder-support" ,maven-builder-support)
  1964. ("maven-model" ,maven-model)
  1965. ("maven-model-builder" ,maven-model-builder)
  1966. ("maven-settings" ,maven-settings)
  1967. ("maven-settings-builder" ,maven-settings-builder)
  1968. ("maven-plugin-api" ,maven-plugin-api)
  1969. ("maven-repository-metadata" ,maven-repository-metadata)
  1970. ("maven-shared-utils" ,maven-shared-utils)
  1971. ("maven-resolver-api" ,maven-resolver-api)
  1972. ("maven-resolver-spi" ,maven-resolver-spi)
  1973. ("maven-resolver-util" ,maven-resolver-util)
  1974. ("maven-resolver-impl" ,maven-resolver-impl)
  1975. ("maven-resolver-connector-basic" ,maven-resolver-connector-basic)
  1976. ("maven-resolver-provider" ,maven-resolver-provider)
  1977. ("maven-resolver-transport-wagon" ,maven-resolver-transport-wagon)
  1978. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  1979. ("maven-wagon-file" ,maven-wagon-file)
  1980. ("maven-wagon-http" ,maven-wagon-http)
  1981. ("java-commons-logging-minimal" ,java-commons-logging-minimal)
  1982. ("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
  1983. ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
  1984. ("maven-wagon-http-shared" ,maven-wagon-http-shared)
  1985. ("maven-wagon-tck-http" ,maven-wagon-tck-http)
  1986. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1987. ("java-guice" ,java-guice)
  1988. ("java-aopalliance" ,java-aopalliance)
  1989. ("java-cglib" ,java-cglib)
  1990. ("java-asm" ,java-asm)
  1991. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1992. ("java-javax-inject" ,java-javax-inject)
  1993. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1994. ("java-plexus-utils" ,java-plexus-utils)
  1995. ("java-plexus-interpolation" ,java-plexus-interpolation)
  1996. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1997. ("java-plexus-cipher" ,java-plexus-cipher)
  1998. ("java-guava" ,java-guava)
  1999. ("java-jansi" ,java-jansi)
  2000. ("java-jsr250" ,java-jsr250)
  2001. ("java-cdi-api" ,java-cdi-api)
  2002. ("java-commons-cli" ,java-commons-cli)
  2003. ("java-commons-io" ,java-commons-io)
  2004. ("java-commons-lang3" ,java-commons-lang3)
  2005. ("java-slf4j-api" ,java-slf4j-api)
  2006. ;; TODO: replace with maven-slf4j-provider
  2007. ("java-slf4j-simple" ,java-slf4j-simple)))
  2008. (propagated-inputs
  2009. `(("coreutils" ,coreutils)
  2010. ("which" ,which)))
  2011. (description "Apache Maven is a software project management and comprehension
  2012. tool. Based on the concept of a project object model: builds, dependency
  2013. management, documentation creation, site publication, and distribution
  2014. publication are all controlled from the @file{pom.xml} declarative file. Maven
  2015. can be extended by plugins to utilise a number of other development tools for
  2016. reporting or the build process.")))
  2017. ;; Many plugins require maven 3.0 as a dependency.
  2018. (define maven-3.0-pom
  2019. (package
  2020. (inherit maven-pom)
  2021. (version "3.0")
  2022. (source (origin
  2023. (method git-fetch)
  2024. (uri (git-reference
  2025. (url "https://github.com/apache/maven")
  2026. (commit (string-append "maven-" version))))
  2027. (file-name (git-file-name "maven" version))
  2028. (sha256
  2029. (base32
  2030. "06jdwxx9w24shhv3kca80rlrikynn7kdqcrwg59lv2b7adpllwnh"))
  2031. (modules '((guix build utils)))
  2032. (snippet
  2033. '(begin
  2034. (for-each delete-file (find-files "." "\\.jar$"))
  2035. (for-each (lambda (file) (chmod file #o644))
  2036. (find-files "." "."))
  2037. #t))
  2038. (patches
  2039. (search-patches "maven-generate-component-xml.patch"
  2040. "maven-generate-javax-inject-named.patch"))))
  2041. (propagated-inputs
  2042. `(("maven-parent-pom-15" ,maven-parent-pom-15)))))
  2043. (define-public maven-3.0-artifact
  2044. (package
  2045. (inherit maven-artifact)
  2046. (version (package-version maven-3.0-pom))
  2047. (source (package-source maven-3.0-pom))
  2048. (propagated-inputs
  2049. (map
  2050. (lambda (input)
  2051. (if (equal? (car input) "maven-pom")
  2052. `("maven-pom" ,maven-3.0-pom)
  2053. input))
  2054. (package-propagated-inputs maven-artifact)))))
  2055. (define-public maven-3.0-model
  2056. (package
  2057. (inherit maven-model)
  2058. (version (package-version maven-3.0-pom))
  2059. (source (package-source maven-3.0-pom))
  2060. (propagated-inputs
  2061. (map
  2062. (lambda (input)
  2063. (if (equal? (car input) "maven-pom")
  2064. `("maven-pom" ,maven-3.0-pom)
  2065. input))
  2066. (package-propagated-inputs maven-artifact)))
  2067. (arguments
  2068. `(#:jar-name "maven-model.jar"
  2069. #:source-dir "maven-model/src/main/java"
  2070. #:test-dir "maven-model/src/test"
  2071. #:modules
  2072. ((guix build ant-build-system)
  2073. (guix build java-utils)
  2074. (guix build syscalls)
  2075. (guix build utils))
  2076. #:phases
  2077. (modify-phases %standard-phases
  2078. (add-after 'configure 'use-newer-model
  2079. (lambda* (#:key inputs #:allow-other-keys)
  2080. ;; The model has almost not changed, but the newer version is
  2081. ;; needed to prevent an error in the newer modello we have
  2082. (let ((source (assoc-ref inputs "maven-source"))
  2083. (dir (mkdtemp! "maven-source-XXXXXXXX")))
  2084. (with-directory-excursion dir
  2085. (invoke "tar" "xf" source)
  2086. (copy-file (car (find-files "." "maven.mdo"))
  2087. "../maven-model/src/main/mdo/maven.mdo")))
  2088. #t))
  2089. (add-before 'build 'generate-models
  2090. (lambda* (#:key inputs #:allow-other-keys)
  2091. (define (modello-single-mode file version mode)
  2092. (invoke "java" "org.codehaus.modello.ModelloCli"
  2093. file mode "maven-model/src/main/java" version
  2094. "false" "true" "UTF-8"))
  2095. (let ((file "maven-model/src/main/mdo/maven.mdo"))
  2096. (modello-single-mode file "4.0.0" "java")
  2097. (modello-single-mode file "4.0.0" "xpp3-reader")
  2098. (modello-single-mode file "4.0.0" "xpp3-writer")
  2099. (modello-single-mode file "4.0.0" "xpp3-extended-reader"))
  2100. #t))
  2101. (replace 'install
  2102. (install-from-pom "maven-model/pom.xml")))))
  2103. (inputs
  2104. `(("maven-source" ,(package-source maven-pom))
  2105. ,@(package-inputs maven-model)))))
  2106. (define-public maven-3.0-settings
  2107. (package
  2108. (inherit maven-settings)
  2109. (version (package-version maven-3.0-pom))
  2110. (source (package-source maven-3.0-pom))
  2111. (propagated-inputs
  2112. (map
  2113. (lambda (input)
  2114. (if (equal? (car input) "maven-pom")
  2115. `("maven-pom" ,maven-3.0-pom)
  2116. input))
  2117. (package-propagated-inputs maven-settings)))))
  2118. (define-public maven-3.0-settings-builder
  2119. (package
  2120. (inherit maven-settings-builder)
  2121. (version (package-version maven-3.0-pom))
  2122. (source (package-source maven-3.0-pom))
  2123. (propagated-inputs
  2124. `(("java-plexus-component-annotations" ,java-plexus-component-annotations)
  2125. ,@(filter
  2126. (lambda (a) a)
  2127. (map
  2128. (lambda (input)
  2129. (match (car input)
  2130. ("maven-pom" `("maven-pom" ,maven-3.0-pom))
  2131. ("maven-settings" `("maven-settings" ,maven-3.0-settings))
  2132. ("maven-builder-support" #f)
  2133. (_ input)))
  2134. (package-propagated-inputs maven-settings-builder)))))))
  2135. (define-public maven-3.0-model-builder
  2136. (package
  2137. (inherit maven-model-builder)
  2138. (version (package-version maven-3.0-pom))
  2139. (source (package-source maven-3.0-pom))
  2140. (propagated-inputs
  2141. `(("java-plexus-component-annotations" ,java-plexus-component-annotations)
  2142. ,@(filter
  2143. (lambda (a) a)
  2144. (map
  2145. (lambda (input)
  2146. (match (car input)
  2147. ("maven-pom" `("maven-pom" ,maven-3.0-pom))
  2148. ("maven-model" `("maven-model" ,maven-3.0-model))
  2149. ("maven-artifact" `("maven-artifact" ,maven-3.0-artifact))
  2150. ("maven-builder-support" #f)
  2151. (_ input)))
  2152. (package-propagated-inputs maven-model-builder)))))))
  2153. (define-public maven-3.0-plugin-api
  2154. (package
  2155. (inherit maven-plugin-api)
  2156. (version (package-version maven-3.0-pom))
  2157. (source (package-source maven-3.0-pom))
  2158. (arguments
  2159. (substitute-keyword-arguments (package-arguments maven-plugin-api)
  2160. ((#:phases phases)
  2161. `(modify-phases ,phases
  2162. (add-before 'install 'fix-pom
  2163. (lambda _
  2164. (substitute* "maven-plugin-api/pom.xml"
  2165. (("org.sonatype.sisu") "org.codehaus.plexus")
  2166. (("sisu-inject-plexus") "plexus-container-default"))
  2167. #t))))))
  2168. (propagated-inputs
  2169. (map
  2170. (lambda (input)
  2171. (match (car input)
  2172. ("maven-pom" `("maven-pom" ,maven-3.0-pom))
  2173. ("maven-artifact" `("maven-artifact" ,maven-3.0-artifact))
  2174. ("maven-model" `("maven-model" ,maven-3.0-model))
  2175. (_ input)))
  2176. (package-propagated-inputs maven-model-builder)))
  2177. (native-inputs
  2178. `(("java-plexus-container-default" ,java-plexus-container-default)
  2179. ,@(package-native-inputs maven-plugin-api)))))
  2180. (define-public maven-3.0-repository-metadata
  2181. (package
  2182. (inherit maven-repository-metadata)
  2183. (version (package-version maven-3.0-pom))
  2184. (source (package-source maven-3.0-pom))
  2185. (propagated-inputs
  2186. (map
  2187. (lambda (input)
  2188. (if (equal? (car input) "maven-pom")
  2189. `("maven-pom" ,maven-3.0-pom)
  2190. input))
  2191. (package-propagated-inputs maven-repository-metadata)))))
  2192. (define-public maven-3.0-aether-provider
  2193. (package
  2194. (inherit maven-3.0-pom)
  2195. (name "maven-aether-provider")
  2196. (arguments
  2197. `(#:jar-name "maven-aether-provider.jar"
  2198. #:source-dir "maven-aether-provider/src/main/java"
  2199. #:tests? #f; no tests in 3.0
  2200. #:phases
  2201. (modify-phases %standard-phases
  2202. (add-after 'build 'generate-metadata
  2203. (lambda _
  2204. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  2205. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  2206. "--source" "src/main/java"
  2207. "--output" "build/classes/META-INF/plexus/components.xml"
  2208. "--classes" "build/classes"
  2209. "--descriptors" "build/classes/META-INF")
  2210. #t))
  2211. (add-after 'generate-metadata 'rebuild
  2212. (lambda _
  2213. (invoke "ant" "jar")
  2214. #t))
  2215. (replace 'install
  2216. (install-from-pom "maven-aether-provider/pom.xml")))))
  2217. (propagated-inputs
  2218. `(("maven-model" ,maven-3.0-model)
  2219. ("maven-model-builder" ,maven-3.0-model-builder)
  2220. ("maven-repository-metadata" ,maven-3.0-repository-metadata)
  2221. ("java-sonatype-aether-api" ,java-sonatype-aether-api)
  2222. ("java-sonatype-aether-spi" ,java-sonatype-aether-spi)
  2223. ("java-sonatype-aether-impl" ,java-sonatype-aether-impl)
  2224. ("java-plexus-component-annotation" ,java-plexus-component-annotations)
  2225. ("java-plexus-utils" ,java-plexus-utils)
  2226. ("maven-pom" ,maven-3.0-pom)))
  2227. (native-inputs
  2228. `(("java-plexus-component-metadata" ,java-plexus-component-metadata)))))
  2229. (define-public maven-3.0-core
  2230. (package
  2231. (inherit maven-core)
  2232. (version (package-version maven-3.0-pom))
  2233. (source (package-source maven-3.0-pom))
  2234. (arguments
  2235. `(#:jar-name "maven-core.jar"
  2236. #:source-dir "src/main/java"
  2237. #:tests? #f
  2238. #:phases
  2239. (modify-phases %standard-phases
  2240. (add-before 'configure 'chdir
  2241. (lambda _
  2242. ;; Required for generating components.xml in maven-core
  2243. (chdir "maven-core")
  2244. #t))
  2245. (add-before 'build 'generate-models
  2246. (lambda* (#:key inputs #:allow-other-keys)
  2247. (define (modello-single-mode file version mode)
  2248. (invoke "java" "org.codehaus.modello.ModelloCli"
  2249. file mode "src/main/java" version
  2250. "false" "true" "UTF-8"))
  2251. (let ((file "src/main/mdo/toolchains.mdo"))
  2252. (modello-single-mode file "1.0.0" "java")
  2253. (modello-single-mode file "1.0.0" "xpp3-reader")
  2254. (modello-single-mode file "1.0.0" "xpp3-writer"))
  2255. #t))
  2256. (add-before 'build 'copy-resources
  2257. (lambda _
  2258. (mkdir-p "build/classes/")
  2259. (copy-recursively "src/main/resources" "build/classes")
  2260. #t))
  2261. (add-after 'build 'generate-metadata
  2262. (lambda _
  2263. (define (components file)
  2264. (let ((sxml (with-input-from-file file
  2265. (lambda _ (xml->sxml (current-input-port)
  2266. #:trim-whitespace? #t)))))
  2267. ;; Select the list of <component>s inside the <component-set>
  2268. ;; and <components>.
  2269. ((@ (ice-9 match) match) sxml
  2270. (('*TOP*
  2271. ('*PI* foo ...)
  2272. ('component-set
  2273. ('components x ...))) x))))
  2274. (use-modules (sxml simple))
  2275. (delete-file "build/classes/META-INF/plexus/components.xml")
  2276. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  2277. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  2278. "--source" "build/classes/META-INF/plexus"
  2279. "--output" "build/classes/META-INF/plexus/components.t.xml"
  2280. "--classes" "build/classes"
  2281. "--descriptors" "build/classes")
  2282. ;; Now we merge all other components from hand-written xml
  2283. (let ((generated-xml (components "build/classes/META-INF/plexus/components.t.xml"))
  2284. (components-xml (components "src/main/resources/META-INF/plexus/components.xml"))
  2285. (artifact-handlers-xml (components "src/main/resources/META-INF/plexus/artifact-handlers.xml")))
  2286. (with-output-to-file "build/classes/META-INF/plexus/components.xml"
  2287. (lambda _
  2288. (display "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
  2289. (sxml->xml
  2290. `(component-set
  2291. (components
  2292. ,@(append generated-xml components-xml
  2293. artifact-handlers-xml)))))))
  2294. #t))
  2295. (add-after 'generate-metadata 'rebuild
  2296. (lambda _
  2297. (invoke "ant" "jar")
  2298. #t))
  2299. (add-before 'install 'fix-pom
  2300. (lambda _
  2301. (substitute* "pom.xml"
  2302. (("org.sonatype.sisu") "org.codehaus.plexus")
  2303. (("sisu-inject-plexus") "plexus-container-default"))
  2304. #t))
  2305. (replace 'install
  2306. (install-from-pom "pom.xml")))))
  2307. (propagated-inputs
  2308. `(("maven-model" ,maven-3.0-model)
  2309. ("maven-settings" ,maven-3.0-settings)
  2310. ("maven-settings-builder" ,maven-3.0-settings-builder)
  2311. ("maven-repository-metadata" ,maven-3.0-repository-metadata)
  2312. ("maven-artifact" ,maven-3.0-artifact)
  2313. ("maven-model-builder" ,maven-3.0-model-builder)
  2314. ("maven-aether-provider" ,maven-3.0-aether-provider)
  2315. ("java-sonatype-aether-impl" ,java-sonatype-aether-impl)
  2316. ("java-sonatype-aether-api" ,java-sonatype-aether-api)
  2317. ("java-sonatype-aether-util" ,java-sonatype-aether-util)
  2318. ("java-plexus-interpolation" ,java-plexus-interpolation)
  2319. ("java-plexus-utils" ,java-plexus-utils)
  2320. ("java-plexus-classworlds" ,java-plexus-classworlds)
  2321. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  2322. ("java-plexus-container-default" ,java-plexus-container-default)
  2323. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  2324. ("maven-pom" ,maven-3.0-pom)))))
  2325. (define-public maven-3.0-compat
  2326. (package
  2327. (inherit maven-compat)
  2328. (version (package-version maven-3.0-pom))
  2329. (source (package-source maven-3.0-pom))
  2330. (arguments
  2331. `(#:tests? #f ;require an old version of java-easymock
  2332. ,@(substitute-keyword-arguments (package-arguments maven-compat)
  2333. ((#:phases phases)
  2334. `(modify-phases ,phases
  2335. (add-before 'install 'fix-pom
  2336. (lambda _
  2337. (substitute* "pom.xml"
  2338. (("org.sonatype.sisu") "org.codehaus.plexus")
  2339. (("sisu-inject-plexus") "plexus-container-default"))
  2340. #t))
  2341. (delete 'build-tests))))))
  2342. (propagated-inputs
  2343. `(("maven-model" ,maven-3.0-model)
  2344. ("maven-model-builder" ,maven-3.0-model-builder)
  2345. ("maven-settings" ,maven-3.0-settings)
  2346. ("maven-settings-builder" ,maven-3.0-settings-builder)
  2347. ("maven-artifact" ,maven-3.0-artifact)
  2348. ("maven-core" ,maven-3.0-core)
  2349. ("maven-aether-provider" ,maven-3.0-aether-provider)
  2350. ("maven-repository-metadata" ,maven-3.0-repository-metadata)
  2351. ("java-sonatype-aether-api" ,java-sonatype-aether-api)
  2352. ("java-sonatype-aether-util" ,java-sonatype-aether-util)
  2353. ("java-sonatype-aether-impl" ,java-sonatype-aether-impl)
  2354. ("java-plexus-utils" ,java-plexus-utils)
  2355. ("java-plexus-interpolation" ,java-plexus-interpolation)
  2356. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  2357. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  2358. ("java-plexus-container-default" ,java-plexus-container-default)
  2359. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  2360. ("maven-pom" ,maven-3.0-pom)))))
  2361. (define-public maven-shared-utils-3.0
  2362. (package
  2363. (inherit maven-shared-utils)
  2364. (version "3.0.0")
  2365. (source (origin
  2366. (method url-fetch)
  2367. (uri (string-append "https://archive.apache.org/dist/maven/shared/"
  2368. "maven-shared-utils-" version "-source-release.zip"))
  2369. (sha256
  2370. (base32
  2371. "0qm8y85kip2hyhnhlkqgj0rhmf83z07s7l7gzsfl5dzl3kvp8nal"))))
  2372. (propagated-inputs
  2373. `(("maven-core" ,maven-3.0-core)
  2374. ("maven-components-parent-pom" ,maven-components-parent-pom-21)
  2375. ,@(package-propagated-inputs maven-shared-utils)))))
  2376. (define-public maven-shared-utils-3.1
  2377. (package
  2378. (inherit maven-shared-utils)
  2379. (version "3.1.0")
  2380. (source (origin
  2381. (method url-fetch)
  2382. (uri (string-append "https://archive.apache.org/dist/maven/shared/"
  2383. "maven-shared-utils-" version "-source-release.zip"))
  2384. (sha256
  2385. (base32
  2386. "0vfaas4g09ch0agrd1dcxcmhdd3w971ssvfr9mx9gi2lp5nv8w66"))))))
  2387. (define-public maven-shared-io
  2388. (package
  2389. (name "maven-shared-io")
  2390. (version "3.0.0")
  2391. (source (origin
  2392. (method url-fetch)
  2393. (uri (string-append "mirror://apache/maven/shared/"
  2394. "maven-shared-io-" version
  2395. "-source-release.zip"))
  2396. (sha256
  2397. (base32
  2398. "0hsyll8gg581802xhs4achdz8fpmfz7y02abx9s4mb8bc6yfh229"))))
  2399. (build-system ant-build-system)
  2400. (arguments
  2401. `(#:jar-name "maven-shared-io.jar"
  2402. #:source-dir "src/main/java"
  2403. #:test-dir "src/test"
  2404. #:phases
  2405. (modify-phases %standard-phases
  2406. (add-before 'build 'copy-resources
  2407. (lambda _
  2408. (copy-recursively "src/main/resources" "build/classes/")
  2409. (copy-recursively "src/test/resources" "build/test-classes/")
  2410. #t))
  2411. (replace 'install
  2412. (install-from-pom "pom.xml")))))
  2413. (propagated-inputs
  2414. `(("maven-artifact" ,maven-3.0-artifact)
  2415. ("maven-compat" ,maven-3.0-compat)
  2416. ("maven-plugin-api" ,maven-3.0-plugin-api)
  2417. ("maven-shared-utils" ,maven-shared-utils)
  2418. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  2419. ("java-plexus-utils" ,java-plexus-utils)
  2420. ("maven-components-parent-pom" ,maven-components-parent-pom-22)))
  2421. (native-inputs
  2422. `(("unzip" ,unzip)
  2423. ("java-junit" ,java-junit)
  2424. ("java-easymock" ,java-easymock)))
  2425. (home-page "https://maven.apache.org/shared/maven-dependency-tree")
  2426. (synopsis "Tree-based API for resolution of Maven project dependencies")
  2427. (description "This package provides a tree-based API for resolution of
  2428. Maven project dependencies.")
  2429. (license license:asl2.0)))
  2430. (define-public maven-file-management
  2431. (package
  2432. (name "maven-file-management")
  2433. (version "3.0.0")
  2434. (source (origin
  2435. (method url-fetch)
  2436. (uri (string-append "mirror://apache/maven/shared/"
  2437. "file-management-" version
  2438. "-source-release.zip"))
  2439. (sha256
  2440. (base32
  2441. "0wisz6sm67axrwvx8a75mb9s03h7kzkzfw8j3aaa4sx4k9ph58da"))))
  2442. (build-system ant-build-system)
  2443. (arguments
  2444. `(#:jar-name "maven-file-management.jar"
  2445. #:source-dir "src/main/java"
  2446. #:phases
  2447. (modify-phases %standard-phases
  2448. (add-before 'build 'copy-resources
  2449. (lambda _
  2450. (copy-recursively "src/main/resources" "build/classes/")
  2451. #t))
  2452. (add-before 'build 'generate-models
  2453. (lambda* (#:key inputs #:allow-other-keys)
  2454. (define (modello-single-mode file version mode)
  2455. (invoke "java"
  2456. "org.codehaus.modello.ModelloCli"
  2457. file mode "src/main/java" version
  2458. "false" "true"))
  2459. (let ((file "src/main/mdo/fileset.mdo"))
  2460. (modello-single-mode file "1.1.0" "java")
  2461. (modello-single-mode file "1.1.0" "xpp3-reader")
  2462. (modello-single-mode file "1.1.0" "xpp3-writer"))
  2463. #t))
  2464. (replace 'install
  2465. (install-from-pom "pom.xml")))))
  2466. (propagated-inputs
  2467. `(("maven-plugin-api" ,maven-3.0-plugin-api)
  2468. ("maven-shared-io" ,maven-shared-io)
  2469. ("maven-shared-utils" ,maven-shared-utils)
  2470. ("java-plexus-utils" ,java-plexus-utils)
  2471. ("maven-components-parent-pom" ,maven-components-parent-pom-22)))
  2472. (native-inputs
  2473. `(("java-modello-core" ,java-modello-core)
  2474. ;; modello plugins:
  2475. ("java-modellop-plugins-java" ,java-modello-plugins-java)
  2476. ("java-modellop-plugins-xpp3" ,java-modello-plugins-xpp3)
  2477. ("unzip" ,unzip)))
  2478. (home-page "https://maven.apache.org/shared/maven-dependency-tree")
  2479. (synopsis "Tree-based API for resolution of Maven project dependencies")
  2480. (description "This package provides a tree-based API for resolution of
  2481. Maven project dependencies.")
  2482. (license license:asl2.0)))
  2483. (define-public maven-archiver
  2484. (package
  2485. (name "maven-archiver")
  2486. (version "3.5.0")
  2487. (source (origin
  2488. (method url-fetch)
  2489. (uri (string-append "mirror://apache/maven/shared/"
  2490. "maven-archiver-" version
  2491. "-source-release.zip"))
  2492. (sha256
  2493. (base32
  2494. "1204xkqj259brpk3yscprml0lbfbyn1vn5nrgqjk44z5vx127lbw"))))
  2495. (build-system ant-build-system)
  2496. (arguments
  2497. `(#:jar-name "maven-archiver.jar"
  2498. #:source-dir "src/main/java"
  2499. #:phases
  2500. (modify-phases %standard-phases
  2501. (replace 'install
  2502. (install-from-pom "pom.xml")))))
  2503. (propagated-inputs
  2504. `(("java-commons-io" ,java-commons-io)
  2505. ("maven-artifact" ,maven-3.0-artifact)
  2506. ("maven-core" ,maven-3.0-core)
  2507. ("maven-model" ,maven-3.0-model)
  2508. ("maven-shared-utils" ,maven-shared-utils)
  2509. ("java-plexus-archiver" ,java-plexus-archiver)
  2510. ("java-plexus-interpolation" ,java-plexus-interpolation)
  2511. ("java-plexus-utils" ,java-plexus-utils)
  2512. ("maen-parent-pom" ,maven-parent-pom-33)))
  2513. (native-inputs
  2514. `(("java-junit" ,java-junit)
  2515. ("java-assertj" ,java-assertj)
  2516. ("unzip" ,unzip)))
  2517. (home-page "https://maven.apache.org/shared/maven-dependency-tree")
  2518. (synopsis "Tree-based API for resolution of Maven project dependencies")
  2519. (description "This package provides a tree-based API for resolution of
  2520. Maven project dependencies.")
  2521. (license license:asl2.0)))
  2522. (define-public maven-dependency-tree
  2523. (package
  2524. (name "maven-dependency-tree")
  2525. (version "3.0.1")
  2526. (source (origin
  2527. (method url-fetch)
  2528. (uri (string-append "mirror://apache/maven/shared/"
  2529. "maven-dependency-tree-" version
  2530. "-source-release.zip"))
  2531. (sha256
  2532. (base32
  2533. "0mxfslxvcmjs13jl30zhcg672j970dzn6ihh79w9ajh6sfqmlds2"))))
  2534. (build-system ant-build-system)
  2535. (arguments
  2536. `(#:jar-name "maven-dependency-tree.jar"
  2537. #:source-dir "src/main/java"
  2538. #:phases
  2539. (modify-phases %standard-phases
  2540. (replace 'install
  2541. (install-from-pom "pom.xml")))))
  2542. (propagated-inputs
  2543. `(("maven-core" ,maven-3.0-core)
  2544. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  2545. ("maven-parent-pom" ,maven-parent-pom-30)))
  2546. (inputs
  2547. `(("java-sonatype-aether-api" ,java-sonatype-aether-api)
  2548. ("java-sonatype-aether-util" ,java-sonatype-aether-util)
  2549. ("java-eclipse-aether-api" ,java-eclipse-aether-api)
  2550. ("java-eclipse-aether-util" ,java-eclipse-aether-util)))
  2551. (native-inputs
  2552. `(("unzip" ,unzip)
  2553. ("java-junit" ,java-junit)))
  2554. (home-page "https://maven.apache.org/shared/maven-dependency-tree")
  2555. (synopsis "Tree-based API for resolution of Maven project dependencies")
  2556. (description "This package provides a tree-based API for resolution of
  2557. Maven project dependencies.")
  2558. (license license:asl2.0)))
  2559. (define-public maven-common-artifact-filters
  2560. (package
  2561. (name "maven-common-artifact-filters")
  2562. (version "3.1.0")
  2563. (source (origin
  2564. (method url-fetch)
  2565. (uri (string-append "mirror://apache/maven/shared/"
  2566. "maven-common-artifact-filters-" version
  2567. "-source-release.zip"))
  2568. (sha256
  2569. (base32
  2570. "1cl1qk4r0gp62bjzfm7lml9raz1my2kd4yf0ci0lnfsn0h5qivnb"))))
  2571. (build-system ant-build-system)
  2572. (arguments
  2573. `(#:jar-name "maven-common-artifact-filters.jar"
  2574. #:source-dir "src/main/java"
  2575. #:tests? #f; require maven-plugin-testing-harness, which requires maven 3.2.
  2576. #:phases
  2577. (modify-phases %standard-phases
  2578. (add-before 'build 'remove-sisu
  2579. (lambda _
  2580. ;; Replace sisu with an existing dependency, to prevent a failure
  2581. ;; when rewritting dependency versions
  2582. (substitute* "pom.xml"
  2583. (("sisu-inject-plexus") "maven-plugin-api")
  2584. (("org.sonatype.sisu") "org.apache.maven"))
  2585. #t))
  2586. (replace 'install
  2587. (install-from-pom "pom.xml")))))
  2588. (propagated-inputs
  2589. `(("maven-artifact" ,maven-3.0-artifact)
  2590. ("maven-model" ,maven-3.0-model)
  2591. ("maven-core" ,maven-3.0-core)
  2592. ("maven-plugin-api" ,maven-3.0-plugin-api)
  2593. ("maven-shared-utils" ,maven-shared-utils)
  2594. ("maven-parent-pom" ,maven-parent-pom-33)
  2595. ("java-sonatype-aether-api" ,java-sonatype-aether-api)
  2596. ("java-sonatype-aether-util" ,java-sonatype-aether-util)))
  2597. (inputs
  2598. `(("maven-resolver-api" ,maven-resolver-api)
  2599. ("maven-resolver-util" ,maven-resolver-util)))
  2600. (native-inputs
  2601. `(("unzip" ,unzip)))
  2602. (home-page "https://maven.apache.org/shared/maven-dependency-tree")
  2603. (synopsis "Tree-based API for resolution of Maven project dependencies")
  2604. (description "This package provides a tree-based API for resolution of
  2605. Maven project dependencies.")
  2606. (license license:asl2.0)))
  2607. (define-public maven-enforcer-api
  2608. (package
  2609. (name "maven-enforcer-api")
  2610. (version "3.0.0-M3")
  2611. (source (origin
  2612. (method url-fetch)
  2613. (uri (string-append "mirror://apache/maven/enforcer/"
  2614. "enforcer-" version "-source-release.zip"))
  2615. (sha256
  2616. (base32
  2617. "014cwj0dqa69nnlzcin8pk9wsjmmg71vsbcpb16cibcjpm6h9wjg"))
  2618. (patches
  2619. (search-patches "maven-enforcer-api-fix-old-dependencies.patch"))))
  2620. (build-system ant-build-system)
  2621. (arguments
  2622. `(#:jar-name "maven-enforcer-api.jar"
  2623. #:source-dir "enforcer-api/src/main/java"
  2624. #:tests? #f; no tests
  2625. #:phases
  2626. (modify-phases %standard-phases
  2627. (replace 'install
  2628. (install-from-pom "enforcer-api/pom.xml")))))
  2629. (propagated-inputs
  2630. `(("maven-plugin-api" ,maven-plugin-api)
  2631. ("java-plexus-container-default" ,java-plexus-container-default)
  2632. ("java-jsr305" ,java-jsr305)
  2633. ("maven-enforcer-parent-pom" ,maven-enforcer-parent-pom)))
  2634. (native-inputs
  2635. `(("unzip" ,unzip)))
  2636. (home-page "https://maven.apache.org/shared/maven-dependency-tree")
  2637. (synopsis "Tree-based API for resolution of Maven project dependencies")
  2638. (description "This package provides a tree-based API for resolution of
  2639. Maven project dependencies.")
  2640. (license license:asl2.0)))
  2641. (define maven-enforcer-parent-pom
  2642. (package
  2643. (inherit maven-enforcer-api)
  2644. (name "maven-enforcer-parent-pom")
  2645. (arguments
  2646. `(#:tests? #f
  2647. #:phases
  2648. (modify-phases %standard-phases
  2649. (delete 'configure)
  2650. (delete 'build)
  2651. (add-before 'install 'fix-pom-versions
  2652. (lambda _
  2653. (substitute* "pom.xml"
  2654. (("3.8.1") ,(package-version java-commons-lang3))
  2655. (("1.4.1") ,(package-version maven-resolver-util))
  2656. (("1.12") ,(package-version java-commons-codec))
  2657. (("<version>2.2</version>")
  2658. ,(string-append "<version>" (package-version maven-dependency-tree)
  2659. "</version>")))))
  2660. (replace 'install
  2661. (install-pom-file "pom.xml")))))
  2662. (propagated-inputs
  2663. `(("maven-parent-pom" ,maven-parent-pom-30)))))
  2664. (define-public maven-enforcer-rules
  2665. (package
  2666. (inherit maven-enforcer-api)
  2667. (name "maven-enforcer-rules")
  2668. (arguments
  2669. `(#:tests? #f; requires maven-plugin-testing-harness
  2670. #:jar-name "maven-enforcer-rules.jar"
  2671. #:source-dir "enforcer-rules/src/main/java"
  2672. #:test-dir "enforcer-rules/src/test"
  2673. #:phases
  2674. (modify-phases %standard-phases
  2675. (replace 'install
  2676. (install-from-pom "enforcer-rules/pom.xml")))))
  2677. (propagated-inputs
  2678. `(("maven-artifact" ,maven-artifact)
  2679. ("maven-plugin-api" ,maven-plugin-api)
  2680. ("maven-core" ,maven-core)
  2681. ("maven-common-artifact-filters" ,maven-common-artifact-filters)
  2682. ("java-commons-codec" ,java-commons-codec)
  2683. ("java-commons-lang3" ,java-commons-lang3)
  2684. ("maven-enforcer-api" ,maven-enforcer-api)
  2685. ("maven-resolver-util" ,maven-resolver-util)
  2686. ("java-bsh" ,java-bsh)
  2687. ("maven-dependency-tree" ,maven-dependency-tree)
  2688. ("maven-compat" ,maven-3.0-compat)
  2689. ("maven-enforcer-parent-pom" ,maven-enforcer-parent-pom)))))
  2690. (define-public maven-enforcer-plugin
  2691. (package
  2692. (inherit maven-enforcer-api)
  2693. (name "maven-enforcer-plugin")
  2694. (arguments
  2695. `(#:tests? #f
  2696. #:jar-name "maven-enforcer-plugin.jar"
  2697. #:source-dir "maven-enforcer-plugin/src/main/java"
  2698. #:phases
  2699. (modify-phases %standard-phases
  2700. (add-before 'build 'generate-plugin.xml
  2701. (generate-plugin.xml "maven-enforcer-plugin/pom.xml"
  2702. "enforcer"
  2703. "maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/"
  2704. (list
  2705. (list "DisplayInfoMojo.java")
  2706. (list "EnforceMojo.java"))))
  2707. (replace 'install
  2708. (install-from-pom "maven-enforcer-plugin/pom.xml")))))
  2709. (propagated-inputs
  2710. `(("maven-artifact" ,maven-artifact)
  2711. ("maven-plugin-api" ,maven-plugin-api)
  2712. ("maven-core" ,maven-core)
  2713. ("java-plexus-utils" ,java-plexus-utils)
  2714. ("maven-enforcer-api" ,maven-enforcer-api)
  2715. ("maven-enforcer-rules" ,maven-enforcer-rules)
  2716. ("maven-plugin-annotations" ,maven-plugin-annotations)
  2717. ("maven-enforcer-parent-pom" ,maven-enforcer-parent-pom)))))
  2718. (define-public maven-artifact-transfer
  2719. (package
  2720. (name "maven-artifact-transfer")
  2721. (version "0.12.0")
  2722. (source (origin
  2723. (method url-fetch)
  2724. (uri (string-append "mirror://apache/maven/shared/"
  2725. "maven-artifact-transfer-" version
  2726. "-source-release.zip"))
  2727. (sha256
  2728. (base32
  2729. "0mkdjr3wnvaxqaq68sy7h4mqlq3xgwwp5s2anj5vbxfy4bsc1ivj"))))
  2730. (build-system ant-build-system)
  2731. (arguments
  2732. `(#:tests? #f; require mockito 2
  2733. #:jar-name "maven-artifact-transfer.jar"
  2734. #:source-dir "src/main/java"
  2735. #:phases
  2736. (modify-phases %standard-phases
  2737. (add-after 'build 'generate-metadata
  2738. (lambda _
  2739. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  2740. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  2741. "--source" "src/main/java"
  2742. "--output" "build/classes/META-INF/plexus/components.xml"
  2743. "--classes" "build/classes"
  2744. "--descriptors" "build/classes/META-INF")
  2745. #t))
  2746. (add-after 'generate-metadata 'rebuild
  2747. (lambda _
  2748. (invoke "ant" "jar")
  2749. #t))
  2750. (replace 'install
  2751. (install-from-pom "pom.xml")))))
  2752. (propagated-inputs
  2753. `(("java-commons-codec" ,java-commons-codec)
  2754. ("maven-artifact" ,maven-3.0-artifact)
  2755. ("maven-core" ,maven-3.0-core)
  2756. ("maven-common-artifact-filters" ,maven-common-artifact-filters)
  2757. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  2758. ("java-plexus-utils" ,java-plexus-utils)
  2759. ("java-slf4j-api" ,java-slf4j-api)
  2760. ("java-plexus-classworlds" ,java-plexus-classworlds)
  2761. ("java-sonatype-aether-api" ,java-sonatype-aether-api)
  2762. ("java-eclipse-aether-api" ,java-eclipse-aether-api)
  2763. ("java-eclipse-aether-util" ,java-eclipse-aether-util)
  2764. ("java-eclipse-aether-impl" ,java-eclipse-aether-impl)))
  2765. (native-inputs
  2766. `(("unzip" ,unzip)
  2767. ("java-plexus-component-metadata" ,java-plexus-component-metadata)))
  2768. (home-page "https://maven.apache.org/shared/maven-artifact-transfer")
  2769. (synopsis "API to install, deploy and resolve artifacts in Maven")
  2770. (description "This package contains an API to install, deploy and resolve
  2771. artifacts in Maven 3.")
  2772. (license license:asl2.0)))
  2773. (define-public maven-install-plugin
  2774. (package
  2775. (name "maven-install-plugin")
  2776. (version "3.0.0-M1")
  2777. (source (origin
  2778. (method url-fetch)
  2779. (uri (string-append "mirror://apache/maven/plugins/"
  2780. "maven-install-plugin-" version
  2781. "-source-release.zip"))
  2782. (sha256
  2783. (base32
  2784. "1l9iydxririrair0i5sk2iypn9wspzbb666lc0ddg20yyr8w39dm"))))
  2785. (build-system ant-build-system)
  2786. (arguments
  2787. `(#:tests? #f; require maven-plugin-testing-harness
  2788. #:jar-name "maven-install-plugin.jar"
  2789. #:source-dir "src/main/java"
  2790. #:phases
  2791. (modify-phases %standard-phases
  2792. (add-before 'build 'fix-pom
  2793. (lambda _
  2794. (substitute* "pom.xml"
  2795. (("maven-project") "maven-core")
  2796. (("maven-artifact-manager") "maven-artifact")
  2797. (("2.0.6") "3.0"))
  2798. #t))
  2799. (add-before 'build 'generate-plugin.xml
  2800. (generate-plugin.xml "pom.xml"
  2801. "install"
  2802. "src/main/java/org/apache/maven/plugins/install"
  2803. (list
  2804. (list "AbstractInstallMojo.java" "InstallFileMojo.java")
  2805. (list "AbstractInstallMojo.java" "InstallMojo.java"))))
  2806. (replace 'install
  2807. (install-from-pom "pom.xml")))))
  2808. (propagated-inputs
  2809. `(("maven-artifact" ,maven-artifact)
  2810. ("maven-plugin-api" ,maven-plugin-api)
  2811. ("maven-compat" ,maven-compat)
  2812. ("maven-artifact-transfer" ,maven-artifact-transfer)
  2813. ("maven-plugins-pom-23" ,maven-plugins-pom-23)
  2814. ("java-plexus-digest" ,java-plexus-digest)))
  2815. (inputs
  2816. `(("maven-plugin-annotations" ,maven-plugin-annotations)
  2817. ("java-slf4j-api" ,java-slf4j-api)))
  2818. (native-inputs
  2819. `(("unzip" ,unzip)))
  2820. (home-page "https://maven.apache.org/plugin/maven-install-plugin")
  2821. (synopsis "Maven's install plugin")
  2822. (description "The Install Plugin is used during the install phase to add
  2823. artifact(s) to the local repository. The Install Plugin uses the information
  2824. in the POM (groupId, artifactId, version) to determine the proper location for
  2825. the artifact within the local repository.
  2826. The local repository is the local cache where all artifacts needed for the
  2827. build are stored. By default, it is located within the user's home directory
  2828. (@file{~/.m2/repository}) but the location can be configured in
  2829. @file{~/.m2/settings.xml} using the @code{<localRepository>} element.")
  2830. (license license:asl2.0)))
  2831. (define-public maven-filtering
  2832. (package
  2833. (name "maven-filtering")
  2834. (version "3.1.1")
  2835. (source (origin
  2836. (method url-fetch)
  2837. (uri (string-append "https://archive.apache.org/dist/maven/"
  2838. "shared/maven-filtering-" version
  2839. "-source-release.zip"))
  2840. (sha256
  2841. (base32
  2842. "09wrdhchnszd2l6h4z30ra0bv1a19qyjgac9z8zf1pn0m4nw05yz"))))
  2843. (build-system ant-build-system)
  2844. (arguments
  2845. `(#:jar-name "maven-filtering.jar"
  2846. #:source-dir "src/main/java"
  2847. #:test-dir "src/test"
  2848. ;; this test comes from sisu-build-api, not this package
  2849. #:test-exclude (list "**/IncrementalResourceFilteringTest.java"
  2850. "**/Abstract*.java")
  2851. #:phases
  2852. (modify-phases %standard-phases
  2853. (add-after 'build 'generate-metadata
  2854. (lambda _
  2855. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  2856. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  2857. "--source" "src/main/java"
  2858. "--output" "build/classes/META-INF/plexus/components.xml"
  2859. "--classes" "build/classes"
  2860. "--descriptors" "build/classes/META-INF")
  2861. #t))
  2862. (add-after 'generate-metadata 'rebuild
  2863. (lambda _
  2864. (invoke "ant" "jar")
  2865. #t))
  2866. (add-before 'check 'decompress-tests
  2867. (lambda* (#:key inputs #:allow-other-keys)
  2868. (let* ((build-api-source (assoc-ref inputs "java-sisu-build-api-origin"))
  2869. (classes (string-append build-api-source "/src/test/java")))
  2870. (copy-recursively classes "src/test/"))
  2871. #t))
  2872. (add-before 'check 'fix-directory
  2873. (lambda _
  2874. (substitute* (find-files "src/test" ".*.java$")
  2875. (("target/test-classes/") "build/test-classes/"))))
  2876. (add-before 'check 'copy-test-resources
  2877. (lambda _
  2878. (copy-recursively "src/test/resources" "build/test-classes/")
  2879. #t))
  2880. (replace 'install
  2881. (install-from-pom "pom.xml")))))
  2882. (propagated-inputs
  2883. `(("maven-core" ,maven-3.0-core)
  2884. ("maven-shared-utils" ,maven-shared-utils)
  2885. ("java-plexus-utils" ,java-plexus-utils)
  2886. ("java-plexus-interpolation" ,java-plexus-interpolation)
  2887. ("java-sisu-build-api" ,java-sisu-build-api)
  2888. ("maven-parent-pom" ,maven-parent-pom-30)))
  2889. (inputs
  2890. `(("java-jsr305" ,java-jsr305)))
  2891. (native-inputs
  2892. `(("unzip" ,unzip)
  2893. ("java-assertj" ,java-assertj)
  2894. ("java-junit" ,java-junit)
  2895. ("java-mockito" ,java-mockito-1)
  2896. ("java-objenesis" ,java-objenesis)
  2897. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  2898. ("java-sisu-build-api-origin" ,(package-source java-sisu-build-api))))
  2899. (home-page "https://maven.apache.org/shared/maven-filtering")
  2900. (synopsis "Shared component for all plugins that needs to filter resources")
  2901. (description "This component provides an API to filter resources in Maven
  2902. projects.")
  2903. (license license:asl2.0)))
  2904. (define-public maven-resources-plugin
  2905. (package
  2906. (name "maven-resources-plugin")
  2907. (version "3.1.0")
  2908. (source (origin
  2909. (method git-fetch)
  2910. (uri (git-reference
  2911. (url "https://github.com/apache/maven-resources-plugin")
  2912. (commit (string-append "maven-resources-plugin-" version))))
  2913. (file-name (git-file-name name version))
  2914. (sha256
  2915. (base32
  2916. "090k5j2y7ak54czfjjg3v7pdmdlgd96fbs91d1fd3vslm9zzndg8"))))
  2917. (build-system ant-build-system)
  2918. (arguments
  2919. `(#:jar-name "maven-resources-plugin.jar"
  2920. #:source-dir "src/main/java"
  2921. #:test-dir "src/test"
  2922. #:tests? #f; test depends on maven-plugin-test-harness
  2923. #:phases
  2924. (modify-phases %standard-phases
  2925. (add-before 'build 'generate-plugin.xml
  2926. (generate-plugin.xml "pom.xml" "resources"
  2927. "src/main/java/org/apache/maven/plugins/resources"
  2928. (list
  2929. (list "ResourcesMojo.java" "CopyResourcesMojo.java")
  2930. (list "ResourcesMojo.java")
  2931. (list "ResourcesMojo.java" "TestResourcesMojo.java"))))
  2932. (replace 'install
  2933. (install-from-pom "pom.xml")))))
  2934. (propagated-inputs
  2935. `(("maven-plugin-api" ,maven-plugin-api)
  2936. ("maven-core" ,maven-core)
  2937. ("java-plexus-utils" ,java-plexus-utils)
  2938. ("maven-filtering" ,maven-filtering)
  2939. ("java-plexus-interpolation" ,java-plexus-interpolation)
  2940. ("maven-parent-pom" ,maven-parent-pom-31)))
  2941. (inputs
  2942. `(("maven-plugin-annotations" ,maven-plugin-annotations)
  2943. ("java-commons-io" ,java-commons-io)))
  2944. (native-inputs
  2945. `(("java-plexus-component-metadata" ,java-plexus-component-metadata)))
  2946. (home-page "https://maven.apache.org/plugins/maven-resources-plugin")
  2947. (synopsis "Maven plugin to collect and install resources")
  2948. (description "The Resources Plugin handles the copying of project resources
  2949. to the output directory. There are two different kinds of resources: main
  2950. resources and test resources. The difference is that the main resources are
  2951. the resources associated to the main source code while the test resources are
  2952. associated to the test source code.
  2953. Thus, this allows the separation of resources for the main source code and its
  2954. unit tests.")
  2955. (license license:asl2.0)))
  2956. (define-public maven-shared-incremental
  2957. (package
  2958. (name "maven-shared-incremental")
  2959. (version "1.1")
  2960. (source (origin
  2961. (method url-fetch)
  2962. (uri (string-append "https://archive.apache.org/dist/maven/shared/"
  2963. "maven-shared-incremental-" version
  2964. "-source-release.zip"))
  2965. (sha256
  2966. (base32
  2967. "03n4nfswyg9ahkz2zx4skcr3ghs01zh95g9js51hc75mfqx9b976"))))
  2968. (build-system ant-build-system)
  2969. (arguments
  2970. `(#:jar-name "shared-incremental.java"
  2971. #:source-dir "src/main/java"
  2972. #:test-dir "src/test"
  2973. #:phases
  2974. (modify-phases %standard-phases
  2975. (add-before 'build 'change-parent
  2976. (lambda _
  2977. (substitute* "pom.xml"
  2978. (("19") "30"))
  2979. #t))
  2980. (add-before 'build 'fix-pom
  2981. (lambda _
  2982. (substitute* "pom.xml"
  2983. (("plexus-component-api") "plexus-component-annotations"))
  2984. #t))
  2985. (add-after 'build 'generate-metadata
  2986. (lambda _
  2987. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  2988. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  2989. "--source" "src/main/java"
  2990. "--output" "build/classes/META-INF/plexus/components.xml"
  2991. "--classes" "build/classes"
  2992. "--descriptors" "build/classes/META-INF")
  2993. #t))
  2994. (replace 'install
  2995. (install-from-pom "pom.xml")))))
  2996. (propagated-inputs
  2997. `(("maven-plugin-api" ,maven-plugin-api)
  2998. ("maven-core" ,maven-core)
  2999. ("maven-shared-utils" ,maven-shared-utils)
  3000. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  3001. ("maven-parent-pom" ,maven-parent-pom-30)))
  3002. (native-inputs
  3003. `(("unzip" ,unzip)
  3004. ("java-plexus-component-metadata" ,java-plexus-component-metadata)))
  3005. (home-page "https://maven.apache.org/shared/maven-shared-incremental")
  3006. (synopsis "Maven Incremental Build support utilities")
  3007. (description "This package contains various utility classes and plexus
  3008. components for supporting incremental build functionality in maven plugins.")
  3009. (license license:asl2.0)))
  3010. (define-public maven-compiler-plugin
  3011. (package
  3012. (name "maven-compiler-plugin")
  3013. (version "3.8.1")
  3014. (source (origin
  3015. (method git-fetch)
  3016. (uri (git-reference
  3017. (url "https://github.com/apache/maven-compiler-plugin")
  3018. (commit (string-append "maven-compiler-plugin-" version))))
  3019. (file-name (git-file-name name version))
  3020. (sha256
  3021. (base32
  3022. "0jkbq02vykd09ws8k9bzqxv6fjrpmir8gcxydbmj05kkhl242bma"))))
  3023. (build-system ant-build-system)
  3024. (arguments
  3025. `(#:jar-name "maven-compiler-plugin.jar"
  3026. #:source-dir "src/main/java"
  3027. #:test-dir "src/test"
  3028. #:tests? #f; test depends on maven-plugin-test-harness
  3029. #:phases
  3030. (modify-phases %standard-phases
  3031. (add-before 'build 'generate-plugin.xml
  3032. (generate-plugin.xml "pom.xml"
  3033. "compiler"
  3034. "src/main/java/org/apache/maven/plugin/compiler"
  3035. (list
  3036. (list "AbstractCompilerMojo.java" "CompilerMojo.java")
  3037. (list "AbstractCompilerMojo.java" "TestCompilerMojo.java"))))
  3038. (add-after 'generate-plugin.xml 'fix-plugin.xml
  3039. (lambda _
  3040. (substitute* "build/classes/META-INF/maven/plugin.xml"
  3041. ;; These are defined in AbstractCompilerMojo.java, but not
  3042. ;; parsed correctly in the previous phase
  3043. (("DEFAULT_TARGET") "1.6")
  3044. (("DEFAULT_SOURCE") "1.6"))
  3045. #t))
  3046. (replace 'install
  3047. (install-from-pom "pom.xml")))))
  3048. (propagated-inputs
  3049. `(("maven-plugin-api" ,maven-plugin-api)
  3050. ("maven-artifact" ,maven-artifact)
  3051. ("maven-core" ,maven-core)
  3052. ("maven-shared-utils" ,maven-shared-utils)
  3053. ("maven-shared-incremental" ,maven-shared-incremental)
  3054. ("java-plexus-java" ,java-plexus-java)
  3055. ("java-plexus-compiler-api" ,java-plexus-compiler-api)
  3056. ("java-plexus-compiler-manager" ,java-plexus-compiler-manager)
  3057. ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
  3058. ("maven-parent-pom" ,maven-parent-pom-33)))
  3059. (inputs
  3060. `(("maven-plugin-annotations" ,maven-plugin-annotations)
  3061. ("java-commons-io" ,java-commons-io)))
  3062. (home-page "https://maven.apache.org/plugins/maven-compiler-plugin")
  3063. (synopsis "Compiler plugin for Maven")
  3064. (description "The Compiler Plugin is used to compile the sources of your
  3065. project. Since 3.0, the default compiler is @code{javax.tools.JavaCompiler}
  3066. (if you are using java 1.6) and is used to compile Java sources. If you want
  3067. to force the plugin using javac, you must configure the plugin option
  3068. @code{forceJavacCompilerUse}.
  3069. Also note that at present the default source setting is 1.6 and the default
  3070. target setting is 1.6, independently of the JDK you run Maven with. You are
  3071. highly encouraged to change these defaults by setting source and target as
  3072. described in Setting the -source and -target of the Java Compiler.
  3073. Other compilers than javac can be used and work has already started on
  3074. AspectJ, .NET, and C#.")
  3075. (license license:asl2.0)))
  3076. (define-public java-surefire-logger-api
  3077. (package
  3078. (name "java-surefire-logger-api")
  3079. (version "3.0.0-M4")
  3080. (source (origin
  3081. (method url-fetch)
  3082. (uri (string-append "mirror://apache/maven/surefire/"
  3083. "surefire-" version "-source-release.zip"))
  3084. (sha256
  3085. (base32
  3086. "1s6d4pzk3bjm9l38mj9sfgbgmk145rppdj1dmqwc4d5105mr9q9w"))))
  3087. (build-system ant-build-system)
  3088. (arguments
  3089. `(#:jar-name "java-surefire-logger-api.jar"
  3090. #:source-dir "surefire-logger-api/src/main/java"
  3091. #:tests? #f; require mockito 2
  3092. #:phases
  3093. (modify-phases %standard-phases
  3094. (replace 'install
  3095. (install-from-pom "surefire-logger-api/pom.xml")))))
  3096. (propagated-inputs
  3097. `(("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3098. (native-inputs
  3099. `(("unzip" ,unzip)))
  3100. (home-page "https://maven.apache.org/surefire/surefire-logger-api")
  3101. (synopsis "Interfaces and Utilities related only to internal SureFire Logger API")
  3102. (description "This package contains interfaces and utilities that are
  3103. internal to the SureFire Logger API. It is designed to have no dependency.")
  3104. (license license:asl2.0)))
  3105. (define-public java-surefire-parent-pom
  3106. (package
  3107. (inherit java-surefire-logger-api)
  3108. (name "java-surefire-parent-pom")
  3109. (arguments
  3110. `(#:tests? #f
  3111. #:phases
  3112. (modify-phases %standard-phases
  3113. (delete 'configure)
  3114. (delete 'build)
  3115. (add-before 'install 'fix-pom-dependency-versions
  3116. (lambda _
  3117. (substitute* "pom.xml"
  3118. (("1.11") ,(package-version java-commons-compress))
  3119. (("1.13") ,(package-version java-commons-codec)))
  3120. (substitute* "pom.xml"
  3121. (("commonsLang3Version>.*")
  3122. (string-append
  3123. "commonsLang3Version>"
  3124. ,(package-version java-commons-lang3)
  3125. "</commonsLang3Version>\n"))
  3126. (("commonsCompress>.*")
  3127. (string-append
  3128. "commonsCompress>"
  3129. ,(package-version java-commons-compress)
  3130. "</commonsCompress>\n"))
  3131. (("commonsIoVersion>.*")
  3132. (string-append
  3133. "commonsIoVersion>"
  3134. ,(package-version java-commons-io)
  3135. "</commonsIoVersion>\n"))
  3136. (("0.11.0") ,(package-version maven-artifact-transfer))
  3137. (("1.0.3") ,(package-version java-plexus-java)))
  3138. #t))
  3139. (add-after 'install 'install-providers
  3140. (install-pom-file "surefire-providers/pom.xml"))
  3141. (replace 'install
  3142. (install-pom-file "pom.xml")))))
  3143. (propagated-inputs
  3144. `(("maven-parent-pom" ,maven-parent-pom-33)))))
  3145. (define-public java-surefire-api
  3146. (package
  3147. (inherit java-surefire-logger-api)
  3148. (name "java-surefire-api")
  3149. (arguments
  3150. `(#:tests? #f
  3151. #:jar-name "java-surefire-api.jar"
  3152. #:source-dir "surefire-api/src/main/java"
  3153. #:phases
  3154. (modify-phases %standard-phases
  3155. (add-before 'build 'copy-resources
  3156. (lambda _
  3157. (mkdir-p "build/classes")
  3158. (copy-recursively "surefire-api/src/main/resources" "build/classes")
  3159. #t))
  3160. (add-before 'build 'prepare-shade
  3161. (lambda* (#:key inputs #:allow-other-keys)
  3162. (mkdir-p "build/classes")
  3163. (with-directory-excursion "build/classes"
  3164. (for-each
  3165. (lambda (input)
  3166. (for-each
  3167. (lambda (jar-file)
  3168. (invoke "jar" "xf" jar-file)
  3169. (delete-file-recursively "META-INF"))
  3170. (find-files (assoc-ref inputs input) ".*.jar$")))
  3171. '("maven-shared-utils" "java-commons-codec")))
  3172. #t))
  3173. (add-after 'build 'shade
  3174. (lambda* (#:key inputs #:allow-other-keys)
  3175. (let ((jarjar
  3176. (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
  3177. (injar "java-surefire-api.jar")
  3178. (outjar "java-surefire-api-shaded.jar"))
  3179. (with-directory-excursion "build/jar"
  3180. (with-output-to-file "rules"
  3181. (lambda _
  3182. (format #t (string-append
  3183. "rule "
  3184. "org.apache.maven.shared.utils.** "
  3185. "org.apache.maven.surefire.shade.api."
  3186. "org.apache.maven.shared.utils.@1~%"))
  3187. (format #t (string-append
  3188. "rule "
  3189. "org.apache.commons.codec.** "
  3190. "org.apache.maven.surefire.shade.api."
  3191. "org.apache.commons.codec.@1~%"))))
  3192. (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
  3193. (delete-file injar)
  3194. (rename-file outjar injar)))
  3195. #t))
  3196. (replace 'install
  3197. (install-from-pom "surefire-api/pom.xml")))))
  3198. (propagated-inputs
  3199. `(("java-surefire-logger-api" ,java-surefire-logger-api)
  3200. ("java-commons-codec" ,java-commons-codec)
  3201. ("java-surefire-parent-pom" ,java-surefire-parent-pom)
  3202. ("maven-shared-utils" ,maven-shared-utils-3.1)))
  3203. (inputs
  3204. `(("java-jsr305" ,java-jsr305)))
  3205. (native-inputs
  3206. `(("unzip" ,unzip)
  3207. ("java-jarjar" ,java-jarjar)))
  3208. (synopsis "Maven SureFire API")
  3209. (description "This package contains the API to use Maven SureFire.")))
  3210. (define-public java-surefire-booter
  3211. (package
  3212. (inherit java-surefire-logger-api)
  3213. (name "java-surefire-booter")
  3214. (arguments
  3215. `(#:tests? #f; require mockito 2
  3216. #:jar-name "java-surefire-booter.jar"
  3217. #:source-dir "surefire-booter/src/main/java"
  3218. #:phases
  3219. (modify-phases %standard-phases
  3220. (add-before 'build 'fix-/bin/sh
  3221. (lambda _
  3222. (substitute* "surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java"
  3223. (("/bin/sh") (which "sh")))
  3224. #t))
  3225. (replace 'install
  3226. (install-from-pom "surefire-booter/pom.xml")))))
  3227. (propagated-inputs
  3228. `(("java-surefire-api" ,java-surefire-api)
  3229. ("java-commons-lang3" ,java-commons-lang3)
  3230. ("java-commons-io" ,java-commons-io)
  3231. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3232. (inputs
  3233. `(("java-jsr305" ,java-jsr305)))
  3234. (synopsis "API and Facilities used by forked tests running in JVM sub-process")
  3235. (description "SureFire runs tests inside a forked JVM subprocess. This
  3236. package contains an API and facilities used inside that forked JVM.")))
  3237. (define-public java-surefire-extensions-api
  3238. (package
  3239. (inherit java-surefire-logger-api)
  3240. (name "java-surefire-extensions-api")
  3241. (arguments
  3242. `(#:tests? #f; requires mockito 2
  3243. #:jar-name "java-surefire-extensions-api.jar"
  3244. #:source-dir "surefire-extensions-api/src/main/java"
  3245. #:phases
  3246. (modify-phases %standard-phases
  3247. (replace 'install
  3248. (install-from-pom "surefire-extensions-api/pom.xml")))))
  3249. (propagated-inputs
  3250. `(("java-surefire-api" ,java-surefire-api)
  3251. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3252. (inputs
  3253. `(("java-plexus-component-annotations" ,java-plexus-component-annotations)))
  3254. (synopsis "Extension API for Maven SureFire")
  3255. (description "Surefire is a test framework project. This is the aggregator
  3256. POM in Apache Maven Surefire project.")))
  3257. (define-public java-surefire-common-java5
  3258. (package
  3259. (inherit java-surefire-logger-api)
  3260. (name "java-surefire-common-java5")
  3261. (arguments
  3262. `(#:jar-name "java-surefire-common-java5.jar"
  3263. #:source-dir "surefire-providers/common-java5/src/main/java"
  3264. #:test-dir "surefire-providers/common-java5/src/test"
  3265. #:test-exclude (list
  3266. ;; Abstract class
  3267. "**/PojoStackTraceWriterTest.java"
  3268. ;; Fails
  3269. "**/SmartStackTraceParserTest.java")
  3270. #:phases
  3271. (modify-phases %standard-phases
  3272. (add-before 'build 'prepare-shade
  3273. (lambda* (#:key inputs #:allow-other-keys)
  3274. (mkdir-p "build/classes")
  3275. (with-directory-excursion "build/classes"
  3276. (for-each
  3277. (lambda (jar-file)
  3278. (invoke "jar" "xf" jar-file)
  3279. (delete-file-recursively "META-INF"))
  3280. (find-files (assoc-ref inputs "maven-shared-utils") ".*.jar$")))
  3281. #t))
  3282. (add-after 'build 'shade
  3283. (lambda* (#:key inputs #:allow-other-keys)
  3284. (let ((jarjar
  3285. (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
  3286. (injar "java-surefire-common-java5.jar")
  3287. (outjar "java-surefire-common-java5-shaded.jar"))
  3288. (with-directory-excursion "build/jar"
  3289. (with-output-to-file "rules"
  3290. (lambda _
  3291. (format #t (string-append
  3292. "rule "
  3293. "org.apache.maven.shared.utils.** "
  3294. "org.apache.maven.surefire.shade.common."
  3295. "org.apache.maven.shared.utils.@1~%"))))
  3296. (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
  3297. (delete-file injar)
  3298. (rename-file outjar injar)))
  3299. #t))
  3300. (replace 'install
  3301. (install-from-pom "surefire-providers/common-java5/pom.xml")))))
  3302. (propagated-inputs
  3303. `(("maven-shared-utils" ,maven-shared-utils-3.1)
  3304. ("java-surefire-api" ,java-surefire-api)
  3305. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3306. (native-inputs
  3307. `(("unzip" ,unzip)
  3308. ("java-jarjar" ,java-jarjar)
  3309. ("java-junit" ,java-junit)
  3310. ("java-fest-assert" ,java-fest-assert)))
  3311. (synopsis "Common java5 facilities for Maven SureFire")
  3312. (description "This package contains shared Java 5 code for all providers.")))
  3313. (define-public java-surefire-common-junit3
  3314. (package
  3315. (inherit java-surefire-logger-api)
  3316. (name "java-surefire-common-junit3")
  3317. (arguments
  3318. `(#:jar-name "java-surefire-common-junit3.jar"
  3319. #:source-dir "surefire-providers/common-junit3/src/main/java"
  3320. #:test-dir "surefire-providers/common-junit3/src/test"
  3321. #:phases
  3322. (modify-phases %standard-phases
  3323. (replace 'install
  3324. (install-from-pom "surefire-providers/common-junit3/pom.xml")))))
  3325. (propagated-inputs
  3326. `(("java-junit" ,java-junit)
  3327. ("java-surefire-api" ,java-surefire-api)
  3328. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3329. (native-inputs
  3330. `(("unzip" ,unzip)
  3331. ("java-junit" ,java-junit)
  3332. ("java-fest-assert" ,java-fest-assert)))
  3333. (synopsis "Shared JUnit3 provider code for Maven SureFire")
  3334. (description "This package contains shared code for all JUnit providers.")))
  3335. (define-public java-surefire-common-junit4
  3336. (package
  3337. (inherit java-surefire-logger-api)
  3338. (name "java-surefire-common-junit4")
  3339. (arguments
  3340. `(#:jar-name "java-surefire-common-junit4.jar"
  3341. #:source-dir "surefire-providers/common-junit4/src/main/java"
  3342. #:tests? #f; tests require junit 4.0
  3343. #:phases
  3344. (modify-phases %standard-phases
  3345. (replace 'install
  3346. (install-from-pom "surefire-providers/common-junit4/pom.xml")))))
  3347. (propagated-inputs
  3348. `(("java-junit" ,java-junit)
  3349. ("java-surefire-api" ,java-surefire-api)
  3350. ("java-surefire-common-java5" ,java-surefire-common-java5)
  3351. ("java-surefire-common-junit3" ,java-surefire-common-junit3)
  3352. ("maven-shared-utils" ,maven-shared-utils-3.1)
  3353. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3354. (synopsis "Shared JUnit4 provider code for Maven SureFire")
  3355. (description "This package contains shared code for all JUnit providers,
  3356. starting from JUnit 4.")))
  3357. (define-public java-surefire-junit4
  3358. (package
  3359. (inherit java-surefire-logger-api)
  3360. (name "java-surefire-junit4")
  3361. (arguments
  3362. `(;#:tests? #f
  3363. #:jar-name "java-surefire-junit4.jar"
  3364. #:source-dir "surefire-providers/surefire-junit4/src/main/java"
  3365. #:test-dir "surefire-providers/surefire-junit4/src/test"
  3366. #:modules ((guix build ant-build-system)
  3367. (guix build utils)
  3368. (guix build java-utils)
  3369. (sxml simple))
  3370. #:phases
  3371. (modify-phases %standard-phases
  3372. (add-before 'install 'regenerate-own-pom
  3373. ;; Surefire struggles resolving artifacts because of this pom
  3374. ;; file, resulting in a NullPointerException when collecting
  3375. ;; Artifacts (and a "Failure detected." message from
  3376. ;; DefaultArtifactResolver). Replace the pom file with a much
  3377. ;; simpler one. Everything is shaded anyway (as used to be the
  3378. ;; case in 2.22), so there will not be missing dependencies.
  3379. (generate-pom.xml
  3380. "surefire-providers/surefire-junit4/pom.xml"
  3381. "org.apache.maven.surefire" "surefire-junit4"
  3382. ,(package-version java-surefire-common-java5)
  3383. #:name "Surefire JUnit4"))
  3384. (add-before 'build 'copy-resources
  3385. (lambda _
  3386. (mkdir-p "build/classes")
  3387. (copy-recursively "surefire-providers/surefire-junit4/src/main/resources"
  3388. "build/classes")
  3389. #t))
  3390. (add-before 'build 'prepare-shade
  3391. (lambda* (#:key inputs #:allow-other-keys)
  3392. (mkdir-p "build/classes")
  3393. (with-directory-excursion "build/classes"
  3394. (for-each
  3395. (lambda (input)
  3396. (for-each
  3397. (lambda (jar-file)
  3398. (invoke "jar" "xf" jar-file)
  3399. (delete-file-recursively "META-INF"))
  3400. (find-files (assoc-ref inputs input) ".*.jar$")))
  3401. '("maven-shared-utils" "java-surefire-common-java5"
  3402. "java-surefire-common-junit3" "java-surefire-common-junit4"
  3403. "java-surefire-api")))
  3404. #t))
  3405. (add-after 'build 'shade
  3406. (lambda* (#:key inputs #:allow-other-keys)
  3407. (let ((jarjar
  3408. (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
  3409. (injar "java-surefire-junit4.jar")
  3410. (outjar "java-surefire-junit4-shaded.jar"))
  3411. (with-directory-excursion "build/jar"
  3412. (with-output-to-file "rules"
  3413. (lambda _
  3414. (format #t (string-append
  3415. "rule "
  3416. "org.apache.maven.shared.utils.** "
  3417. "org.apache.maven.surefire.shade."
  3418. "org.apache.maven.shared.utils.@1~%"))))
  3419. (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
  3420. (delete-file injar)
  3421. (rename-file outjar injar)))
  3422. #t))
  3423. (replace 'install
  3424. (install-from-pom "surefire-providers/surefire-junit4/pom.xml")))))
  3425. (propagated-inputs
  3426. `(("java-junit" ,java-junit)
  3427. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3428. (inputs
  3429. `(("java-surefire-common-junit4" ,java-surefire-common-junit4)
  3430. ("java-surefire-common-junit3" ,java-surefire-common-junit3)
  3431. ("java-surefire-common-java5" ,java-surefire-common-java5)
  3432. ("java-surefire-api" ,java-surefire-api)))
  3433. (native-inputs
  3434. `(("java-jarjar" ,java-jarjar)
  3435. ("unzip" ,unzip)
  3436. ("java-junit" ,java-junit)
  3437. ("java-hamcrest-all" ,java-hamcrest-all)
  3438. ("java-fest-assert" ,java-fest-assert)))
  3439. (synopsis "SureFire JUnit 4.0+ runner")
  3440. (description "This package contains the runner for tests run on a forked
  3441. JVM, using JUnit 4.0 or later.")))
  3442. (define-public maven-surefire-common
  3443. (package
  3444. (inherit java-surefire-logger-api)
  3445. (name "maven-surefire-common")
  3446. (arguments
  3447. `(#:tests? #f; require mockito 2
  3448. #:jar-name "maven-surefire-common.jar"
  3449. #:source-dir "maven-surefire-common/src/main/java"
  3450. #:phases
  3451. (modify-phases %standard-phases
  3452. (add-before 'build 'prepare-shade
  3453. (lambda* (#:key inputs #:allow-other-keys)
  3454. (mkdir-p "build/classes")
  3455. (with-directory-excursion "build/classes"
  3456. (for-each
  3457. (lambda (input)
  3458. (for-each
  3459. (lambda (jar-file)
  3460. (invoke "jar" "xf" jar-file)
  3461. (delete-file-recursively "META-INF"))
  3462. (find-files (assoc-ref inputs input) ".*.jar$")))
  3463. '("maven-shared-utils" "java-commons-io" "java-commons-lang3"
  3464. "java-commons-compress" "maven-common-artifact-filters")))
  3465. #t))
  3466. (add-after 'build 'shade
  3467. (lambda* (#:key inputs #:allow-other-keys)
  3468. (let ((jarjar
  3469. (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
  3470. (injar "maven-surefire-common.jar")
  3471. (outjar "maven-surefire-common-shaded.jar"))
  3472. (with-directory-excursion "build/jar"
  3473. (with-output-to-file "rules"
  3474. (lambda _
  3475. (format #t (string-append
  3476. "rule "
  3477. "org.apache.maven.shared.utils.** "
  3478. "org.apache.maven.surefire.shade.common."
  3479. "org.apache.maven.shared.utils.@1~%"))
  3480. (format #t (string-append
  3481. "rule "
  3482. "org.apache.commons.io.** "
  3483. "org.apache.maven.surefire.shade.common."
  3484. "org.apache.commons.io.@1~%"))
  3485. (format #t (string-append
  3486. "rule "
  3487. "org.apache.commons.lang3.** "
  3488. "org.apache.maven.surefire.shade.common."
  3489. "org.apache.commons.lang3.@1~%"))
  3490. (format #t (string-append
  3491. "rule "
  3492. "org.apache.commons.compress.** "
  3493. "org.apache.maven.surefire.shade.common."
  3494. "org.apache.commons.compress.@1~%"))))
  3495. (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
  3496. (delete-file injar)
  3497. (rename-file outjar injar)))
  3498. #t))
  3499. (add-before 'install 'fix-pom
  3500. (lambda _
  3501. (substitute* "maven-surefire-common/pom.xml"
  3502. (("maven-toolchain") "maven-core"))
  3503. #t))
  3504. (replace 'install
  3505. (install-from-pom "maven-surefire-common/pom.xml")))))
  3506. (propagated-inputs
  3507. `(("java-surefire-api" ,java-surefire-api)
  3508. ("java-surefire-extensions-api" ,java-surefire-extensions-api)
  3509. ("java-surefire-booter" ,java-surefire-booter)
  3510. ("maven-core" ,maven-core)
  3511. ("maven-plugin-annotations" ,maven-plugin-annotations)
  3512. ("maven-common-artifact-filters" ,maven-common-artifact-filters)
  3513. ("maven-artifact-transfer" ,maven-artifact-transfer)
  3514. ("java-plexus-java" ,java-plexus-java)
  3515. ("java-jansi" ,java-jansi)
  3516. ("java-commons-io" ,java-commons-io)
  3517. ("java-commons-lang3" ,java-commons-lang3)
  3518. ("java-commons-compress" ,java-commons-compress)
  3519. ("maven-shared-utils" ,maven-shared-utils-3.1)
  3520. ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
  3521. (inputs
  3522. `(("java-jsr305" ,java-jsr305)))
  3523. (native-inputs
  3524. `(("unzip" ,unzip)
  3525. ("java-jarjar" ,java-jarjar)))
  3526. (synopsis "API used in Surefire and Failsafe MOJO")
  3527. (description "This package contains an API used in SureFire and Failsafe
  3528. MOJO.")))
  3529. (define-public maven-surefire-plugin
  3530. (package
  3531. (inherit java-surefire-logger-api)
  3532. (name "maven-surefire-plugin")
  3533. (arguments
  3534. `(#:jar-name "maven-surefire-plugin.jar"
  3535. #:source-dir "maven-surefire-plugin/src/main/java"
  3536. #:tests? #f; test depends on maven-plugin-test-harness
  3537. #:phases
  3538. (modify-phases %standard-phases
  3539. (add-before 'build 'generate-plugin.xml
  3540. (generate-plugin.xml "maven-surefire-plugin/pom.xml"
  3541. "surefire"
  3542. "."
  3543. (list
  3544. (list
  3545. "maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java"
  3546. "maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java"))))
  3547. (replace 'install
  3548. (install-from-pom "maven-surefire-plugin/pom.xml")))))
  3549. (propagated-inputs
  3550. `(("maven-surefire-common" ,maven-surefire-common)
  3551. ("maven-core" ,maven-core)))
  3552. (native-inputs
  3553. `(("maven-plugin-annotations" ,maven-plugin-annotations)
  3554. ("unzip" ,unzip)))
  3555. (synopsis "SureFire Maven plugin that runs tests.")
  3556. (description "The Surefire Plugin is used during the test phase of the
  3557. build lifecycle to execute the unit tests of an application. It generates
  3558. reports in two different file formats, plain text and xml.")))
  3559. (define-public maven-jar-plugin
  3560. (package
  3561. (name "maven-jar-plugin")
  3562. (version "3.2.0")
  3563. (source (origin
  3564. (method git-fetch)
  3565. (uri (git-reference
  3566. (url "https://github.com/apache/maven-jar-plugin")
  3567. (commit (string-append "maven-jar-plugin-" version))))
  3568. (file-name (git-file-name name version))
  3569. (sha256
  3570. (base32
  3571. "04y2rlmcabmc55ljqlkgbb5xx94a59cz1dvrnpfj1vzz024pqkyg"))))
  3572. (build-system ant-build-system)
  3573. (arguments
  3574. `(#:jar-name "maven-jar-plugin.jar"
  3575. #:source-dir "src/main/java"
  3576. #:tests? #f; test depends on maven-plugin-test-harness
  3577. #:phases
  3578. (modify-phases %standard-phases
  3579. (add-before 'build 'generate-plugin.xml
  3580. (generate-plugin.xml "pom.xml"
  3581. "jar"
  3582. "src/main/java/org/apache/maven/plugins/jar"
  3583. (list
  3584. (list "AbstractJarMojo.java" "JarMojo.java")
  3585. (list "AbstractJarMojo.java" "TestJarMojo.java"))))
  3586. (replace 'install
  3587. (install-from-pom "pom.xml")))))
  3588. (propagated-inputs
  3589. `(("maven-archiver" ,maven-archiver)
  3590. ("maven-artifact" ,maven-3.0-artifact)
  3591. ("maven-core" ,maven-3.0-core)
  3592. ("maven-plugin-api" ,maven-3.0-plugin-api)
  3593. ("maven-file-management" ,maven-file-management)
  3594. ("maven-shared-utils" ,maven-shared-utils)
  3595. ("java-plexus-archiver" ,java-plexus-archiver)
  3596. ("java-plexus-utils" ,java-plexus-utils)))
  3597. (inputs
  3598. `(("maven-plugin-annotations" ,maven-plugin-annotations)))
  3599. (home-page "https://maven.apache.org/plugins/maven-jar-plugin")
  3600. (synopsis "Jar builder plugin for Maven")
  3601. (description "This plugin provides the capability to build jars. If you
  3602. would like to sign jars please use the Maven Jarsigner Plugin instead.")
  3603. (license license:asl2.0)))