Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include an automatic module name in the manifest #110

Closed
frozen-chameleon opened this issue Jul 13, 2019 · 7 comments
Closed

Include an automatic module name in the manifest #110

frozen-chameleon opened this issue Jul 13, 2019 · 7 comments
Milestone

Comments

@frozen-chameleon
Copy link

Adding an automatic-module-name manifest entry will make it easier to use tinylog in a modular java application without making tinylog a modular application itself.

@pmwmedia
Copy link
Member

@frozen-chameleon Could you create a pull-request? I would publish it in Version 2.0.0-RC2.

@frozen-chameleon
Copy link
Author

Unfortunately I do not have much experience with maven. I managed to add the entries by editing the pom.xml of each module.

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jar-plugin</artifactId>
   <configuration>
      <archive>
         <manifestEntries>
            <Automatic-Module-Name>the.module.name</Automatic-Module-Name>
         </manifestEntries>
      </archive>
   </configuration>
</plugin>

A unique automatic-module-name has to be provided for each module. The naming depends mainly on how you want to structure the project.

Some ideas:
tinylog-api => org.tinylog / org.tinylog.base / org.tinylog.core / org.tinylog.api
tinylog-api-kotlin => org.tinylog.kotlin
tinylog-impl => org.tinylog.impl / org.tinylog.simple

@pmwmedia
Copy link
Member

Thank you for your suggestion!

I prefer the following module names:

tinylog-api => org.tinylog.api
tinylog-api-kotlin => org.tinylog.api.kotlin
jul-tinylog => org.tinylog.api.jul
tinylog-impl => org.tinylog.impl
tinylog-jul => org.tinylog.adapter.jul

@pmwmedia
Copy link
Member

@frozen-chameleon
Copy link
Author

I tested tinylog-2.0-SNAPSHOT.zip and jul-tinylog-2.0-SNAPSHOT.zip and slf4j-tinylog-2.0-SNAPSHOT.zip. Everything is working fine in my project when I add requires org.tinylog.api; in module-info.java.

As a side node: Windows Defender flagged tinylog-2.0, tinylog-kotlin-2.0 and tinylog-scala-2.0 snapshots as a virus (Trojan:Java/Tisifi.C). The flagged file is tinylog-impl-2.0-SNAPSHOT-javadoc.jar. Looks like it is a false positive according to the virustotal report.

@pmwmedia
Copy link
Member

@frozen-chameleon Thank you for testing! Yes, that is a false positive that Windows Defender likes to report sometimes for unknown JAR files for any reason. I received it also for JARs of other projects in the past. As soon as Windows Defender has scanned such a JAR file on multiple but different PC, it will not be reported anymore.

@github-actions
Copy link

github-actions bot commented Oct 9, 2022

This closed issue has been locked automatically. However, please feel free to file a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants