Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 如何对某些依赖项禁用'org.jetbrains.intellij'的缓存重定向器?_Maven_Gradle_Intellij Idea_Intellij Plugin - Fatal编程技术网

Maven 如何对某些依赖项禁用'org.jetbrains.intellij'的缓存重定向器?

Maven 如何对某些依赖项禁用'org.jetbrains.intellij'的缓存重定向器?,maven,gradle,intellij-idea,intellij-plugin,Maven,Gradle,Intellij Idea,Intellij Plugin,我想在我的插件项目中引入com.alibaba:fastjson:1.2.58,但是当gradle解析依赖项时,org.jetbrains.intellij插件将下载请求重定向到,而这是不存在的 如何强制gradle从mavenCentral下载此依赖项 这是我的build.gradle: buildscript { repositories { mavenCentral() maven { url "https://oss.so

我想在我的插件项目中引入
com.alibaba:fastjson:1.2.58
,但是当gradle解析依赖项时,
org.jetbrains.intellij
插件将下载请求重定向到,而这是不存在的

如何强制gradle从
mavenCentral
下载此依赖项

这是我的
build.gradle

buildscript {
    repositories {
        mavenCentral()

        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        }
        maven {
            url 'https://dl.bintray.com/jetbrains/intellij-plugin-service'
        }
    }
}

plugins {
    id "org.jetbrains.intellij" version "0.4.4"
}

dependencies {
   implementation 'com.alibaba:fastjson:1.2.58'
}

apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'

sourceCompatibility = 1.8
targetCompatibility = 1.8

intellij {
    version ideaVersion
    updateSinceUntilBuild false
    plugins = [
            "com.jetbrains.php:${phpPluginVersion}",
            "com.jetbrains.php.blade:${bladePluginVersion}",
            'CSS',
            'java-i18n',
            'properties',
            'git4idea'
    ]
    pluginName 'tw tools'
}

patchPluginXml {
    sinceBuild '173'
}

group 'com.baiguiren'

version '1.2'

wrapper {
    gradleVersion '5.4.1'
}
/gradlew clean&/gradlew build的输出

BUILD SUCCESSFUL in 0s
1 actionable task: 1 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':prepareSandbox'.
> Could not resolve all files for configuration ':runtimeClasspath'.
   > Could not find com.alibaba:fastjson:1.2.58.
     Searched in the following locations:
         https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.pom
         https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.jar
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/com.alibaba/fastjson/1.2.58/ivy-1.2.58.xml
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/fastjson-1.2.58-withKotlin-withSources.xml
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/com.alibaba/fastjson/1.2.58/fastjson-1.2.58.jar
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/fastjson.jar
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.3.5/78cbcd517ec112fbb0c7b45b00b464c1aa6371f3/fastjson-1.2.58-[classifier].jar
         https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.pom
         https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.jar
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/com.alibaba/fastjson-1.2.58.xml
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/plugins/fastjson/fastjson.jar
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/fastjson-1.2.58/fastjson.jar
         file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.3.5/78cbcd517ec112fbb0c7b45b00b464c1aa6371f3/fastjson-2018.3.5.jar
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org
我已尝试
无效缓存并重新启动
,但无法工作


我甚至试图删除
org.jetbrains.intellij
插件,但这是项目所需要的。

缓存重定向器没有问题,它只是项目中注册的存储库之一,Gradle会检查所有这些

尝试将
mavenCentral
repo添加到build.gradle中(目前它仅为
buildscript
定义):


缓存重定向器没有问题,它只是在项目中注册的存储库之一,Gradle会检查所有这些存储库

尝试将
mavenCentral
repo添加到build.gradle中(目前它仅为
buildscript
定义):


我也有同样的错误。我的回购协议中有
mavenCentral()
。它检查缓存repo,但似乎不是真正的repo。检查
存储库
的声明位置很重要。确保您的脚本不在
buildscript
部分(或者至少不在那里),并且它应用于正确的项目或子项目。如果您仍然有问题,请随时创建一个关于构建脚本内容的问题。我也有同样的错误。我的回购协议中有
mavenCentral()
。它检查缓存repo,但似乎不是真正的repo。检查
存储库
的声明位置很重要。确保您的脚本不在
buildscript
部分(或者至少不在那里),并且它应用于正确的项目或子项目。如果您仍有问题,请随时使用构建脚本内容在上创建问题。
repositories {
        mavenCentral()
}