You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (Jira)" <ji...@apache.org> on 2022/01/15 16:12:00 UTC

[jira] [Commented] (JENA-2253) Add module-info.java

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

Andy Seaborne commented on JENA-2253:
-------------------------------------

I don't see on {{tdf/odftoolkit/issues/54}} anything other than issues with {{odftoolkit/odfdom/}} code.
What do you use the test classes for? They do not run without the support files. They do contain some code used by other parts of Jena.

{{module-info.java}} is one way.

Another is automatic module name:
https://blog.joda.org/2017/05/java-se-9-jpms-automatic-modules.html

Each jar artifact has an automatic module name.

For example in {{jena-core/pom}}:

e.g.
{noformat}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
...
{noformat}


bq. As this did not work, I looked at the Jena docu and found that the pom.xml Maven descriptions changed and jena-core no longer is being referenced explicitly:
bq. https://jena.apache.org/download/maven.html
bq. Unfortunately the new way:

Nothing has changed in this area for many years. You can choose - depend on the {{<type>pom</type>}} artifact or a specific one as documented.

----

FYI: This looks odd - the PR says ASF copyright.

{noformat}
    Copyright 2022 The Apache Software Foundation.
{noformat}

As per
https://github.com/tdf/odftoolkit/blob/e4a48400abad2c47473fb11c3fb93f4058ddebff/LICENSE#L190

the copyright holders name needs to be set?

> Add module-info.java
> --------------------
>
>                 Key: JENA-2253
>                 URL: https://issues.apache.org/jira/browse/JENA-2253
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: Jena
>    Affects Versions: Jena 4.3.2
>            Reporter: Svante Schubert
>            Priority: Trivial
>
> I am quite new to the Java 9 modularity,  but my developers told me that it can be "enabled" by adding some basic module metadata in a {{module-info.java }}at the root of the java sources.
> Therefore, I suggest adding a module-info to your Jena project, so that users who are using a java module based project setup can benefit from this.
> We, the ODF Toolkit, are using Jena and we started such {{{}module-info.java{}}}: 
> [https://github.com/tdf/odftoolkit/pull/149/files]
> But somehow as soon we got this metadata the Java classes of the jena-core-tests JAR can no longer be found.
> The tests are not in our package list as we use them just during build/test time.
> Perhaps I can make one of you curious enough to test to create such simple {{module-info.java }} files to the root of your Java sources similar as done in the PR from us: [https://github.com/tdf/odftoolkit/pull/149]
> (The other reason for this issue, is also that we face an anomaly of lacking to find your jena-core-tests classes after using this new module-info.java. I hope that this phenomenon goes away when you add your module-info.java as well. Currently, [accessing the jena-core-tests via pom.xml in the old way,https://github.com/tdf/odftoolkit/blob/master/odfdom/pom.xml#L72] but the [new way using apache-jena-libs in pom.xml|https://jena.apache.org/download/maven.html does not work either.).
> Thanks in advance,
> Svante



--
This message was sent by Atlassian Jira
(v8.20.1#820001)