Skip to content

JDK14 JPMS problem - module colesico.armario.mailer reads package org.simplejavamail.internal.modules from both org.simplejavamail.core and org.simplejavamail #265

Closed

Description

@colesico

Hi, here is my pom part:

<dependency>
            <groupId>org.simplejavamail</groupId>
            <artifactId>simple-java-mail</artifactId>
            <version>6.0.4</version>
</dependency>

module-info:

requires org.simplejavamail;
requires org.simplejavamail.core;

and app code:

 Email email = EmailBuilder.startingBlank()
            .from(mailerJob.getFromName(), mailerJob.getFromAddr())
            .to(mailerJob.getToAddr())
            .withSubject(mailerJob.getSubject())
            .withPlainText(mailerJob.getText())
            .buildEmail();

when try to compile application an error occurred:

module 'bla bla' reads package org.simplejavamail.internal.modules from both org.simplejavamail.core and org.simplejavamail

If remove (1) 'requires org.simplejavamail.core;' or (2) 'requires org.simplejavamail;' from module-info another error occuring:

for (1): package org.simplejavamail.api.email is not visible
for (2) package org.simplejavamail.mailer is not visible

It seams something wrong with the package exporting in simplejavamail jpms modules

Activity

  1. bbottema commented on May 11, 2020

    @bbottema
    Owner

    Yikes, I don't have much experience with modules in Java, so right now your guess is as good as mine (probably better :P)

  2. keiki61 commented on May 19, 2020

    @keiki61

    Hi. I have encountered the same issue when I expiremented with modules.

    The problem imo is described here:
    https://stackoverflow.com/questions/42358084/package-conflicts-with-automatic-modules-in-java-9

    From my understanding is the issue that both jars provide the same packages.

    Yet I'm also new to the module topic and was just expirementing with it on a private play around project.

  3. colesico commented on May 21, 2020

    @colesico
    Author

    To make good jpms support in my opinion it is need to do the following:

    1. Eliminate package duplication in a modules
    2. Add to all modules src/main/java/module-info.java (JMPS module declaration file )
    3. Export all public packages from each module ("exports [package name]" declaration in module-info)
    4. For module "simple-java-mail" add "requires transitive core-module" declaration to module-info to avoid exporting both modules in client code
  4. zetti12345 commented on Nov 24, 2021

    @zetti12345

    Is there a plan to provide simple-java-mail JPMS conform?

  5. added a commit that references this issue on Jul 6, 2026
    12aa7d3
  6. added
    java
    and removed on Jul 6, 2026
  7. added this to the 9.0.0 milestone on Jul 6, 2026
  8. bbottema commented on Jul 6, 2026

    @bbottema
    Owner

    Fixed in 12aa7d3 as part of 9.0.0.

    Simple Java Mail now ships Java 9 module descriptors in the core and facade jars as multi-release entries. Modular consumers should only need:

    module my.app {
        requires org.simplejavamail;
    }

    The facade module declares requires transitive org.simplejavamail.core, so applications no longer need to require both org.simplejavamail and org.simplejavamail.core. This also completes the multi-release/jlink request from #237.

  9. bbottema commented on Jul 8, 2026

    @bbottema
    Owner

    Released in Simple Java Mail v9.0.0, which is now available from Maven Central:

    https://repo1.maven.org/maven2/org/simplejavamail/simple-java-mail/9.0.0/

    Release notes:
    https://github.com/bbottema/simple-java-mail/releases/tag/9.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority-Highbugjava

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions