最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Java用IntelliJ IDEA如何用gradle去安装第三方库PersistentCookieJar

gradle crifan 674浏览 0评论
折腾:
【未解决】OkHttp中如何获取响应中的Cookie和管理Cookie
期间,对于:
franmontiel/PersistentCookieJar: A persistent CookieJar implementation for OkHttp 3 based on SharedPreferences.
只能通过build.gradle去安装。没有独立的jar下载。
所以此处只能去想办法搞清楚如何在此处Java的IntelliJ IDEA中用gradle去安装PersistentCookieJar
java gradle intellij idea how use
Getting Started with Gradle – Help | IntelliJ IDEA
Gradle – Help | IntelliJ IDEA
Gradle – Help | IntelliJ IDEA
用IntelliJ IDEA创建Gradle项目简单入门 – guogangj – 博客园
Getting Started with Gradle / IntelliJ Platform SDK DevGuide
java – How to use gradle run with Intellij IDEA? – Stack Overflow
java – IntelliJ IDEA 2017 create a “hello world” project with gradle build system – Stack Overflow
看起来必须是要去:
(除非享有IDEA项目可以改造为gradle项目)
去IDEA中重新建一个 gradle的项目了
算了,还是后者吧:
【已解决】IntelliJ IDEA中新建Gradle项目
然后再去尝试加上配置
build.gradle
plugins {
    id 'java'
}

group 'crifan.org'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
}
加上后:
plugins {
    id 'java'
}

group 'crifan.org'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
}
IDEA自动去下载:
另外好像去下载,刚才导入的几个jar的源码去了
结果再去看源码,结果库又都失效了:
回来一看,却了之前的common io了:
去加上试试:
但是会提示:
Module EmulateBaiduLogin_main is imported from Gradle. Any changes made in its configuration my be lost after reimporting
IDEA gradle Module  is imported from Gradle. Any changes made in its configuration my be lost after reimporting
Intellij lost project settings after adding dependency in pom.xml – Stack Overflow
intellij idea – Unable to make the module: related gradle configuration was not found. Please, re-import the Gradle project and try again – Stack Overflow
点击Refresh
算了,去看看之前的库是否有通过gradle导入的:
【已解决】用新Gradle的IntelliJ IDEA项目中添加依赖的方式去导入几个库
然后就终于解决了:
此处只是想要导入:
PersistentCookieJar
的问题。。。

转载请注明:在路上 » 【已解决】Java用IntelliJ IDEA如何用gradle去安装第三方库PersistentCookieJar

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.170 seconds, using 23.26MB memory