Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/jackrabbit-webdav/
Date: Sun, 09 Jan 2022 09:05:11
Message-Id: 1641719104.14aef16e0d785ec9f16650dd4f70969cda87863b.fordfrog@gentoo
1 commit: 14aef16e0d785ec9f16650dd4f70969cda87863b
2 Author: Yuan Liao <liaoyuan <AT> gmail <DOT> com>
3 AuthorDate: Sat Jan 8 18:01:46 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 9 09:05:04 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14aef16e
7
8 dev-java/jackrabbit-webdav: Fix tests and use HTTPS HOMEPAGE for 2.10.1
9
10 The test failure bug being fixed by this commit is caused by
11 servlet-api-4.0 being added to the classpath earlier than
12 servlet-api-2.3 by java-ant-2.eclass. servlet-api-4.0 is present in the
13 classpath because it is a transitive dependency of this package
14 introduced by dev-java/bndlib, but it is incompatible with the test
15 sources. The tests are supposed to be compiled with servlet-api-2.3,
16 but javac will choose servlet-api-4.0 because it appears earlier in the
17 classpath.
18
19 java-ant-2.eclass constructs the classpath by traversing the dependency
20 tree using depth-first search, so transitive dependencies like
21 servlet-api-4.0 can appear earlier than direct dependencies like
22 servlet-api-2.3. java-pkg-simple.eclass, on the other hand, uses
23 breadth-first search, which ensures that all direct dependencies will be
24 visited earlier than any transitive dependencies in the traversal.
25
26 Therefore, simply switching to java-pkg-simple.eclass resolves this bug.
27 However, by doing this, this ebuild now relies on the undocumented
28 implementation detail of java-pkg-simple.eclass, that the dependency
29 tree is traversed with BFS.
30
31 If java-pkg-simple.eclass switches to DFS for classpath construction in
32 the future, the same bug might resurface!
33
34 Yet there are still benefits of using java-pkg-simple.eclass even if it
35 were not done merely for the bug. The upstream uses Maven instead of
36 Ant to build the project -- the build.xml used by java-ant-2.eclass is a
37 Gentoo custom one. Switching to java-pkg-simple.eclass means that there
38 is no more maintenance burden of this package caused by the custom
39 build.xml. As of this commit, ebuilds for slot 2 of this package also
40 use java-pkg-simple.eclass, so the eclass switch fosters consistency.
41
42 Closes: https://bugs.gentoo.org/804594
43 Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
44 Closes: https://github.com/gentoo/gentoo/pull/23705
45 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
46
47 .../jackrabbit-webdav-2.10.1-r2.ebuild | 51 ++++++++++++++++++++++
48 1 file changed, 51 insertions(+)
49
50 diff --git a/dev-java/jackrabbit-webdav/jackrabbit-webdav-2.10.1-r2.ebuild b/dev-java/jackrabbit-webdav/jackrabbit-webdav-2.10.1-r2.ebuild
51 new file mode 100644
52 index 000000000000..c45c8b6d3bb0
53 --- /dev/null
54 +++ b/dev-java/jackrabbit-webdav/jackrabbit-webdav-2.10.1-r2.ebuild
55 @@ -0,0 +1,51 @@
56 +# Copyright 1999-2022 Gentoo Authors
57 +# Distributed under the terms of the GNU General Public License v2
58 +
59 +EAPI=8
60 +
61 +JAVA_PKG_IUSE="doc source test"
62 +JAVA_TESTING_FRAMEWORKS="junit-4"
63 +
64 +inherit java-pkg-2 java-pkg-simple
65 +
66 +MY_PN="${PN/-*/}"
67 +
68 +DESCRIPTION="Fully conforming implementation of the JRC API (specified in JSR 170 and 283)"
69 +HOMEPAGE="https://jackrabbit.apache.org/"
70 +SRC_URI="mirror://apache/${MY_PN}/${PV}/${MY_PN}-${PV}-src.zip"
71 +
72 +LICENSE="Apache-2.0"
73 +SLOT="0"
74 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
75 +
76 +S="${WORKDIR}/${MY_PN}-${PV}/${PN}"
77 +
78 +CP_DEPEND="dev-java/bndlib:0
79 + dev-java/slf4j-api:0
80 + dev-java/slf4j-nop:0
81 + dev-java/commons-httpclient:3
82 + java-virtuals/servlet-api:2.3"
83 +
84 +DEPEND=">=virtual/jdk-1.8:*
85 + ${CP_DEPEND}"
86 +
87 +RDEPEND=">=virtual/jre-1.8:*
88 + ${CP_DEPEND}"
89 +
90 +BDEPEND="app-arch/unzip"
91 +
92 +JAVA_SRC_DIR="src/main/java"
93 +JAVA_RESOURCE_DIRS=( "src/main/resources" )
94 +
95 +JAVA_TEST_GENTOO_CLASSPATH="junit-4"
96 +JAVA_TEST_SRC_DIR="src/test/java"
97 +JAVA_TEST_RESOURCE_DIRS=( "src/test/resources" )
98 +
99 +src_test() {
100 + # Run only tests that would be executed by Maven as in ${S}/pom.xml:79
101 + JAVA_TEST_RUN_ONLY=$(find "${JAVA_TEST_SRC_DIR}" -name "*TestAll.java" \
102 + -exec realpath --relative-to="${JAVA_TEST_SRC_DIR}" {} \;)
103 + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
104 + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
105 + java-pkg-simple_src_test
106 +}