Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3213654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:58:10+00:00 2026-05-17T14:58:10+00:00

I have project A which a pom.xml dependency of: <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.2</version> </dependency>

  • 0

I have project A which a pom.xml dependency of:

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-email</artifactId>
        <version>1.2</version>
    </dependency>

commons-email depends on javax.mail-1.4.1

I ran mvn install to install projectA.jar into the local maven repo.

In project B, i depend projectA.jar.
When I run project B, it fails due to a missing class file in javax:

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
java.lang.ClassNotFoundException: com.sun.mail.smtp.SMTPTransport

How can i run project B successfully without explicitly putting a maven entry for the javax.mail jar?


EDIT:

I think I found the problem.
I was using maven-shade-plugin with true and it was removing the org.apache.commons:commons-email:jar dependencies in installed(.m2) project A pom file.

Commenting out the maven-shade-plugin for project A fixed the dependency problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:58:11+00:00Added an answer on May 17, 2026 at 2:58 pm

    How can i run project B successfully without explicitly putting a maven entry for the javax.mail jar?

    Well, that’s weird. c.s.m.s.SMTPTransport is supposed to be provided by mail-1.4.1.jar which is a dependency of commons-email. Project B should get it transitively.

    Could you run the following on project B and post the output

    mvn dependency:tree
    

    Update: There is definitely something weird with your dependencies and I can’t reproduce the problem.

    I quickly created a first project with the following pom:

    <project>
      ...
      <groupId>com.stackoverflow</groupId>
      <artifactId>Q3875317-A</artifactId>
      <dependencies>
        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-email</artifactId>
          <version>1.2</version>
        </dependency>
      </dependencies>
    </project>
    

    And another one depending on the first artifact:

    <project>
      ...
      <groupId>com.stackoverflow</groupId>
      <artifactId>Q3875317-B</artifactId>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>Q3875317-A</artifactId>
          <version>${project.version}</version>
        </dependency>
      </dependencies>
    </project>
    

    And here is the dependency tree I get for the second project:

    $ mvn dependency:tree
    [INFO] Scanning for projects...
    [INFO] Searching repository for plugin with prefix: 'dependency'.
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Q3875317-B
    [INFO]    task-segment: [dependency:tree]
    [INFO] ------------------------------------------------------------------------
    [INFO] [dependency:tree {execution: default-cli}]
    [INFO] com.stackoverflow:Q3875317-B:jar:1.0-SNAPSHOT
    [INFO] +- com.stackoverflow:Q3875317-A:jar:1.0-SNAPSHOT:compile
    [INFO] |  \- org.apache.commons:commons-email:jar:1.2:compile
    [INFO] |     +- javax.mail:mail:jar:1.4.1:compile
    [INFO] |     \- javax.activation:activation:jar:1.1:compile
    [INFO] \- junit:junit:jar:3.8.1:test
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    ...
    

    Everything is there, as expected.

    If you get a different result and if there is anything noticeable about your POMs, please show them.

    PS: I removed one of the command I initially suggested as it didn’t allow to see transitive dependencies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two projects: Project-Core Project-Source Project-Core POM.xml: <groupId>com.company</groupId> <artifactId>project-core</artifactId> <packaging>jar</packaging> <version>2.1</version> Project-Source POM.xml:
I have parent project parent, which has three modules like: <groupId>com.dummy.bla.bla</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging>
I have a project with a parent pom.xml which define profiles, and a debug
I have been given an existing project which is consisting of pom.xml file in
Currently, I have a Maven project which inherits from a parent pom defining two
My project P depends on dependency A which depends on dependency B. My project's
I have several Maven modules with Vaadin library dependency in the root pom.xml file.
I have a stripped down test project which contains a Servlet version 3.0, declared
I have a project which has some lib's associated with it (in Build Path).
I have a project which uses groovy 1.7.5 and grails 1.3.4. but my new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.