maven.scm 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
  3. ;;; Copyright © 2019 Tobias Geerinckx-Rite <me@tobias.gr>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages maven)
  20. #:use-module ((guix licenses) #:prefix license:)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix git-download)
  24. #:use-module (guix utils)
  25. #:use-module (guix build-system ant)
  26. #:use-module (gnu packages)
  27. #:use-module (gnu packages base)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages java)
  30. #:use-module (gnu packages web)
  31. #:use-module (gnu packages xml))
  32. (define-public java-plexus-component-metadata
  33. (package
  34. (inherit java-plexus-container-default)
  35. (name "java-plexus-component-metadata")
  36. (arguments
  37. `(#:jar-name "plexus-component-metadata.jar"
  38. #:source-dir "src/main/java"
  39. #:test-dir "src/test"
  40. #:jdk ,icedtea-8
  41. #:phases
  42. (modify-phases %standard-phases
  43. (add-before 'configure 'chdir
  44. (lambda _
  45. (chdir "plexus-component-metadata")
  46. #t))
  47. (add-before 'build 'copy-resources
  48. (lambda _
  49. (copy-recursively "src/main/resources"
  50. "build/classes/")
  51. #t)))))
  52. (inputs
  53. `(("java-plexus-container-default" ,java-plexus-container-default)
  54. ("java-plexu-component-annotations" ,java-plexus-component-annotations)
  55. ("java-plexus-utils" ,java-plexus-utils)
  56. ("java-plexus-cli" ,java-plexus-cli)
  57. ("java-plexus-classworlds" ,java-plexus-classworlds)
  58. ("maven-plugin-api" ,maven-plugin-api)
  59. ("maven-plugin-annotations" ,maven-plugin-annotations)
  60. ("maven-core-bootstrap" ,maven-core-bootstrap)
  61. ("maven-model" ,maven-model)
  62. ("java-commons-cli" ,java-commons-cli)
  63. ("java-qdox" ,java-qdox)
  64. ("java-jdom2" ,java-jdom2)
  65. ("java-asm" ,java-asm)))
  66. (native-inputs
  67. `(("java-junit" ,java-junit)
  68. ("java-guava" ,java-guava)
  69. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)))
  70. (synopsis "Inversion-of-control container for Maven")
  71. (description "The Plexus project provides a full software stack for creating
  72. and executing software projects. Based on the Plexus container, the
  73. applications can utilise component-oriented programming to build modular,
  74. reusable components that can easily be assembled and reused. This package
  75. provides the Maven plugin generating the component metadata.")))
  76. (define-public maven-resolver-api
  77. (package
  78. (name "maven-resolver-api")
  79. (version "1.3.1")
  80. (source (origin
  81. (method git-fetch)
  82. (uri (git-reference
  83. (url "https://github.com/apache/maven-resolver.git")
  84. (commit (string-append "maven-resolver-" version))))
  85. (file-name (git-file-name name version))
  86. (sha256
  87. (base32
  88. "1x1gll8nkfl6zgnab78fxxvvhg42b2grxgdh1wp2h4qxsjkxg93d"))))
  89. (build-system ant-build-system)
  90. (arguments
  91. `(#:jar-name "maven-resolver-api.jar"
  92. #:source-dir "maven-resolver-api/src/main/java"
  93. #:test-dir "maven-resolver-api/src/test"))
  94. (native-inputs
  95. `(("java-asm" ,java-asm)
  96. ("java-cglib" ,java-cglib)
  97. ("java-hamcrest-core" ,java-hamcrest-core)
  98. ("java-junit" ,java-junit)
  99. ("java-mockito-1" ,java-mockito-1)
  100. ("java-objenesis" ,java-objenesis)))
  101. (home-page "https://github.com/apache/maven-resolver")
  102. (synopsis "Maven repository system API")
  103. (description "This package contains the API for the maven repository system.")
  104. (license license:asl2.0)))
  105. (define-public maven-resolver-spi
  106. (package
  107. (inherit maven-resolver-api)
  108. (name "maven-resolver-spi")
  109. (arguments
  110. `(#:jar-name "maven-resolver-spi.jar"
  111. #:source-dir "maven-resolver-spi/src/main/java"
  112. #:test-dir "maven-resolver-spi/src/test"
  113. #:jdk ,icedtea-8))
  114. (inputs
  115. `(("maven-resolver-api" ,maven-resolver-api)))
  116. (synopsis "Maven repository system SPI")
  117. (description "This package contains the service provider interface (SPI)
  118. for repository system implementations and repository connectors.")))
  119. (define-public maven-resolver-test-util
  120. (package
  121. (inherit maven-resolver-api)
  122. (name "maven-resolver-test-util")
  123. (arguments
  124. `(#:jar-name "maven-resolver-test-util.jar"
  125. #:source-dir "maven-resolver-test-util/src/main/java"
  126. #:test-dir "maven-resolver-test-util/src/test"
  127. #:jdk ,icedtea-8))
  128. (inputs
  129. `(("maven-resolver-api" ,maven-resolver-api)
  130. ("maven-resolver-spi" ,maven-resolver-spi)))
  131. (synopsis "Utility classes for testing the maven repository system")
  132. (description "This package contains a collection of utility classes to
  133. ease testing of the repository system.")))
  134. (define-public maven-resolver-util
  135. (package
  136. (inherit maven-resolver-api)
  137. (name "maven-resolver-util")
  138. (arguments
  139. `(#:jar-name "maven-resolver-util.jar"
  140. #:source-dir "maven-resolver-util/src/main/java"
  141. #:test-dir "maven-resolver-util/src/test"
  142. #:jdk ,icedtea-8))
  143. (inputs
  144. `(("maven-resolver-api" ,maven-resolver-api)))
  145. (native-inputs
  146. `(("java-junit" ,java-junit)
  147. ("java-hamcrest-core" ,java-hamcrest-core)
  148. ("maven-resolver-test-util" ,maven-resolver-test-util)))
  149. (synopsis "Utility classes for the maven repository system")
  150. (description "This package contains a collection of utility classes to
  151. ease usage of the repository system.")))
  152. (define-public maven-resolver-connector-basic
  153. (package
  154. (inherit maven-resolver-api)
  155. (name "maven-resolver-connector-basic")
  156. (arguments
  157. `(#:jar-name "maven-resolver-connector-basic.jar"
  158. #:source-dir "maven-resolver-connector-basic/src/main/java"
  159. #:test-dir "maven-resolver-connector-basic/src/test"
  160. #:jdk ,icedtea-8
  161. #:phases
  162. (modify-phases %standard-phases
  163. (add-before 'build 'generate-sisu
  164. (lambda _
  165. (mkdir-p "build/classes/META-INF/sisu")
  166. (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
  167. (lambda _
  168. (display "org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory\n")))
  169. #t)))))
  170. (inputs
  171. `(("maven-resolver-api" ,maven-resolver-api)
  172. ("maven-resolver-spi" ,maven-resolver-spi)
  173. ("maven-resolver-util" ,maven-resolver-util)
  174. ("java-javax-inject" ,java-javax-inject)
  175. ("java-slf4j-api" ,java-slf4j-api)))
  176. (native-inputs
  177. `(("java-junit" ,java-junit)
  178. ("java-hamcrest-core" ,java-hamcrest-core)
  179. ("maven-resolver-test-util" ,maven-resolver-test-util)))
  180. (synopsis "Maven repository connector implementation")
  181. (description "This package contains a repository connector implementation
  182. for repositories using URI-based layouts.")))
  183. (define-public maven-resolver-impl
  184. (package
  185. (inherit maven-resolver-api)
  186. (name "maven-resolver-impl")
  187. (arguments
  188. `(#:jar-name "maven-resolver-impl.jar"
  189. #:source-dir "maven-resolver-impl/src/main/java"
  190. #:test-dir "maven-resolver-impl/src/test"
  191. #:jdk ,icedtea-8
  192. #:phases
  193. (modify-phases %standard-phases
  194. (add-before 'build 'generate-sisu
  195. (lambda _
  196. (mkdir-p "build/classes/META-INF/sisu")
  197. (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
  198. (lambda _
  199. (display
  200. (string-append
  201. ;; Build this list by looking for files containing "@Named"
  202. "org.eclipse.aether.internal.impl.DefaultArtifactResolver\n"
  203. "org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector\n"
  204. "org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider\n"
  205. "org.eclipse.aether.internal.impl.DefaultDeployer\n"
  206. "org.eclipse.aether.internal.impl.DefaultFileProcessor\n"
  207. "org.eclipse.aether.internal.impl.DefaultInstaller\n"
  208. "org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider\n"
  209. "org.eclipse.aether.internal.impl.DefaultMetadataResolver\n"
  210. "org.eclipse.aether.internal.impl.DefaultOfflineController\n"
  211. "org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager\n"
  212. "org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider\n"
  213. "org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher\n"
  214. "org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider\n"
  215. "org.eclipse.aether.internal.impl.DefaultRepositorySystem\n"
  216. "org.eclipse.aether.internal.impl.DefaultSyncContextFactory\n"
  217. "org.eclipse.aether.internal.impl.DefaultTransporterProvider\n"
  218. "org.eclipse.aether.internal.impl.DefaultUpdateCheckManager\n"
  219. "org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer\n"
  220. "org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory\n"
  221. "org.eclipse.aether.internal.impl.LoggerFactoryProvider\n"
  222. "org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory\n"
  223. "org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory\n"
  224. "org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory"))))
  225. #t)))))
  226. (inputs
  227. `(("maven-resolver-api" ,maven-resolver-api)
  228. ("maven-resolver-spi" ,maven-resolver-spi)
  229. ("maven-resolver-util" ,maven-resolver-util)
  230. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  231. ("java-javax-inject" ,java-javax-inject)
  232. ("java-guice" ,java-guice)
  233. ("java-guava" ,java-guava)
  234. ("java-cglib" ,java-cglib)
  235. ("java-asm" ,java-asm)
  236. ("jajva-aopalliance" ,java-aopalliance)
  237. ("java-slf4j-api" ,java-slf4j-api)))
  238. (native-inputs
  239. `(("java-junit" ,java-junit)
  240. ("java-hamcrest-core" ,java-hamcrest-core)
  241. ("maven-resolver-test-util" ,maven-resolver-test-util)))))
  242. (define-public maven-resolver-transport-wagon
  243. (package
  244. (inherit maven-resolver-api)
  245. (name "maven-resolver-transport-wagon")
  246. (arguments
  247. `(#:jar-name "maven-resolver-transport-wagon.jar"
  248. #:source-dir "maven-resolver-transport-wagon/src/main/java"
  249. #:test-dir "maven-resolver-transport-wagon/src/test"
  250. #:jdk ,icedtea-8
  251. #:phases
  252. (modify-phases %standard-phases
  253. (add-before 'build 'generate-sisu
  254. (lambda _
  255. (mkdir-p "build/classes/META-INF/sisu")
  256. (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
  257. (lambda _
  258. (display "org.eclipse.aether.transport.wagon.WagonTransporterFactory\n")))
  259. #t))
  260. (add-before 'build 'generate-components.xml
  261. (lambda _
  262. (mkdir-p "build/classes/META-INF/plexus")
  263. (with-output-to-file "build/classes/META-INF/plexus/components.xml"
  264. (lambda _
  265. (display
  266. (string-append
  267. "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
  268. <component-set>
  269. <components>
  270. <component>
  271. <role>org.eclipse.aether.transport.wagon.WagonConfigurator</role>
  272. <role-hint>plexus</role-hint>
  273. <implementation>org.eclipse.aether.internal.transport.wagon.PlexusWagonConfigurator</implementation>
  274. <description />
  275. <isolated-realm>false</isolated-realm>
  276. <requirements>
  277. <requirement>
  278. <role>org.codehaus.plexus.PlexusContainer</role>
  279. <role-hint />
  280. <field-name>container</field-name>
  281. </requirement>
  282. </requirements>
  283. </component>
  284. <component>
  285. <role>org.eclipse.aether.transport.wagon.WagonProvider</role>
  286. <role-hint>plexus</role-hint>
  287. <implementation>org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider</implementation>
  288. <description />
  289. <isolated-realm>false</isolated-realm>
  290. <requirements>
  291. <requirement>
  292. <role>org.codehaus.plexus.PlexusContainer</role>
  293. <role-hint />
  294. <field-name>container</field-name>
  295. </requirement>
  296. </requirements>
  297. </component>
  298. </components>
  299. </component-set>\n"))))
  300. #t)))))
  301. (inputs
  302. `(("maven-resolver-api" ,maven-resolver-api)
  303. ("maven-resolver-spi" ,maven-resolver-spi)
  304. ("maven-resolver-util" ,maven-resolver-util)
  305. ("java-javax-inject" ,java-javax-inject)
  306. ("mavne-wagon-provider-api" ,maven-wagon-provider-api)
  307. ("java-plexus-component-annotation" ,java-plexus-component-annotations)
  308. ("java-plexus-classworld" ,java-plexus-classworlds)
  309. ("java-plexus-plexus-util" ,java-plexus-utils)
  310. ("java-slf4j-api" ,java-slf4j-api)
  311. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  312. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)))
  313. (native-inputs
  314. `(("java-junit" ,java-junit)
  315. ("java-hamcrest-core" ,java-hamcrest-core)
  316. ("maven-resolver-test-util" ,maven-resolver-test-util)
  317. ("java-guava" ,java-guava)
  318. ("java-cglib" ,java-cglib)
  319. ("java-asm" ,java-asm)
  320. ("java-aopalliance" ,java-aopalliance)
  321. ("java-guice" ,java-guice)))
  322. (synopsis "Transport implementation for Maven")
  323. (description "This package contains a transport implementation based on
  324. Maven Wagon, for use in Maven.")))
  325. (define-public maven-shared-utils
  326. (package
  327. (name "maven-shared-utils")
  328. (version "3.2.1")
  329. (source (origin
  330. (method url-fetch)
  331. (uri (string-append "https://archive.apache.org/dist/maven/shared/"
  332. "maven-shared-utils-" version "-source-release.zip"))
  333. (sha256
  334. (base32
  335. "1kzmj68wwdcznb36hm6kfz57wbavw7g1rp236pz10znkjljn6rf6"))))
  336. (build-system ant-build-system)
  337. (arguments
  338. `(#:jar-name "maven-shared-utils.jar"
  339. #:source-dir "src/main/java"
  340. #:jdk ,icedtea-8
  341. #:phases
  342. (modify-phases %standard-phases
  343. (add-before 'check 'remove-cyclic-dep
  344. (lambda _
  345. (delete-file
  346. "src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java")
  347. #t)))))
  348. (inputs
  349. `(("java-jansi" ,java-jansi)
  350. ("java-commons-io" ,java-commons-io)
  351. ("java-jsr305" ,java-jsr305)
  352. ("java-plexus-container-default" ,java-plexus-container-default)))
  353. (native-inputs
  354. `(("unzip" ,unzip)
  355. ("java-junit" ,java-junit)
  356. ("java-hamcrest-core" ,java-hamcrest-core)
  357. ("java-commons-lang3" ,java-commons-lang3)))
  358. (home-page "https://maven.apache.org/shared/maven-shared-utils/")
  359. (synopsis "Plexus-util replacement for maven")
  360. (description "This project aims to be a functional replacement for
  361. plexus-utils in Maven. It is not a 100% API compatible replacement but a
  362. replacement with improvements.")
  363. (license license:asl2.0)))
  364. (define-public maven-plugin-annotations
  365. (package
  366. (name "maven-plugin-annotations")
  367. (version "3.5")
  368. (source (origin
  369. (method url-fetch)
  370. (uri (string-append "https://archive.apache.org/dist/maven/"
  371. "plugin-tools/maven-plugin-tools-" version
  372. "-source-release.zip"))
  373. (sha256 (base32 "1ryqhs62j5pas93brhf5dsnvp99hxbvssf681yj5rk3r9h24hqm2"))))
  374. (build-system ant-build-system)
  375. (arguments
  376. `(#:jar-name "maven-plugin-annotations.jar"
  377. #:source-dir "maven-plugin-annotations/src/main/java"
  378. #:tests? #f))
  379. (inputs
  380. `(("maven-artifact" ,maven-artifact)))
  381. (native-inputs
  382. `(("unzip" ,unzip)))
  383. (home-page "https://maven.apache.org/plugin-tools/maven-plugin-annotations/")
  384. (synopsis "Java 5 annotations to use in Mojos")
  385. (description "This package contains Java 5 annotations for use in Mojos.")
  386. (license license:asl2.0)))
  387. (define-public maven-wagon-provider-api
  388. (package
  389. (name "maven-wagon-provider-api")
  390. (version "3.1.0")
  391. (source (origin
  392. (method url-fetch)
  393. (uri (string-append "https://archive.apache.org/dist/maven/wagon/"
  394. "wagon-" version "-source-release.zip"))
  395. (sha256 (base32 "0r07j6xdzdnrvqnv8ida7dx1m05pznh5qgmcfcfpyvg9nxbj3l1n"))))
  396. (build-system ant-build-system)
  397. (arguments
  398. `(#:jar-name "maven-wagon-provider-api.jar"
  399. #:source-dir "wagon-provider-api/src/main/java"
  400. #:test-dir "wagon-provider-api/src/test"))
  401. (inputs
  402. `(("java-plexus-utils" ,java-plexus-utils)))
  403. (native-inputs
  404. `(("unzip" ,unzip)
  405. ("java-junit" ,java-junit)
  406. ("java-easymock" ,java-easymock)))
  407. (home-page "https://maven.apache.org/wagon")
  408. (synopsis "Transport abstraction for Maven")
  409. (description "Maven Wagon is a transport abstraction that is used in Maven's
  410. artifact and repository handling code.")
  411. (license license:asl2.0)))
  412. (define-public maven-wagon-provider-test
  413. (package
  414. (inherit maven-wagon-provider-api)
  415. (name "maven-wagon-provider-test")
  416. (arguments
  417. `(#:jar-name "maven-wagon-provider-test.jar"
  418. #:source-dir "wagon-provider-test/src/main/java"
  419. #:tests? #f; no tests
  420. #:jdk ,icedtea-8))
  421. (inputs
  422. `(("java-plexus-utils" ,java-plexus-utils)
  423. ("java-plexus-container-default" ,java-plexus-container-default)
  424. ("java-eclipse-jetty-util-9.2" ,java-eclipse-jetty-util-9.2)
  425. ("java-eclipse-jetty-security-9.2" ,java-eclipse-jetty-security-9.2)
  426. ("java-eclipse-jetty-server-9.2" ,java-eclipse-jetty-server-9.2)
  427. ("java-eclipse-jetty-servlet-9.2" ,java-eclipse-jetty-servlet-9.2)
  428. ("java-slf4j-api" ,java-slf4j-api)
  429. ("java-javaee-servletapi" ,java-javaee-servletapi)
  430. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  431. (synopsis "Test classes from maven-wagon")
  432. (description "Maven Wagon is a transport abstraction that is used in Maven's
  433. artifact and repository handling code. This package contains common test
  434. classes used in multiple maven-wagon components.")))
  435. (define-public maven-wagon-file
  436. (package
  437. (inherit maven-wagon-provider-api)
  438. (name "maven-wagon-file")
  439. (arguments
  440. `(#:jar-name "maven-wagon-file.jar"
  441. #:source-dir "wagon-providers/wagon-file/src/main/java"
  442. #:test-dir "wagon-providers/wagon-file/src/test"
  443. #:jdk ,icedtea-8
  444. #:phases
  445. (modify-phases %standard-phases
  446. (add-before 'check 'fix-paths
  447. (lambda _
  448. ;; Tests assume they are run by maven, which copies test resources
  449. ;; to target. Our ant-build-system does the same, but with the
  450. ;; build directory.
  451. (substitute* "wagon-providers/wagon-file/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java"
  452. (("target") "build"))
  453. #t))
  454. (add-after 'build 'generate-metadata
  455. (lambda _
  456. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  457. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  458. "--source" "wagon-providers/wagon-file/src/main/java"
  459. "--output" "build/classes/META-INF/plexus/components.xml"
  460. "--classes" "build/classes"
  461. "--descriptors" "build/classes/META-INF")
  462. #t))
  463. (add-after 'generate-metadata 'rebuild
  464. (lambda _
  465. (invoke "ant" "jar")
  466. #t)))))
  467. (inputs
  468. `(("java-plexus-utils" ,java-plexus-utils)
  469. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  470. (native-inputs
  471. `(("maven-wagon-provider-test" ,maven-wagon-provider-test)
  472. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  473. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  474. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  475. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  476. ("java-plexus-classworlds" ,java-plexus-classworlds)
  477. ("java-guava" ,java-guava)
  478. ("java-guice" ,java-guice)
  479. ("java-javax-inject" ,java-javax-inject)
  480. ("java-cglib" ,java-cglib)
  481. ("java-slf4j-api" ,java-slf4j-api)
  482. ("java-plexus-utils" ,java-plexus-utils)
  483. ("java-plexus-cli" ,java-plexus-cli)
  484. ("maven-plugin-api" ,maven-plugin-api)
  485. ("maven-plugin-annotations" ,maven-plugin-annotations)
  486. ("maven-core" ,maven-core)
  487. ("maven-model" ,maven-model)
  488. ("java-commons-cli" ,java-commons-cli)
  489. ("java-qdox" ,java-qdox)
  490. ("java-jdom2" ,java-jdom2)
  491. ("java-asm" ,java-asm)
  492. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  493. ,@(package-native-inputs maven-wagon-provider-api)))
  494. (synopsis "Wagon provider that gets and puts artifacts using the file system")
  495. (description "Maven Wagon is a transport abstraction that is used in Maven's
  496. artifact and repository handling code. It uses providers, that are tools to
  497. manage artifacts and deployment. This package contains the file provider which
  498. gets and puts artifacts using the file system.")))
  499. (define-public maven-wagon-tck-http
  500. (package
  501. (inherit maven-wagon-provider-api)
  502. (name "maven-wagon-tck-http")
  503. (arguments
  504. `(#:jar-name "maven-wagon-tck-http.jar"
  505. #:source-dir "wagon-tcks/wagon-tck-http/src/main/java"
  506. #:tests? #f; no tests
  507. #:jdk ,icedtea-8))
  508. (inputs
  509. `(("java-plexus-util" ,java-plexus-utils)
  510. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  511. ("java-tomcat" ,java-tomcat)
  512. ("java-slf4j-api" ,java-slf4j-api)
  513. ("java-commons-codec" ,java-commons-codec)
  514. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  515. ("java-plexus-classworlds" ,java-plexus-classworlds)
  516. ("java-eclipse-jetty-util-9.2" ,java-eclipse-jetty-util-9.2)
  517. ("java-eclipse-jetty-webapp-9.2" ,java-eclipse-jetty-webapp-9.2)
  518. ("java-eclipse-jetty-security-9.2" ,java-eclipse-jetty-security-9.2)
  519. ("java-eclipse-jetty-server-9.2" ,java-eclipse-jetty-server-9.2)
  520. ("java-eclipse-jetty-servlet-9.2" ,java-eclipse-jetty-servlet-9.2)))
  521. (synopsis "Wagon HTTP Test Compatibility Kit")
  522. (description "Maven Wagon is a transport abstraction that is used in Maven's
  523. artifact and repository handling code. This package contains the HTTP
  524. Test Compatibility Kit.")))
  525. (define-public maven-wagon-http-shared
  526. (package
  527. (inherit maven-wagon-provider-api)
  528. (name "maven-wagon-http-shared")
  529. (arguments
  530. `(#:jar-name "maven-wagon-http-shared.jar"
  531. #:source-dir "wagon-providers/wagon-http-shared/src/main/java"
  532. #:test-dir "wagon-providers/wagon-http-shared/src/test"
  533. #:jdk ,icedtea-8
  534. #:phases
  535. (modify-phases %standard-phases
  536. (add-after 'build 'generate-metadata
  537. (lambda _
  538. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  539. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  540. "--source" "wagon-providers/wagon-http-shared/src/main/java"
  541. "--output" "build/classes/META-INF/plexus/components.xml"
  542. "--classes" "build/classes"
  543. "--descriptors" "build/classes/META-INF")
  544. #t))
  545. (add-after 'generate-metadata 'rebuild
  546. (lambda _
  547. (invoke "ant" "jar")
  548. #t)))))
  549. (inputs
  550. `(("java-plexus-utils" ,java-plexus-utils)
  551. ("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
  552. ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
  553. ("java-commons-io" ,java-commons-io)
  554. ("java-jsoup" ,java-jsoup)
  555. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  556. (native-inputs
  557. `(("maven-wagon-provider-test" ,maven-wagon-provider-test)
  558. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  559. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  560. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  561. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  562. ("java-plexus-classworlds" ,java-plexus-classworlds)
  563. ("java-guava" ,java-guava)
  564. ("java-guice" ,java-guice)
  565. ("java-javax-inject" ,java-javax-inject)
  566. ("java-cglib" ,java-cglib)
  567. ("java-slf4j-api" ,java-slf4j-api)
  568. ("java-plexus-utils" ,java-plexus-utils)
  569. ("java-plexus-cli" ,java-plexus-cli)
  570. ("maven-plugin-api" ,maven-plugin-api)
  571. ("maven-plugin-annotations" ,maven-plugin-annotations)
  572. ("maven-core" ,maven-core)
  573. ("maven-model" ,maven-model)
  574. ("java-commons-cli" ,java-commons-cli)
  575. ("java-qdox" ,java-qdox)
  576. ("java-jdom2" ,java-jdom2)
  577. ("java-asm" ,java-asm)
  578. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  579. ,@(package-native-inputs maven-wagon-provider-api)))
  580. (synopsis "Shared Library for wagon providers supporting HTTP.")
  581. (description "Maven Wagon is a transport abstraction that is used in Maven's
  582. artifact and repository handling code. It uses providers, that are tools to
  583. manage artifacts and deployment. This package contains a shared library for
  584. wagon providers supporting HTTP.")))
  585. (define-public maven-wagon-http
  586. (package
  587. (inherit maven-wagon-provider-api)
  588. (name "maven-wagon-http")
  589. (arguments
  590. `(#:jar-name "maven-wagon-http.jar"
  591. #:source-dir "wagon-providers/wagon-http/src/main/java"
  592. #:test-dir "wagon-providers/wagon-http/src/test"
  593. #:test-exclude (list
  594. "**/Abstract*.java"
  595. ;; FIXME: javax.net.ssl.SSLHandshakeException:
  596. ;; sun.security.validator.ValidatorException:
  597. ;; PKIX path building failed:
  598. ;; sun.security.provider.certpath.SunCertPathBuilderException:
  599. ;; unable to find valid certification path to requested target
  600. "**/HttpsWagonPreemptiveTest.java"
  601. "**/HttpsWagonTest.java"
  602. ;; Injection errors
  603. "**/TckTest.java")
  604. #:jdk ,icedtea-8
  605. #:phases
  606. (modify-phases %standard-phases
  607. (add-before 'build 'copy-resources
  608. (lambda _
  609. (install-file "wagon-providers/wagon-http/src/main/resources/META-INF/plexus/components.xml"
  610. "build/classes/META-INF/plexus")
  611. #t))
  612. (add-before 'check 'fix-resource-path
  613. (lambda _
  614. (substitute* '("wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java"
  615. "wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java")
  616. (("src/test") "wagon-providers/wagon-http/src/test"))
  617. #t)))))
  618. (inputs
  619. `(("java-plexus-utils" ,java-plexus-utils)
  620. ("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
  621. ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
  622. ("maven-wagon-http-shared" ,maven-wagon-http-shared)
  623. ("maven-wagon-tck-http" ,maven-wagon-tck-http)
  624. ("maven-wagon-provider-api" ,maven-wagon-provider-api)))
  625. (native-inputs
  626. `(("maven-wagon-provider-test" ,maven-wagon-provider-test)
  627. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  628. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  629. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  630. ("java-plexus-container-default" ,java-plexus-container-default)
  631. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  632. ("java-plexus-classworlds" ,java-plexus-classworlds)
  633. ("java-guava" ,java-guava)
  634. ("java-guice" ,java-guice)
  635. ("java-inject" ,java-javax-inject)
  636. ("java-cglib" ,java-cglib)
  637. ("java-slf4j-api" ,java-slf4j-api)
  638. ("java-plexus-utils" ,java-plexus-utils)
  639. ("java-plexus-cli" ,java-plexus-cli)
  640. ("maven-plugin-api" ,maven-plugin-api)
  641. ("maven-plugin-annotations" ,maven-plugin-annotations)
  642. ("maven-core" ,maven-core)
  643. ("maven-model" ,maven-model)
  644. ("java-commons-cli" ,java-commons-cli)
  645. ("java-qdox" ,java-qdox)
  646. ("java-jdom2" ,java-jdom2)
  647. ("java-asm" ,java-asm)
  648. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  649. ("java-tomcat" ,java-tomcat)
  650. ("java-eclipse-jetty-util-9.2" ,java-eclipse-jetty-util-9.2)
  651. ("java-eclipse-jetty-io-9.2" ,java-eclipse-jetty-io-9.2)
  652. ("java-eclipse-jetty-http-9.2" ,java-eclipse-jetty-http-9.2)
  653. ("java-eclipse-jetty-server-9.2" ,java-eclipse-jetty-server-9.2)
  654. ("java-eclipse-jetty-servlet-9.2" ,java-eclipse-jetty-servlet-9.2)
  655. ("java-eclipse-jetty-security-9.2" ,java-eclipse-jetty-security-9.2)
  656. ("java-hamcrest-core" ,java-hamcrest-core)
  657. ("java-commons-logging-minimal" ,java-commons-logging-minimal)
  658. ("java-commons-codec" ,java-commons-codec)
  659. ("java-commons-io" ,java-commons-io)
  660. ("java-jsoup" ,java-jsoup)
  661. ("java-slf4j-simple" ,java-slf4j-simple)
  662. ,@(package-native-inputs maven-wagon-provider-api)))
  663. (synopsis "Wagon provider that gets and puts artifacts through HTTP(S)")
  664. (description "Maven Wagon is a transport abstraction that is used in Maven's
  665. artifact and repository handling code. It uses providers, that are tools to
  666. manage artifacts and deployment. This package contains a Wagon provider that
  667. gets and puts artifacts through HTTP(S) using Apache HttpClient-4.x.")))
  668. (define-public maven-artifact
  669. (package
  670. (name "maven-artifact")
  671. (version "3.6.0")
  672. (source (origin
  673. (method url-fetch)
  674. (uri (string-append "https://archive.apache.org/dist/maven/"
  675. "maven-3/" version "/source/"
  676. "apache-maven-" version "-src.tar.gz"))
  677. (sha256 (base32 "17jrqfqwn569jgnv8m4pqc27csssb0rf6mznpq61l5bnbd6hl75k"))
  678. (modules '((guix build utils)))
  679. (snippet
  680. '(begin
  681. (for-each delete-file (find-files "." "\\.jar$"))
  682. #t))
  683. (patches
  684. (search-patches "maven-generate-component-xml.patch"
  685. "maven-generate-javax-inject-named.patch"))))
  686. (build-system ant-build-system)
  687. (arguments
  688. `(#:jar-name "maven-artifact.jar"
  689. #:source-dir "maven-artifact/src/main/java"
  690. #:test-dir "maven-artifact/src/test"
  691. #:main-class "org.apache.maven.artifact.versioning.ComparableVersion"))
  692. (inputs
  693. `(("java-plexus-utils" ,java-plexus-utils)
  694. ("java-commons-lang3" ,java-commons-lang3)))
  695. (native-inputs
  696. `(("java-junit" ,java-junit)))
  697. (home-page "https://maven.apache.org/")
  698. (synopsis "Build system")
  699. (description "Apache Maven is a software project management and comprehension
  700. tool. This package contains the Maven Artifact classes, providing the
  701. @code{Artifact} interface, with its @code{DefaultArtifact} implementation. The
  702. jar file is executable and provides a little tool to display how Maven parses
  703. and compares versions:")
  704. (license license:asl2.0)))
  705. (define-public maven-model
  706. (package
  707. (inherit maven-artifact)
  708. (name "maven-model")
  709. (arguments
  710. `(#:jar-name "maven-model.jar"
  711. #:source-dir "maven-model/src/main/java"
  712. #:test-dir "maven-model/src/test"
  713. #:jdk ,icedtea-8
  714. #:phases
  715. (modify-phases %standard-phases
  716. (add-before 'build 'generate-models
  717. (lambda* (#:key inputs #:allow-other-keys)
  718. (define (modello-single-mode file version mode)
  719. (invoke "java" "org.codehaus.modello.ModelloCli"
  720. file mode "maven-model/src/main/java" version
  721. "false" "true"))
  722. (let ((file "maven-model/src/main/mdo/maven.mdo"))
  723. (modello-single-mode file "4.0.0" "java")
  724. (modello-single-mode file "4.0.0" "xpp3-reader")
  725. (modello-single-mode file "4.0.0" "xpp3-writer")
  726. (modello-single-mode file "4.0.0" "xpp3-extended-reader"))
  727. #t)))))
  728. (inputs
  729. `(("java-commons-lang3" ,java-commons-lang3)
  730. ("java-plexus-utils" ,java-plexus-utils)))
  731. (native-inputs
  732. `(("java-modello-core" ,java-modello-core)
  733. ;; for modello:
  734. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  735. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  736. ("java-guice" ,java-guice)
  737. ("java-cglib" ,java-cglib)
  738. ("java-asm" ,java-asm)
  739. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  740. ("java-javax-inject" ,java-javax-inject)
  741. ("java-plexus-classworlds" ,java-plexus-classworlds)
  742. ("java-guava" ,java-guava)
  743. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  744. ("java-sisu-build-api" ,java-sisu-build-api)
  745. ;; modello plugins:
  746. ("java-modello-plugins-java" ,java-modello-plugins-java)
  747. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  748. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  749. ;; for tests
  750. ("java-junit" ,java-junit)))
  751. (description "Apache Maven is a software project management and comprehension
  752. tool. This package contains the model for Maven @dfn{POM} (Project Object Model),
  753. so really just plain Java objects.")))
  754. (define-public maven-builder-support
  755. (package
  756. (inherit maven-artifact)
  757. (name "maven-builder-support")
  758. (arguments
  759. `(#:jar-name "maven-builder-support.jar"
  760. #:source-dir "maven-builder-support/src/main/java"
  761. #:jdk ,icedtea-8
  762. #:test-dir "maven-builder-support/src/test"
  763. #:phases
  764. (modify-phases %standard-phases
  765. (add-before 'check 'fix-paths
  766. (lambda _
  767. (with-directory-excursion "maven-builder-support/src/test/java"
  768. (substitute*
  769. '("org/apache/maven/building/FileSourceTest.java"
  770. "org/apache/maven/building/UrlSourceTest.java")
  771. (("target/test-classes") "maven-builder-support/src/test/resources")))
  772. #t)))))
  773. (inputs
  774. `(("java-plexus-utils" ,java-plexus-utils)
  775. ("java-commons-lang3" ,java-commons-lang3)))
  776. (native-inputs
  777. `(("java-junit" ,java-junit)
  778. ("java-hamcrest-core" ,java-hamcrest-core)))
  779. (description "Apache Maven is a software project management and comprehension
  780. tool. This package contains a support library for descriptor builders (model,
  781. setting, toolchains)")))
  782. (define-public maven-settings
  783. (package
  784. (inherit maven-artifact)
  785. (name "maven-settings")
  786. (arguments
  787. `(#:jar-name "maven-settings.jar"
  788. #:source-dir "maven-settings/src/main/java"
  789. #:jdk ,icedtea-8
  790. #:tests? #f; no tests
  791. #:phases
  792. (modify-phases %standard-phases
  793. (add-before 'build 'generate-models
  794. (lambda* (#:key inputs #:allow-other-keys)
  795. (define (modello-single-mode file version mode)
  796. (invoke "java" "org.codehaus.modello.ModelloCli"
  797. file mode "maven-settings/src/main/java" version
  798. "false" "true"))
  799. (let ((file "maven-settings/src/main/mdo/settings.mdo"))
  800. (modello-single-mode file "1.1.0" "java")
  801. (modello-single-mode file "1.1.0" "xpp3-reader")
  802. (modello-single-mode file "1.1.0" "xpp3-writer"))
  803. #t)))))
  804. (inputs '())
  805. (native-inputs
  806. `(("java-modello-core" ,java-modello-core)
  807. ;; for modello:
  808. ;("container" ,java-plexus-container-default)
  809. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  810. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  811. ("java-guice" ,java-guice)
  812. ("java-cglib" ,java-cglib)
  813. ("java-asm" ,java-asm)
  814. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  815. ("java-javax-inject" ,java-javax-inject)
  816. ("java-plexus-classworlds" ,java-plexus-classworlds)
  817. ("java-plexus-utils" ,java-plexus-utils)
  818. ("java-guava" ,java-guava)
  819. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  820. ("java-sisu-build-api" ,java-sisu-build-api)
  821. ;; modello plugins:
  822. ("java-modello-plugins-java" ,java-modello-plugins-java)
  823. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  824. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)))
  825. (description "Apache Maven is a software project management and comprehension
  826. tool. This package contains strictly the model for Maven settings, that is
  827. simply plain java objects.")))
  828. (define-public maven-settings-builder
  829. (package
  830. (inherit maven-artifact)
  831. (name "maven-settings-builder")
  832. (arguments
  833. `(#:jar-name "maven-settings-builder.jar"
  834. #:source-dir "maven-settings-builder/src/main/java"
  835. #:jdk ,icedtea-8
  836. #:test-dir "maven-settings-builder/src/test"
  837. #:phases
  838. (modify-phases %standard-phases
  839. (add-before 'build 'generate-components.xml
  840. (lambda _
  841. (mkdir-p "build/classes/META-INF/plexus")
  842. (chmod "components.sh" #o755)
  843. (invoke "./components.sh" "maven-settings-builder/src/main/java"
  844. "build/classes/META-INF/plexus/components.xml")
  845. #t)))))
  846. (inputs
  847. `(("java-plexus-utils" ,java-plexus-utils)
  848. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  849. ("java-plexus-interpolation" ,java-plexus-interpolation)
  850. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  851. ("maven-builder-support" ,maven-builder-support)
  852. ("maven-settings" ,maven-settings)
  853. ("java-commons-lang3" ,java-commons-lang3)))
  854. (native-inputs
  855. `(("java-junit" ,java-junit)))
  856. (description "Apache Maven is a software project management and comprehension
  857. tool. This package contains the effective model builder, with profile activation,
  858. inheritance, interpolation, @dots{}")))
  859. (define-public maven-model-builder
  860. (package
  861. (inherit maven-artifact)
  862. (name "maven-model-builder")
  863. (arguments
  864. `(#:jar-name "maven-model-builder.jar"
  865. #:source-dir "maven-model-builder/src/main/java"
  866. #:jdk ,icedtea-8
  867. #:test-dir "maven-model-builder/src/test"
  868. #:phases
  869. (modify-phases %standard-phases
  870. (add-before 'build 'copy-resources
  871. (lambda _
  872. (copy-recursively "maven-model-builder/src/main/resources"
  873. "build/classes")
  874. #t))
  875. (add-before 'build 'generate-components.xml
  876. (lambda _
  877. (mkdir-p "build/classes/META-INF/plexus")
  878. (chmod "components.sh" #o755)
  879. (invoke "./components.sh" "maven-model-builder/src/main/java"
  880. "build/classes/META-INF/plexus/components.xml")
  881. #t))
  882. (add-before 'check 'fix-paths
  883. (lambda _
  884. (substitute* (find-files "maven-model-builder/src/test/java" ".*.java")
  885. (("src/test") "maven-model-builder/src/test"))
  886. #t)))))
  887. (inputs
  888. `(("model" ,maven-model)
  889. ("artifact" ,maven-artifact)
  890. ("support" ,maven-builder-support)
  891. ("annotations" ,java-plexus-component-annotations)
  892. ("utils" ,java-plexus-utils)
  893. ("interpolation" ,java-plexus-interpolation)
  894. ("lang3" ,java-commons-lang3)
  895. ("guava" ,java-guava)))
  896. (native-inputs
  897. `(("java-junit" ,java-junit)
  898. ("java-hamcrest-core" ,java-hamcrest-core)
  899. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  900. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  901. ("guice" ,java-guice)
  902. ("java-cglib" ,java-cglib)
  903. ("java-asm" ,java-asm)
  904. ("sisu-inject" ,java-eclipse-sisu-inject)
  905. ("javax-inject" ,java-javax-inject)
  906. ("java-xmlunit" ,java-xmlunit)
  907. ("java-xmlunit-matchers" ,java-xmlunit-matchers)
  908. ("xbean" ,java-geronimo-xbean-reflect)
  909. ("classworlds" ,java-plexus-classworlds)))
  910. (description "Apache Maven is a software project management and comprehension
  911. tool. This package contains the effective model builder, with profile activation,
  912. inheritance, interpolation, @dots{}")))
  913. (define-public maven-repository-metadata
  914. (package
  915. (inherit maven-artifact)
  916. (name "maven-repository-metadata")
  917. (arguments
  918. `(#:jar-name "maven-repository-metadata.jar"
  919. #:source-dir "maven-repository-metadata/src/main/java"
  920. #:jdk ,icedtea-8
  921. #:tests? #f; no tests
  922. #:phases
  923. (modify-phases %standard-phases
  924. (add-before 'build 'generate-models
  925. (lambda* (#:key inputs #:allow-other-keys)
  926. (define (modello-single-mode file version mode)
  927. (invoke "java" "org.codehaus.modello.ModelloCli"
  928. file mode "maven-repository-metadata/src/main/java" version
  929. "false" "true"))
  930. (let ((file "maven-repository-metadata/src/main/mdo/metadata.mdo"))
  931. (modello-single-mode file "1.1.0" "java")
  932. (modello-single-mode file "1.1.0" "xpp3-reader")
  933. (modello-single-mode file "1.1.0" "xpp3-writer"))
  934. #t)))))
  935. (inputs '())
  936. (native-inputs
  937. `(("modello" ,java-modello-core)
  938. ;; for modello:
  939. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  940. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  941. ("java-guice" ,java-guice)
  942. ("java-cglib" ,java-cglib)
  943. ("java-asm" ,java-asm)
  944. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  945. ("java-javax-inject" ,java-javax-inject)
  946. ("java-plexus-utils" ,java-plexus-utils)
  947. ("java-plexus-classworlds" ,java-plexus-classworlds)
  948. ("java-guava" ,java-guava)
  949. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  950. ("java-sisu-build-api" ,java-sisu-build-api)
  951. ;; modello plugins:
  952. ("java-modello-plugins-java" ,java-modello-plugins-java)
  953. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  954. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)))
  955. (description "Apache Maven is a software project management and comprehension
  956. tool. This package contains strictly the model for Maven Repository Metadata,
  957. so really just plain objects.")))
  958. (define-public maven-resolver-provider
  959. (package
  960. (inherit maven-artifact)
  961. (name "maven-resolver-provider")
  962. (arguments
  963. `(#:jar-name "maven-resolver-provider.jar"
  964. #:source-dir "maven-resolver-provider/src/main/java"
  965. #:test-dir "maven-resolver-provider/src/test"
  966. #:jdk ,icedtea-8
  967. #:tests? #f; dependency loop on maven-core (@Component RepositorySystem)
  968. #:phases
  969. (modify-phases %standard-phases
  970. (add-before 'build 'generate-sisu-named
  971. (lambda _
  972. (mkdir-p "build/classes/META-INF/sisu")
  973. (chmod "./sisu.sh" #o755)
  974. (invoke "./sisu.sh" "maven-resolver-provider/src/main/java"
  975. "build/classes/META-INF/sisu/javax.inject.Named")
  976. #t)))))
  977. (inputs
  978. `(("maven-resolver-spi" ,maven-resolver-spi)
  979. ("maven-resolver-api" ,maven-resolver-api)
  980. ("maven-resolver-impl" ,maven-resolver-impl)
  981. ("maven-resolver-util" ,maven-resolver-util)
  982. ("maven-model" ,maven-model)
  983. ("maven-model-builder" ,maven-model-builder)
  984. ("maven-builder-support" ,maven-builder-support)
  985. ("maven-repository-metadata" ,maven-repository-metadata)
  986. ("java-plexus-utils" ,java-plexus-utils)
  987. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  988. ("java-commons-lang3" ,java-commons-lang3)
  989. ("java-guice" ,java-guice)
  990. ("java-guava" ,java-guava)
  991. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  992. ("java-javax-inject" ,java-javax-inject)))))
  993. (define-public maven-plugin-api
  994. (package
  995. (inherit maven-artifact)
  996. (name "maven-plugin-api")
  997. (arguments
  998. `(#:jar-name "maven-plugin-api.jar"
  999. #:source-dir "maven-plugin-api/src/main/java"
  1000. #:jdk ,icedtea-8
  1001. #:test-dir "maven-plugin-api/src/test"
  1002. #:phases
  1003. (modify-phases %standard-phases
  1004. (add-before 'build 'generate-models
  1005. (lambda* (#:key inputs #:allow-other-keys)
  1006. (define (modello-single-mode file version mode)
  1007. (invoke "java" "org.codehaus.modello.ModelloCli"
  1008. file mode "maven-plugin-api/src/main/java" version
  1009. "false" "true"))
  1010. (let ((file "maven-plugin-api/src/main/mdo/lifecycle.mdo"))
  1011. (modello-single-mode file "1.0.0" "java")
  1012. (modello-single-mode file "1.0.0" "xpp3-reader")
  1013. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1014. #t)))))
  1015. (inputs
  1016. `(("maven-artifact" ,maven-artifact)
  1017. ("maven-model" ,maven-model)
  1018. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1019. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1020. ("guice" ,java-guice)
  1021. ("java-cglib" ,java-cglib)
  1022. ("java-asm" ,java-asm)
  1023. ("sisu-inject" ,java-eclipse-sisu-inject)
  1024. ("javax-inject" ,java-javax-inject)
  1025. ("utils" ,java-plexus-utils)))
  1026. (native-inputs
  1027. `(("modello" ,java-modello-core)
  1028. ;; for modello:
  1029. ("classworlds" ,java-plexus-classworlds)
  1030. ("guava" ,java-guava)
  1031. ("xbean" ,java-geronimo-xbean-reflect)
  1032. ("build-api" ,java-sisu-build-api)
  1033. ;; modello plugins:
  1034. ("java" ,java-modello-plugins-java)
  1035. ("xml" ,java-modello-plugins-xml)
  1036. ("xpp3" ,java-modello-plugins-xpp3)
  1037. ;; for tests
  1038. ("java-junit" ,java-junit)))
  1039. (description "Apache Maven is a software project management and comprehension
  1040. tool. This package contains strictly the API for plugins -- composed of goals
  1041. implemented by Mojos -- development.
  1042. A plugin is described in a @file{META-INF/maven/plugin.xml} plugin descriptor,
  1043. generally generated from plugin sources using maven-plugin-plugin.")))
  1044. (define maven-core-bootstrap
  1045. (package
  1046. (inherit maven-artifact)
  1047. (name "maven-core")
  1048. (arguments
  1049. `(#:jar-name "maven-core.jar"
  1050. #:source-dir "src/main/java"
  1051. #:jdk ,icedtea-8
  1052. ;; Tests need maven-compat, which requires maven-core
  1053. #:tests? #f
  1054. #:phases
  1055. (modify-phases %standard-phases
  1056. (add-before 'configure 'chdir
  1057. (lambda _
  1058. ;; Required for generating components.xml in maven-core
  1059. (chdir "maven-core")
  1060. #t))
  1061. (add-before 'build 'copy-resources
  1062. (lambda _
  1063. (mkdir-p "build/classes/")
  1064. (copy-recursively "src/main/resources" "build/classes")
  1065. #t))
  1066. (add-after 'copy-resources 'fill-properties
  1067. (lambda _
  1068. ;; This file controls the output of some mvn subcommands, such as
  1069. ;; mvn -version.
  1070. (substitute* "build/classes/org/apache/maven/messages/build.properties"
  1071. (("\\$\\{buildNumber\\}") "guix_build")
  1072. (("\\$\\{timestamp\\}") "0")
  1073. (("\\$\\{project.version\\}") ,(package-version maven-artifact))
  1074. (("\\$\\{distributionId\\}") "apache-maven")
  1075. (("\\$\\{distributionShortName\\}") "Maven")
  1076. (("\\$\\{distributionName\\}") "Apache Maven"))
  1077. #t))
  1078. (add-before 'build 'generate-sisu-named
  1079. (lambda _
  1080. (mkdir-p "build/classes/META-INF/sisu")
  1081. (chmod "../sisu.sh" #o755)
  1082. (invoke "../sisu.sh" "src/main/java"
  1083. "build/classes/META-INF/sisu/javax.inject.Named")
  1084. #t))
  1085. (add-before 'build 'generate-models
  1086. (lambda* (#:key inputs #:allow-other-keys)
  1087. (define (modello-single-mode file version mode)
  1088. (invoke "java" "org.codehaus.modello.ModelloCli"
  1089. file mode "src/main/java" version
  1090. "false" "true"))
  1091. (let ((file "src/main/mdo/toolchains.mdo"))
  1092. (modello-single-mode file "1.1.0" "java")
  1093. (modello-single-mode file "1.1.0" "xpp3-reader")
  1094. (modello-single-mode file "1.1.0" "xpp3-writer"))
  1095. #t)))))
  1096. (inputs
  1097. `(("maven-artifact" ,maven-artifact)
  1098. ("maven-resolver-provider" ,maven-resolver-provider)
  1099. ("maven-builder-support" ,maven-builder-support)
  1100. ("maven-model" ,maven-model)
  1101. ("maven-model-builder" ,maven-model-builder)
  1102. ("maven-settings" ,maven-settings)
  1103. ("maven-settings-builder" ,maven-settings-builder)
  1104. ("maven-plugin-api" ,maven-plugin-api)
  1105. ("maven-repository-metadata" ,maven-repository-metadata)
  1106. ("maven-shared-utils" ,maven-shared-utils)
  1107. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1108. ("java-plexus-utils" ,java-plexus-utils)
  1109. ("java-commons-lang3" ,java-commons-lang3)
  1110. ("java-guava" ,java-guava)
  1111. ("java-guice" ,java-guice)
  1112. ("maven-resolver-api" ,maven-resolver-api)
  1113. ("maven-resolver-spi" ,maven-resolver-spi)
  1114. ("maven-resolver-util" ,maven-resolver-util)
  1115. ("maven-resolver-impl" ,maven-resolver-impl)
  1116. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1117. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1118. ("java-javax-inject" ,java-javax-inject)
  1119. ("java-plexus-classworld" ,java-plexus-classworlds)))
  1120. (native-inputs
  1121. `(("java-modello-core" ,java-modello-core)
  1122. ("java-cglib" ,java-cglib)
  1123. ("java-asm" ,java-asm)
  1124. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1125. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1126. ("java-sisu-build-api" ,java-sisu-build-api)
  1127. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1128. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1129. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1130. ;; tests
  1131. ("java-junit" ,java-junit)
  1132. ("java-mockito-1" ,java-mockito-1)
  1133. ("java-commons-jxpath" ,java-commons-jxpath)))
  1134. (description "Apache Maven is a software project management and comprehension
  1135. tool. This package contains the maven core classes managing the whole build
  1136. process.")))
  1137. (define-public maven-core
  1138. (package
  1139. (inherit maven-core-bootstrap)
  1140. (arguments
  1141. (substitute-keyword-arguments (package-arguments maven-core-bootstrap)
  1142. ((#:phases phases)
  1143. `(modify-phases ,phases
  1144. (add-before 'build 'modify-metainf
  1145. (lambda _
  1146. (substitute* "build.xml"
  1147. (("message=\"\"") "message=\"Implementation-Version: 3.5.4\n\""))
  1148. #t))
  1149. (add-before 'build 'add-maven-files
  1150. (lambda _
  1151. (mkdir-p "build/classes/META-INF/maven/org.apache.maven/maven-core")
  1152. (copy-file "pom.xml"
  1153. "build/classes/META-INF/maven/org.apache.maven/maven-core/pom.xml")
  1154. (with-output-to-file "build/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties"
  1155. (lambda _
  1156. (format #t "version=~a~%
  1157. groupId=org.apache.maven~%
  1158. artifactId=maven-core" ,(package-version maven-core-bootstrap))))
  1159. #t))
  1160. (add-after 'build 'generate-metadata
  1161. (lambda _
  1162. (define (components file)
  1163. (let ((sxml (with-input-from-file file
  1164. (lambda _ (xml->sxml (current-input-port)
  1165. #:trim-whitespace? #t)))))
  1166. ;; Select the list of <component>s inside the <component-set>
  1167. ;; and <components>.
  1168. ((@ (ice-9 match) match) sxml
  1169. (('*TOP*
  1170. ('*PI* foo ...)
  1171. ('component-set
  1172. ('components x ...))) x))))
  1173. (use-modules (sxml simple))
  1174. (delete-file "build/classes/META-INF/plexus/components.xml")
  1175. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  1176. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  1177. "--source" "build/classes/META-INF/plexus"
  1178. "--output" "build/classes/META-INF/plexus/components.t.xml"
  1179. "--classes" "build/classes"
  1180. "--descriptors" "build/classes")
  1181. ;; Now we merge all other components from hand-written xml
  1182. (let ((generated-xml (components "build/classes/META-INF/plexus/components.t.xml"))
  1183. (components-xml (components "src/main/resources/META-INF/plexus/components.xml"))
  1184. (default-bindings-xml (components "src/main/resources/META-INF/plexus/default-bindings.xml"))
  1185. (artifact-handlers-xml (components "src/main/resources/META-INF/plexus/artifact-handlers.xml")))
  1186. (with-output-to-file "build/classes/META-INF/plexus/components.xml"
  1187. (lambda _
  1188. (display "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
  1189. (sxml->xml
  1190. `(component-set
  1191. (components
  1192. ,@(append generated-xml components-xml
  1193. default-bindings-xml
  1194. artifact-handlers-xml)))))))
  1195. #t))
  1196. (add-after 'generate-metadata 'rebuild
  1197. (lambda _
  1198. (invoke "ant" "jar")
  1199. #t))))))
  1200. (native-inputs
  1201. `(("java-plexus-component-metadata" ,java-plexus-component-metadata)
  1202. ("java-commons-cli" ,java-commons-cli)
  1203. ("java-plexus-cli" ,java-plexus-cli)
  1204. ("java-jdom2" ,java-jdom2)
  1205. ("java-qdox" ,java-qdox)
  1206. ("maven-core-boot" ,maven-core-bootstrap)
  1207. ,@(package-native-inputs maven-core-bootstrap)))))
  1208. (define-public maven-embedder
  1209. (package
  1210. (inherit maven-artifact)
  1211. (name "maven-embedder")
  1212. (arguments
  1213. `(#:jar-name "maven-embedder.jar"
  1214. #:source-dir "maven-embedder/src/main/java"
  1215. #:test-dir "maven-embedder/src/test"
  1216. #:test-exclude (list "**/MavenCliTest.java")
  1217. #:jdk ,icedtea-8
  1218. #:phases
  1219. (modify-phases %standard-phases
  1220. (add-before 'build 'generate-sisu-named
  1221. (lambda _
  1222. (mkdir-p "build/classes/META-INF/sisu")
  1223. (chmod "sisu.sh" #o755)
  1224. (invoke "./sisu.sh" "maven-embedder/src/main/java"
  1225. "build/classes/META-INF/sisu/javax.inject.Named")
  1226. #t))
  1227. (add-before 'build 'generate-models
  1228. (lambda* (#:key inputs #:allow-other-keys)
  1229. (define (modello-single-mode file version mode)
  1230. (invoke "java" "org.codehaus.modello.ModelloCli"
  1231. file mode "maven-embedder/src/main/java" version
  1232. "false" "true"))
  1233. (let ((file "maven-embedder/src/main/mdo/core-extensions.mdo"))
  1234. (modello-single-mode file "1.0.0" "java")
  1235. (modello-single-mode file "1.0.0" "xpp3-reader")
  1236. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1237. #t))
  1238. (add-before 'check 'fix-test-paths
  1239. (lambda _
  1240. (substitute* "maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java"
  1241. (("target/test-classes") "build/test-classes"))
  1242. #t))
  1243. (add-before 'check 'fix-test-compilation
  1244. (lambda _
  1245. ;; Tests are in the java/ subdir. Other subdirectories contain
  1246. ;; additional test plugins, with duplicate classes, so we can't
  1247. ;; compile them. Also, they are meant to be built with maven, to
  1248. ;; test its build process.
  1249. (substitute* "build.xml"
  1250. (("srcdir=\"maven-embedder/src/test\"")
  1251. "srcdir=\"maven-embedder/src/test/java\""))
  1252. #t)))))
  1253. (inputs
  1254. `(("maven-core" ,maven-core)
  1255. ("maven-artifact" ,maven-artifact)
  1256. ("maven-plugin-api" ,maven-plugin-api)
  1257. ("maven-builder-support" ,maven-builder-support)
  1258. ("maven-model" ,maven-model)
  1259. ("maven-model-builder" ,maven-model-builder)
  1260. ("maven-settings" ,maven-settings)
  1261. ("maven-settings-builder" ,maven-settings-builder)
  1262. ("maven-shared-utils" ,maven-shared-utils)
  1263. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1264. ("java-plexus-util" ,java-plexus-utils)
  1265. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1266. ("java-plexus-cipher" ,java-plexus-cipher)
  1267. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1268. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1269. ("maven-resolevr-util" ,maven-resolver-util)
  1270. ("maven-resolevr-api" ,maven-resolver-api)
  1271. ("java-logback-core" ,java-logback-core)
  1272. ("java-logback-classic" ,java-logback-classic)
  1273. ("java-commons-cli" ,java-commons-cli)
  1274. ("java-commons-io" ,java-commons-io)
  1275. ("java-commons-lang3" ,java-commons-lang3)
  1276. ("java-guava" ,java-guava)
  1277. ("java-guice" ,java-guice)
  1278. ("java-javax-inject" ,java-javax-inject)
  1279. ("java-slf4j-api" ,java-slf4j-api)
  1280. ("java-slf4j-simple" ,java-slf4j-simple)))
  1281. (native-inputs
  1282. `(("java-modello-core" ,java-modello-core)
  1283. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1284. ("java-sisu-build-api" ,java-sisu-build-api)
  1285. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1286. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1287. ("java-cglib" ,java-cglib)
  1288. ("java-asm" ,java-asm)
  1289. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1290. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1291. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1292. ;; tests
  1293. ("java-junit" ,java-junit)
  1294. ("java-objenesis" ,java-objenesis)
  1295. ("java-mockito-1" ,java-mockito-1)
  1296. ("java-hamcrest-core" ,java-hamcrest-core)))
  1297. (description "Apache Maven is a software project management and comprehension
  1298. tool. This package contains a Maven embeddable component, with CLI and
  1299. logging support.")))
  1300. (define-public maven-compat
  1301. (package
  1302. (inherit maven-artifact)
  1303. (name "maven-compat")
  1304. (arguments
  1305. `(#:jar-name "maven-compat.jar"
  1306. #:source-dir "src/main/java"
  1307. #:jdk ,icedtea-8
  1308. #:test-dir "src/test"
  1309. #:phases
  1310. (modify-phases %standard-phases
  1311. ;; Tests assume we're in this directory
  1312. (add-before 'configure 'chdir
  1313. (lambda _
  1314. (chdir "maven-compat")
  1315. #t))
  1316. (add-before 'build 'recreate-removed-jar
  1317. (lambda _
  1318. (with-output-to-file "src/test/repository-system/maven-core-2.1.0.jar"
  1319. (const #t))
  1320. (with-directory-excursion "src/test/resources"
  1321. (with-output-to-file "artifact-install/artifact-1.0.jar"
  1322. (lambda _
  1323. (format #t "dummy~%")))
  1324. (for-each
  1325. (lambda (file)
  1326. (with-output-to-file file
  1327. (lambda _
  1328. (format #t "foo~%"))))
  1329. '("local-repo/maven-test/jars/maven-test-a-1.0.jar"
  1330. "local-repo/maven-test/jars/maven-test-c-1.0.jar"
  1331. "local-repo/maven-test/jars/maven-test-d-1.0.jar"
  1332. "inheritance-repo/t04/maven-test/jars/t04-a-1.0.jar"
  1333. "inheritance-repo/t04/maven-test/jars/t04-b-1.0.jar"
  1334. "inheritance-repo/t04/maven-test/jars/t04-b-2.0.jar"
  1335. "inheritance-repo/t04/maven-test/jars/t04-c-1.0.jar"
  1336. "inheritance-repo/t04/maven-test/jars/t04-c-2.0.jar"
  1337. "inheritance-repo/t05/maven-test/jars/t05-a-1.0.jar"
  1338. "inheritance-repo/t05/maven-test/jars/t05-a-2.0.jar"
  1339. "inheritance-repo/t05/maven-test/jars/t05-b-1.0.jar"
  1340. "inheritance-repo/t05/maven-test/jars/t05-b-1.1.jar"
  1341. "inheritance-repo/t05/maven-test/jars/t05-b-2.0.jar"
  1342. "inheritance-repo/t05/maven-test/jars/t05-c-1.0.jar"
  1343. "inheritance-repo/t05/maven-test/jars/t05-d-1.0.jar"
  1344. "inheritance-repo/t05/maven-test/jars/t05-d-1.1.jar"
  1345. "inheritance-repo/t05/maven-test/jars/t05-d-1.2.jar"
  1346. "inheritance-repo/t06/maven-test/jars/t06-a-1.0.jar"
  1347. "inheritance-repo/t06/maven-test/jars/t06-b-1.0.jar"
  1348. "inheritance-repo/t06/maven-test/jars/t06-b-1.1.jar"
  1349. "inheritance-repo/t06/maven-test/jars/t06-c-1.0.jar"
  1350. "inheritance-repo/t06/maven-test/jars/t06-d-1.0.jar"
  1351. "inheritance-repo/t06/maven-test/jars/t06-d-1.1.jar"
  1352. "inheritance-repo/t06/maven-test/jars/t06-d-1.2.jar"
  1353. "inheritance-repo/t07/maven-test/jars/t07-a-1.0.jar"
  1354. "inheritance-repo/t07/maven-test/jars/t07-b-1.0.jar"
  1355. "inheritance-repo/t07/maven-test/jars/t07-b-1.1.jar"
  1356. "inheritance-repo/t07/maven-test/jars/t07-c-1.0.jar"
  1357. "inheritance-repo/t07/maven-test/jars/t07-d-1.0.jar"
  1358. "inheritance-repo/t07/maven-test/jars/t07-d-1.1.jar"
  1359. "inheritance-repo/t07/maven-test/jars/t07-d-1.2.jar"
  1360. "inheritance-repo/t08/maven-test/jars/t08-a-1.0.jar"
  1361. "inheritance-repo/t08/maven-test/jars/t08-b-1.0.jar"
  1362. "inheritance-repo/t08/maven-test/jars/t08-b-1.1.jar"
  1363. "inheritance-repo/t08/maven-test/jars/t08-c-1.0.jar"
  1364. "inheritance-repo/t08/maven-test/jars/t08-d-1.0.jar"
  1365. "inheritance-repo/t08/maven-test/jars/t08-d-1.1.jar"
  1366. "inheritance-repo/t08/maven-test/jars/t08-d-1.2.jar"
  1367. "inheritance-repo/t09/maven-test/jars/t09-a-1.0.jar"
  1368. "inheritance-repo/t09/maven-test/jars/t09-b-1.0.jar"
  1369. "inheritance-repo/t09/maven-test/jars/t09-c-1.0.jar"
  1370. "inheritance-repo/t09/maven-test/jars/t09-d-1.0.jar"
  1371. "inheritance-repo/t10/maven-test/jars/t10-a-1.0.jar"
  1372. "inheritance-repo/t10/maven-test/jars/t10-b-1.0.jar"
  1373. "inheritance-repo/t10/maven-test/jars/t10-c-1.0.jar"))
  1374. (with-directory-excursion "local-repo/snapshot-test/jars"
  1375. (for-each
  1376. (lambda (file)
  1377. (with-output-to-file file
  1378. (lambda _
  1379. ;; No end-of-line
  1380. (format #t "local"))))
  1381. '("maven-snapshot-e-1.0-SNAPSHOT.jar"
  1382. "maven-snapshot-b-1.0-SNAPSHOT.jar"
  1383. "maven-snapshot-a-1.0-SNAPSHOT.jar"))))
  1384. (for-each
  1385. (lambda (letter)
  1386. (with-directory-excursion
  1387. (string-append "src/test/remote-repo/org/apache/maven/its/"
  1388. letter "/0.1")
  1389. (let ((dir (string-append "META-INF/maven/org.apache.maven.its/"
  1390. letter)))
  1391. (mkdir-p dir)
  1392. (copy-file (string-append letter "-0.1.pom")
  1393. (string-append dir "/pom.xml"))
  1394. (with-output-to-file (string-append dir "/pom.properties")
  1395. (lambda _
  1396. (format #t "version=0.1~%")
  1397. (format #t "groupId=org.apache.maven.its")
  1398. (format #t (string-append "artifactId=" letter))))
  1399. (with-output-to-file "META-INF/MANIFEST.MF"
  1400. (lambda _
  1401. (format #t "Manifest-Version: 1.0~%"))))
  1402. (invoke "jar" "cmf" "META-INF/MANIFEST.MF"
  1403. (string-append letter "-0.1.jar") "META-INF")))
  1404. '("a" "b"))
  1405. #t))
  1406. (add-before 'build 'generate-models
  1407. (lambda* (#:key inputs #:allow-other-keys)
  1408. (define (modello-single-mode file version mode)
  1409. (invoke "java" "org.codehaus.modello.ModelloCli"
  1410. file mode "src/main/java" version
  1411. "false" "true"))
  1412. (let ((file "src/main/mdo/profiles.mdo"))
  1413. (modello-single-mode file "1.0.0" "java")
  1414. (modello-single-mode file "1.0.0" "xpp3-reader")
  1415. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1416. (let ((file "src/main/mdo/paramdoc.mdo"))
  1417. (modello-single-mode file "1.0.0" "java")
  1418. (modello-single-mode file "1.0.0" "xpp3-reader")
  1419. (modello-single-mode file "1.0.0" "xpp3-writer"))
  1420. #t))
  1421. (add-after 'build 'generate-metadata
  1422. (lambda _
  1423. (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
  1424. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  1425. "--source" "src/main/java"
  1426. "--output" "build/classes/META-INF/plexus/components.xml"
  1427. "--classes" "build/classes"
  1428. "--descriptors" "build/classes/META-INF")
  1429. #t))
  1430. (add-before 'check 'build-tests
  1431. (lambda _
  1432. (invoke "ant" "compile-tests")
  1433. #t))
  1434. (add-after 'build-tests 'generate-test-metadata
  1435. (lambda _
  1436. (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
  1437. ":build/classes"
  1438. ":build/test-classes")
  1439. "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
  1440. "--source" "src/test/java"
  1441. "--output" "build/test-classes/META-INF/plexus/components.xml"
  1442. "--classes" "build/test-classes"
  1443. "--descriptors" "build/test-classes/META-INF")
  1444. #t))
  1445. (add-after 'generate-metadata 'rebuild
  1446. (lambda _
  1447. (invoke "ant" "jar")
  1448. #t)))))
  1449. (inputs
  1450. `(("maven-artifact" ,maven-artifact)
  1451. ("maven-repository-metadata" ,maven-repository-metadata)
  1452. ("maven-builder-support" ,maven-builder-support)
  1453. ("maven-model" ,maven-model)
  1454. ("maven-model-builder" ,maven-model-builder)
  1455. ("maven-settings" ,maven-settings)
  1456. ("maven-settings-builder" ,maven-settings-builder)
  1457. ("maven-core" ,maven-core)
  1458. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  1459. ("maven-wagon-file" ,maven-wagon-file)
  1460. ("maven-resolver-api" ,maven-resolver-api)
  1461. ("maven-resolver-util" ,maven-resolver-util)
  1462. ("maven-resolver-spi" ,maven-resolver-spi)
  1463. ("java-plexus-interpolation" ,java-plexus-interpolation)))
  1464. (native-inputs
  1465. `(("java-modello-core" ,java-modello-core)
  1466. ("java-plexus-utils" ,java-plexus-utils)
  1467. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1468. ("java-plexus-classworlds" ,java-plexus-classworlds)
  1469. ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
  1470. ("java-sisu-build-api" ,java-sisu-build-api)
  1471. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1472. ("java-exclispe-sisu-inject" ,java-eclipse-sisu-inject)
  1473. ("java-javax-inject" ,java-javax-inject)
  1474. ("java-guice" ,java-guice)
  1475. ("java-guava" ,java-guava)
  1476. ("java-cglib" ,java-cglib)
  1477. ("java-asm" ,java-asm)
  1478. ("java-modello-plugins-java" ,java-modello-plugins-java)
  1479. ("java-modello-plugins-xml" ,java-modello-plugins-xml)
  1480. ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3)
  1481. ;; metadata
  1482. ("java-plexus-component-metadata" ,java-plexus-component-metadata)
  1483. ("java-commons-cli" ,java-commons-cli)
  1484. ("java-plexus-cli" ,java-plexus-cli)
  1485. ("java-jdom2" ,java-jdom2)
  1486. ("maven-plugin-api" ,maven-plugin-api)
  1487. ("java-qdox" ,java-qdox)
  1488. ;; tests
  1489. ("java-plexus-cipher" ,java-plexus-cipher)
  1490. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1491. ("java-jsr250" ,java-jsr250)
  1492. ("java-cdi-api" ,java-cdi-api)
  1493. ("java-junit" ,java-junit)
  1494. ("maven-resolver-impl" ,maven-resolver-impl)
  1495. ("maven-resolver-connector-basic" ,maven-resolver-connector-basic)
  1496. ("maven-resolver-transport-wagon" ,maven-resolver-transport-wagon)
  1497. ("java-commons-lang3" ,java-commons-lang3)
  1498. ("java-aop" ,java-aopalliance)
  1499. ("maven-resolver-provider" ,maven-resolver-provider)
  1500. ("java-slf4j-api" ,java-slf4j-api)
  1501. ("java-slf4j-simple" ,java-slf4j-simple)
  1502. ,@(package-inputs java-slf4j-api)))
  1503. (description "Apache Maven is a software project management and comprehension
  1504. tool. This package contains Maven2 classes maintained as compatibility
  1505. layer for plugins that need to keep Maven2 compatibility.")))
  1506. (define-public maven
  1507. (package
  1508. (inherit maven-artifact)
  1509. (name "maven")
  1510. (arguments
  1511. `(#:phases
  1512. (modify-phases %standard-phases
  1513. (replace 'build
  1514. (lambda* (#:key inputs #:allow-other-keys)
  1515. ;; Recreate the configuration for the loader
  1516. (with-output-to-file "apache-maven/src/bin/m2.conf"
  1517. (lambda _
  1518. (format #t "main is org.apache.maven.cli.MavenCli from plexus.core~%")
  1519. (format #t "~%")
  1520. (format #t "set maven.conf default ${maven.home}/conf~%")
  1521. (format #t "~%")
  1522. (format #t "[plexus.core]~%")
  1523. (format #t "load ${maven.conf}/logging~%")
  1524. (format #t "optionally ${maven.home}/lib/ext/*.jar~%")
  1525. ;; Reference every jar so plexus-classworlds can find them.
  1526. (for-each
  1527. (lambda (dependency)
  1528. (format #t "load ~a/share/java/*.jar~%"
  1529. (assoc-ref inputs dependency)))
  1530. '("maven-artifact" "maven-embedder" "maven-core" "maven-compat"
  1531. "maven-builder-support" "maven-model" "maven-model-builder"
  1532. "maven-settings" "maven-settings-builder" "maven-plugin-api"
  1533. "maven-repository-metadata" "maven-shared-utils" "maven-resolver-api"
  1534. "maven-resolver-spi" "maven-resolver-util" "maven-resolver-impl"
  1535. "maven-resolver-connector-basic" "maven-resolver-provider"
  1536. "maven-resolver-transport-wagon" "maven-wagon-provider-api"
  1537. "maven-wagon-file" "maven-wagon-http" "java-commons-logging-minimal"
  1538. "java-httpcomponents-httpclient" "java-httpcomponents-httpcore"
  1539. "maven-wagon-http-shared" "maven-wagon-tck-http"
  1540. "java-eclipse-sisu-plexus" "java-guice" "java-aopalliance"
  1541. "java-cglib" "java-asm" "java-eclipse-sisu-inject"
  1542. "java-javax-inject" "java-plexus-component-annotations"
  1543. "java-plexus-utils" "java-plexus-interpolation"
  1544. "java-plexus-sec-dispatcher" "java-plexus-cipher" "java-guava"
  1545. "java-jansi" "java-jsr250" "java-cdi-api" "java-commons-cli"
  1546. "java-commons-io" "java-commons-lang3" "java-slf4j-api"
  1547. "java-slf4j-simple"))))
  1548. (substitute* "apache-maven/src/bin/mvn"
  1549. (("cygwin=false;")
  1550. (string-append
  1551. "CLASSPATH="
  1552. (car (find-files
  1553. (assoc-ref inputs "java-plexus-classworlds")
  1554. ".*.jar"))
  1555. "\ncygwin=false;"))
  1556. (("-classpath.*") "-classpath ${CLASSPATH} \\\n"))
  1557. #t))
  1558. (delete 'check)
  1559. (replace 'install
  1560. (lambda* (#:key outputs #:allow-other-keys)
  1561. (let ((bin (string-append (assoc-ref outputs "out") "/bin/"))
  1562. (conf (string-append (assoc-ref outputs "out") "/conf/")))
  1563. (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
  1564. (for-each (lambda (file)
  1565. (install-file (string-append "apache-maven/src/bin/" file)
  1566. bin)
  1567. (chmod (string-append bin file) #o755))
  1568. '("mvn" "mvnDebug" "mvnyjp"))
  1569. (install-file "apache-maven/src/bin/m2.conf" bin)
  1570. (copy-recursively "apache-maven/src/conf" conf))
  1571. #t)))))
  1572. (inputs
  1573. `(("java-plexus-classworlds" ,java-plexus-classworlds)
  1574. ("maven-artifact" ,maven-artifact)
  1575. ("maven-embedder" ,maven-embedder)
  1576. ("maven-core" ,maven-core)
  1577. ("maven-compat" ,maven-compat)
  1578. ("maven-builder-support" ,maven-builder-support)
  1579. ("maven-model" ,maven-model)
  1580. ("maven-model-builder" ,maven-model-builder)
  1581. ("maven-settings" ,maven-settings)
  1582. ("maven-settings-builder" ,maven-settings-builder)
  1583. ("maven-plugin-api" ,maven-plugin-api)
  1584. ("maven-repository-metadata" ,maven-repository-metadata)
  1585. ("maven-shared-utils" ,maven-shared-utils)
  1586. ("maven-resolver-api" ,maven-resolver-api)
  1587. ("maven-resolver-spi" ,maven-resolver-spi)
  1588. ("maven-resolver-util" ,maven-resolver-util)
  1589. ("maven-resolver-impl" ,maven-resolver-impl)
  1590. ("maven-resolver-connector-basic" ,maven-resolver-connector-basic)
  1591. ("maven-resolver-provider" ,maven-resolver-provider)
  1592. ("maven-resolver-transport-wagon" ,maven-resolver-transport-wagon)
  1593. ("maven-wagon-provider-api" ,maven-wagon-provider-api)
  1594. ("maven-wagon-file" ,maven-wagon-file)
  1595. ("maven-wagon-http" ,maven-wagon-http)
  1596. ("java-commons-logging-minimal" ,java-commons-logging-minimal)
  1597. ("java-httpcomponents-httpclient" ,java-httpcomponents-httpclient)
  1598. ("java-httpcomponents-httpcore" ,java-httpcomponents-httpcore)
  1599. ("maven-wagon-http-shared" ,maven-wagon-http-shared)
  1600. ("maven-wagon-tck-http" ,maven-wagon-tck-http)
  1601. ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus)
  1602. ("java-guice" ,java-guice)
  1603. ("java-aopalliance" ,java-aopalliance)
  1604. ("java-cglib" ,java-cglib)
  1605. ("java-asm" ,java-asm)
  1606. ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)
  1607. ("java-javax-inject" ,java-javax-inject)
  1608. ("java-plexus-component-annotations" ,java-plexus-component-annotations)
  1609. ("java-plexus-utils" ,java-plexus-utils)
  1610. ("java-plexus-interpolation" ,java-plexus-interpolation)
  1611. ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher)
  1612. ("java-plexus-cipher" ,java-plexus-cipher)
  1613. ("java-guava" ,java-guava)
  1614. ("java-jansi" ,java-jansi)
  1615. ("java-jsr250" ,java-jsr250)
  1616. ("java-cdi-api" ,java-cdi-api)
  1617. ("java-commons-cli" ,java-commons-cli)
  1618. ("java-commons-io" ,java-commons-io)
  1619. ("java-commons-lang3" ,java-commons-lang3)
  1620. ("java-slf4j-api" ,java-slf4j-api)
  1621. ;; TODO: replace with maven-slf4j-provider
  1622. ("java-slf4j-simple" ,java-slf4j-simple)))
  1623. (propagated-inputs
  1624. `(("coreutils" ,coreutils)
  1625. ("which" ,which)))
  1626. (description "Apache Maven is a software project management and comprehension
  1627. tool. Based on the concept of a project object model: builds, dependency
  1628. management, documentation creation, site publication, and distribution
  1629. publication are all controlled from the @file{pom.xml} declarative file. Maven
  1630. can be extended by plugins to utilise a number of other development tools for
  1631. reporting or the build process.")))