Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 272
Priyabrat Nanda Avatar asked Mar 20 '14 20:03

Priyabrat Nanda


People also ask

How do I add a dependency in gradle?

To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build. gradle file. This declares a dependency on an Android library module named "mylibrary" (this name must match the library name defined with an include: in your settings.


1 Answers

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.

like image 172
Priyabrat Nanda Avatar answered Sep 21 '22 13:09

Priyabrat Nanda