Priyabrat Nanda
Priyabrat Nanda

Reputation: 1095

Adding javax.mail dependency jar to intellij library through gradle

I need to include the mail-1.4.7 jar file into my intellij idea project library through gradle build. I added the compile repository name into my build.gradle file as below:

compile 'javax.mail:mail:1.4.7'

Then i ran my build and although there is no error during the build, i am unable to see the jar in my project library. I was thinking through the gradle build, the jar will be managed automatically. Not sure if i need to try something else. I also tried running gradle :cleanIdea but without success.

Upvotes: 12

Views: 18417

Answers (1)

Priyabrat Nanda
Priyabrat Nanda

Reputation: 1095

Finally i was able to resolve this. I reverted all changes to start again. Followed the below steps:

  1. Add compile 'javax.mail:mail:1.4.7' to dependencies in build.gradle file.
  2. Run gradle build which will download the jar file to put in the repositories.
  3. Run gradle cleanIdea
  4. Run gradle idea

This resolved all the problems with the cleanidea clearing the iml files for intellij and regenerating through gradle idea command.

Upvotes: 17

Related Questions