通过gradle将javax.mail依赖jar添加到intellij库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22544249/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding javax.mail dependency jar to intellij library through gradle
提问by Priyabrat Nanda
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:
我需要通过gradle build将mail-1.4.7 jar文件包含到我的intellij idea项目库中。我将编译存储库名称添加到我的 build.gradle 文件中,如下所示:
compile 'javax.mail:mail:1.4.7'
编译'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.
然后我运行了我的构建,虽然构建过程中没有错误,但我无法在我的项目库中看到 jar。我在考虑通过 gradle 构建,jar 将被自动管理。不知道我是否需要尝试别的东西。我也尝试运行 gradle :cleanIdea 但没有成功。
采纳答案by Priyabrat Nanda
Finally i was able to resolve this. I reverted all changes to start again. Followed the below steps:
最后我能够解决这个问题。我恢复了所有更改以重新开始。遵循以下步骤:
- Add
compile 'javax.mail:mail:1.4.7'
to dependencies inbuild.gradle
file. - Run
gradle build
which will download the jar file to put in the repositories. - Run
gradle cleanIdea
- Run
gradle idea
- 添加
compile 'javax.mail:mail:1.4.7'
到build.gradle
文件中的依赖项。 - 运行
gradle build
这将下载 jar 文件以放入存储库。 - 跑
gradle cleanIdea
- 跑
gradle idea
This resolved all the problems with the cleanidea
clearing the iml files for intellij and regenerating through gradle idea
command.
这解决了cleanidea
清除 intellij 的 iml 文件并通过gradle idea
命令重新生成的所有问题。