Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 857468 - java-pkg-simple.eclass: should optionally add Automatic-Module-Name to META-INF/MANIFEST.MF
Summary: java-pkg-simple.eclass: should optionally add Automatic-Module-Name to META-I...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL: http://branchandbound.net/blog/java/2...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: module-info
  Show dependency tree
 
Reported: 2022-07-10 16:17 UTC by Volkmar W. Pogatzki
Modified: 2022-07-24 17:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log og dev-java/poi-5.2.2 (build.log,14.20 KB, text/plain)
2022-07-10 16:17 UTC, Volkmar W. Pogatzki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volkmar W. Pogatzki 2022-07-10 16:17:29 UTC
Created attachment 790859 [details]
build log og dev-java/poi-5.2.2

dev-java/poi-5.2.2 fails to compile with following errors (build log attached):

poi/src/main/java9/module-info.java:19: error: module not found: org.apache.commons.collections4
    requires org.apache.commons.collections4;
                               ^
poi/src/main/java9/module-info.java:20: error: module not found: org.apache.commons.codec
    requires org.apache.commons.codec;
                               ^
poi/src/main/java9/module-info.java:21: error: module not found: org.apache.commons.io
    requires org.apache.commons.io;
                               ^
poi/src/main/java9/module-info.java:22: error: module not found: commons.math3
    requires commons.math3;
                    ^
poi/src/main/java9/module-info.java:23: error: module not found: SparseBitSet
    requires SparseBitSet;
             ^
poi/src/main/java9/module-info.java:24: error: module not found: org.apache.logging.log4j
    requires org.apache.logging.log4j;


These errors are due to missing Automatic-Module-Name in META-INF/MANIFEST.MF of the related modules.
The second of above listed errors went away after spoofing the commons-codec ebuild with such line.

The java-pkg-simple.eclass should be enhanced with another ECLASS VARIABLE "JAVA_AUTOMATIC_MODULE_NAME" which the packager could use to put the value from the pom file.

Reading the Automatic-Module-Name directly from the pom file (if defined there) would be a benefit. 
https://github.com/apache/commons-codec/blob/rel/commons-codec-1.15/pom.xml#L300
Comment 1 Volkmar W. Pogatzki 2022-07-10 16:27:50 UTC
https://github.com/gentoo/gentoo/pull/26327 contains a spoofed commons-codec ebuild for demonstration.
Comment 2 Larry the Git Cow gentoo-dev 2022-07-22 13:45:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb922e47e811f847bc7cd931715d90e4906a57ee

commit cb922e47e811f847bc7cd931715d90e4906a57ee
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2022-07-14 18:00:09 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2022-07-22 13:45:11 +0000

    java-pkg-simple.eclass: Automatic-Module-Name
    
    The new variable JAVA_AUTOMATIC_MODULE_NAME can be defined in the
    ebuild. Its value will be transferred to the MANIFEST.MF of the jar
    file.
    
    Closes: https://bugs.gentoo.org/857468
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Closes: https://github.com/gentoo/gentoo/pull/26406
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 eclass/java-pkg-simple.eclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Comment 3 Larry the Git Cow gentoo-dev 2022-07-24 17:00:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f66d7dd5432a8bd8b5f072a276f6c2b5a04ba16a

commit f66d7dd5432a8bd8b5f072a276f6c2b5a04ba16a
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2022-07-10 10:31:06 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2022-07-24 16:51:50 +0000

    dev-java/poi: add 5.2.2
    
    Bug: https://bugs.gentoo.org/857468
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Closes: https://github.com/gentoo/gentoo/pull/26327
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 dev-java/poi/Manifest         |  1 +
 dev-java/poi/poi-5.2.2.ebuild | 63 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)