[PATCH] gnu: Add maven-release-api

OpenSubmitted by Artyom V. Poptsov.
Details
2 participants
  • Julien Lepiller
  • Artyom V. Poptsov
Owner
unassigned
Severity
normal
A
A
Artyom V. Poptsov wrote on 25 Jun 11:26 +0200
(address . guix-patches@gnu.org)
871qvd3xgd.fsf@gmail.com
Hello,

this patch adds Maven Release API under the name 'maven-release-api', as
well as the private 'maven-release-parent-pom' package.
From f071547eaf36804cfe0fc7ee0ef418e2db1abb7a Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 25 Jun 2022 12:16:29 +0300
Subject: [PATCH] gnu: Add maven-release-api

* gnu/packages/maven.scm (maven-release-api): New variable.
(maven-release-parent-pom): New variable.
---
gnu/packages/maven.scm | 58 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)

Toggle diff (68 lines)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index e5831ee614..7ff2d6d69e 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -3938,3 +3938,61 @@ method and a end of tag by @code{xxxx_()} method.")
     (description "@samp{Doxia} is a content generation framework that provides
 powerful techniques for generating static and dynamic content, supporting a
 variety of markup languages.")))
+
+(define-public maven-release-api
+  (package
+    (name "maven-release-api")
+    (version "3.0.0-M5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/apache/maven-release")
+                    (commit (string-append "maven-release-" version))))
+              (file-name (git-file-name "maven-release" version))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; XXX: Delete dummy JAR-files.
+                  (delete-file-recursively
+                   "maven-release-manager/src/test/remote-repository")
+                  #t))
+              (sha256
+               (base32
+                "13yxjl29jp4zkb8xvy0b045b5fpqz9nais1jsf4r9krczyxyj96k"))))
+    (build-system ant-build-system)
+    (propagated-inputs (list maven-release-parent-pom))
+    (inputs (list maven-repository-metadata
+                  maven-artifact
+                  maven-core
+                  maven-model
+                  java-eclipse-aether-util
+                  java-slf4j-api
+                  java-plexus-utils))
+    (arguments
+     `(#:jar-name "maven-release-api.jar"
+       #:source-dir "maven-release-api/src/main/java"
+       #:tests? #f ; no tests
+       #:phases (modify-phases %standard-phases
+                  (replace 'install
+                    (install-from-pom "maven-release-api/pom.xml")))))
+    (home-page "https://maven.apache.org/maven-release/")
+    (synopsis "APIs to implement to extend maven-release-plugin")
+    (description "APIs to implement to extend maven-release-plugin")
+    (license license:asl2.0)))
+
+(define maven-release-parent-pom
+  (package
+    (inherit maven-release-api)
+    (name "maven-release-parent-pom")
+    (arguments
+     `(#:tests? #f                      ; no tests
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (delete 'build)
+                  (replace 'install
+                    (install-pom-file "pom.xml")))))
+    (propagated-inputs
+     (list maven-parent-pom-34))
+    (synopsis "Apache Maven Release (Plugin)")
+    (description "This plugin is used to release a project with Maven, saving
+a lot of repetitive, manual work.")))
-- 
2.25.1
Thanks,

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmK21OIACgkQ6cWi2QiY
oC/OJAf9GVDPFBvj8jUcCSOhKJOdMeeiCJGWbLvstzKoM6qLFUy52h2c4YMQLL1e
buP5Ry5JWG83vytGD+iiC3CNjSDrB+uAzFp3mSqE4krm0q2VDudxvRp8sd3+H7mb
stZsB7rvrmjDHA7A6RIvwBUkzWvXmmxicYn9XbgYHv8tKiiaynPUMZ9eOoxqVOE8
DT7BORISTYQQpblzNyYhpVJwVipfxRrUiNHMZKXWjghgCKKd/gutxYEWfN3zc7HL
uSvPd7DvvkLe+o4hqSc6jM4azCdD4j9AmMBx1DR0cCz8CTyxOkMd7X42Z31qCMKJ
8XP5zSK1Edh0E6iO1I/OH+1l2cnl/A==
=f0o1
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 25 Jun 13:15 +0200
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 56212@debbugs.gnu.org)
20220625131502.691b1ee1@sybil.lepiller.eu
Thanks for the patch! A few remarks below.

Le Sat, 25 Jun 2022 12:26:58 +0300,
"Artyom V. Poptsov" <poptsov.artyom@gmail.com> a écrit :

Toggle quote (5 lines)
> From f071547eaf36804cfe0fc7ee0ef418e2db1abb7a Mon Sep 17 00:00:00 2001
> From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
> Date: Sat, 25 Jun 2022 12:16:29 +0300
> Subject: [PATCH] gnu: Add maven-release-api

Missing full stop in the subject line.

