You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by "Samael Bate (Jira)" <ji...@apache.org> on 2023/11/13 16:32:00 UTC

[jira] [Comment Edited] (XGC-127) Set an automatic module name in the Jar MANIFEST

    [ https://issues.apache.org/jira/browse/XGC-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785557#comment-17785557 ] 

Samael Bate edited comment on XGC-127 at 11/13/23 4:31 PM:
-----------------------------------------------------------

I've opened a PR for this as it will help when it comes to do https://issues.apache.org/jira/browse/FOP-3159

 

note that both projects rely on commons-logging which doesn't support JPMS and is pretty dead these days. It's worth moving to slf4j-api for handling logging.

 

If commons-logging was swapped out for slf4j then it will possible to have a module-info defined that should be able to be published. Something like:
{code:java}
module org.apache.xmlgraphics.commons {
    requires java.desktop;
    requires java.xml;

    requires commons.logging; // needs to go!
    requires org.apache.commons.io;

    exports org.apache.xmlgraphics.fonts;
    exports org.apache.xmlgraphics.image;
    exports org.apache.xmlgraphics.image.codec.png;
    exports org.apache.xmlgraphics.image.codec.tiff;
    exports org.apache.xmlgraphics.image.codec.util;
    exports org.apache.xmlgraphics.image.loader;
    exports org.apache.xmlgraphics.image.rendered;
    exports org.apache.xmlgraphics.image.writer;
    exports org.apache.xmlgraphics.image.writer.imageio;
    exports org.apache.xmlgraphics.io;
    exports org.apache.xmlgraphics.java2d;
    exports org.apache.xmlgraphics.java2d.color;
    exports org.apache.xmlgraphics.java2d.color.profile;
    exports org.apache.xmlgraphics.java2d.ps;
    exports org.apache.xmlgraphics.ps;
    exports org.apache.xmlgraphics.ps.dsc;
    exports org.apache.xmlgraphics.ps.dsc.events;
    exports org.apache.xmlgraphics.ps.dsc.tools;
    exports org.apache.xmlgraphics.util;
    exports org.apache.xmlgraphics.util.dijkstra;
    exports org.apache.xmlgraphics.util.i18n;
    exports org.apache.xmlgraphics.util.io;
    exports org.apache.xmlgraphics.util.uri;
    exports org.apache.xmlgraphics.xmp;
    exports org.apache.xmlgraphics.xmp.merge;
    exports org.apache.xmlgraphics.xmp.schemas;
    exports org.apache.xmlgraphics.xmp.schemas.pdf;
} {code}
 

 


was (Author: singingbush):
I've opened a PR for this as it will help when it comes to do https://issues.apache.org/jira/browse/FOP-3159

 

note that both projects rely on commons-logging which doesn't support JPMS and is pretty dead these days. It's worth moving to slf4j-api for handling logging.

 

If commons-logging was swapped out for slf4j then it will possible to have a module-info defined that should be able to be published. Something like:

 

 
{code:java}
module org.apache.xmlgraphics.commons {
    requires java.desktop;
    requires java.xml;

    requires commons.logging; // needs to go!
    requires org.apache.commons.io;

    exports org.apache.xmlgraphics.fonts;
    exports org.apache.xmlgraphics.image;
    exports org.apache.xmlgraphics.image.codec.png;
    exports org.apache.xmlgraphics.image.codec.tiff;
    exports org.apache.xmlgraphics.image.codec.util;
    exports org.apache.xmlgraphics.image.loader;
    exports org.apache.xmlgraphics.image.rendered;
    exports org.apache.xmlgraphics.image.writer;
    exports org.apache.xmlgraphics.image.writer.imageio;
    exports org.apache.xmlgraphics.io;
    exports org.apache.xmlgraphics.java2d;
    exports org.apache.xmlgraphics.java2d.color;
    exports org.apache.xmlgraphics.java2d.color.profile;
    exports org.apache.xmlgraphics.java2d.ps;
    exports org.apache.xmlgraphics.ps;
    exports org.apache.xmlgraphics.ps.dsc;
    exports org.apache.xmlgraphics.ps.dsc.events;
    exports org.apache.xmlgraphics.ps.dsc.tools;
    exports org.apache.xmlgraphics.util;
    exports org.apache.xmlgraphics.util.dijkstra;
    exports org.apache.xmlgraphics.util.i18n;
    exports org.apache.xmlgraphics.util.io;
    exports org.apache.xmlgraphics.util.uri;
    exports org.apache.xmlgraphics.xmp;
    exports org.apache.xmlgraphics.xmp.merge;
    exports org.apache.xmlgraphics.xmp.schemas;
    exports org.apache.xmlgraphics.xmp.schemas.pdf;
} {code}
 

 

> Set an automatic module name in the Jar MANIFEST
> ------------------------------------------------
>
>                 Key: XGC-127
>                 URL: https://issues.apache.org/jira/browse/XGC-127
>             Project: XMLGraphicsCommons
>          Issue Type: Improvement
>          Components: general
>    Affects Versions: 2.6
>            Reporter: Carte Project
>            Priority: Major
>              Labels: jpms, maven, modularization
>
> When this project is used in JPMS modular builds, it causes either warnings or errors because it is not declaring a module name. One possibility would be to declare an automatic module name (full modularization could be done later), see the following blog post for context:
> http://branchandbound.net/blog/java/2017/12/automatic-module-name/
> It is simple to add the automatic module name configuration to the Maven pom.xml and I can provide a pull request if you are interested. The module name could be {{org.apache.xmlgraphics.commons}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org