Toggle quote (37 lines)
>
> * gnu/packages/maven.scm (maven-release-api): New variable.
> (maven-release-parent-pom): New variable.
> ---
> gnu/packages/maven.scm | 58
> ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58
> insertions(+)
>
> diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
> index e5831ee614..7ff2d6d69e 100644
> --- a/gnu/packages/maven.scm
> +++ b/gnu/packages/maven.scm
> @@ -3938,3 +3938,61 @@ method and a end of tag by @code{xxxx_()}
> method.") (description "@samp{Doxia} is a content generation
> framework that provides powerful techniques for generating static and
> dynamic content, supporting a variety of markup languages.")))
> +
> +(define-public maven-release-api
> + (package
> + (name "maven-release-api")
> + (version "3.0.0-M5")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/apache/maven-release")
> + (commit (string-append "maven-release-"
> version))))
> + (file-name (git-file-name "maven-release" version))
> + (modules '((guix build utils)))
> + (snippet
> + '(begin
> + ;; XXX: Delete dummy JAR-files.
> + (delete-file-recursively
> +
> "maven-release-manager/src/test/remote-repository")
> + #t))

No need to end the snippet with #t.

Since we're going to build maven-release-manager at some point (I
suppose?), we'll need these files in order to run the tests. Could you
add something to the snippet to regenerate the files (if that's
possible from the snippet, otherwise we'll regenerate them in a phase
once we have a maven-release-manager package)?

Toggle quote (14 lines)
> + (sha256
> + (base32
> +
> "13yxjl29jp4zkb8xvy0b045b5fpqz9nais1jsf4r9krczyxyj96k"))))
> + (build-system ant-build-system)
> + (propagated-inputs (list maven-release-parent-pom))
> + (inputs (list maven-repository-metadata
> + maven-artifact
> + maven-core
> + maven-model
> + java-eclipse-aether-util
> + java-slf4j-api
> + java-plexus-utils))

I think most of these inputs should be propagated because the pom file
references these packages in its dependencies:

<dependencies>
...
</dependencies>

whatever's not a test dependency will be required at runtime by maven,
so we need to propagate.

Toggle quote (11 lines)
> + (arguments
> + `(#:jar-name "maven-release-api.jar"
> + #:source-dir "maven-release-api/src/main/java"
> + #:tests? #f ; no tests
> + #:phases (modify-phases %standard-phases
> + (replace 'install
> + (install-from-pom
> "maven-release-api/pom.xml")))))
> + (home-page "https://maven.apache.org/maven-release/")
> + (synopsis "APIs to implement to extend maven-release-plugin")

It's hard to understand this sentence. maybe s/to implement/required/

Toggle quote (2 lines)
> + (description "APIs to implement to extend maven-release-plugin")

This should be full sentences. Can you come up with maybe two sentences
that briefly explain what this package does?

Toggle quote (19 lines)
> + (license license:asl2.0)))
> +
> +(define maven-release-parent-pom
> + (package
> + (inherit maven-release-api)
> + (name "maven-release-parent-pom")
> + (arguments
> + `(#:tests? #f ; no tests
> + #:phases (modify-phases %standard-phases
> + (delete 'configure)
> + (delete 'build)
> + (replace 'install
> + (install-pom-file "pom.xml")))))
> + (propagated-inputs
> + (list maven-parent-pom-34))
> + (synopsis "Apache Maven Release (Plugin)")
> + (description "This plugin is used to release a project with
> Maven, saving +a lot of repetitive, manual work.")))

I would replace "(Plugin)" with "parent pom". The description is for
the plugin, not the parent pom, so maybe:

This is the parent for the maven release plugin that is used to release
...

WDYT?
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEHvsJCR8X0ozL+bE6U9RXstY27oIFAmK27jwACgkQU9RXstY2
7oIDKg//bY1mTqDctJTv4Ib8FMGYvrkM5UETeMteK2/3ThP31NwCsS6DAKmrn+py
X1wVuyGlfNDoXK/rbzcii2JsgzQu2mwkyKudSb8z337vitbeOHdJnxn5KFwrAk2C
Az1VnOotdjrLHo7YYbUX+/H2R+R67X01HJbxD7VC8orDrX/if4aAgmyUYtgjZ7/4
iVFGxnLRGMyzLaQVvlC9Dc7rbgODFVb+CkCVehFGPFs//QUsXL5DFRaaDeM3MsvY
DdYGEGH4naZP6ipiJhhdixeAcubZqOMS/O2l2fAlpzwp1IEEGymRMdFzu1Ek+IwO
egb9MMyBeVFyDOtOlz8KHCYYUQCqqgVarFTTs46ncRqVsuZxK/qeihzK/nNZDMCk
Hy9DreZz2azl/iGvVMSdpewemtoVpW8XEGjTFe3fbz4A9cGelA1/VfssbQ2BqYp6
zHEV7FOgYuUBCO3+gIYaibIrftdpyFLS8fPj+FQwfOFqQmAxkHpiTAmKmetFRcNd
7H1Xxt562fkVJQe73FJ65apY0EApUiKpM1hdaPTSWgPIjPQDMU1aPNF0crNeugWJ
mWsA5mqc+PGcTxa//atXXXeI2nKfwihTihoCnJ8NZIcUOc2bqtBaOQYMgj/dGJl4
visx+uiGmLiLOPwGqzTUSzkRP7b8Y4HfUHyKP82BGfPh3XzsyjA=
=HyKr
-----END PGP SIGNATURE-----


?