上下文URL不能为空-Artifactory Gradle插件

上下文URL不能为空-Artifactory Gradle插件,gradle,artifactory,Gradle,Artifactory,我正在尝试使用ArtifactoryGradle插件发布到本地Artifactory实例 我在localhost:8081/artifactory上运行了最新版本(默认安装)。我可以通过网络浏览器进行验证 然而,以我最简单的例子。。我收到一个“无法找到上下文URL”错误 注意,我已经指定了所有必需的artifactoryconfigurations设置(如artifactorygradle网页所示),包括上下文URL buildscript { repositories{ maven { u

我正在尝试使用ArtifactoryGradle插件发布到本地Artifactory实例

我在localhost:8081/artifactory上运行了最新版本(默认安装)。我可以通过网络浏览器进行验证

然而,以我最简单的例子。。我收到一个“无法找到上下文URL”错误

注意,我已经指定了所有必需的artifactoryconfigurations设置(如artifactorygradle网页所示),包括上下文URL

buildscript {
  repositories{ maven { url 'http://repo.jfrog.org/artifactory/gradle-plugins' } }
  dependencies{ classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:2.0.12'}
}

apply plugin: 'artifactory'

artifactory {
  contextUrl = 'http://localhost:8081/artifactory'   //The base Artifactory URL if not overridden by the publisher/resolver
  publish {
    repository {
      repoKey = 'integration-libs'   //The Artifactory repository key to publish to
      username = 'admin'          //The publisher user name
      password = 'password'
    } 
  }
  resolve {
    repository {
      repoKey = 'libs-releases'  //The Artifactory (preferably virtual) repository key to resolve from
    }
  }
}

这看起来像是一个奇怪的bug,我不确定是什么原因导致它。我在一些gradle构建文件中得到了它,但其他文件似乎工作正常。 我通过在publish元素中再次定义contextUrl来修复它,因此您的脚本现在看起来如下所示:

artifactory {
  contextUrl = 'http://localhost:8081/artifactory'   //The base Artifactory URL if not overridden by the publisher/resolver
  publish {
    contextUrl = 'http://localhost:8081/artifactory' // <- this is the fix
    repository {
      repoKey = 'integration-libs'   //The Artifactory repository key to publish to
      username = 'admin'          //The publisher user name
      password = 'password'
    } 
  }
  resolve {
    repository {
      repoKey = 'libs-releases'  //The Artifactory (preferably virtual) repository key to resolve from
    }
  }
}
artifactory{
语境http://localhost:8081/artifactory“//发布服务器/解析程序未覆盖的基本工件URL
发表{

语境http://localhost:8081/artifactory“//您使用哪个版本的Gradle?另外,如果这可能是一个bug,您可以尝试在发布和解析部分指定上下文URL吗?Gradle的最新版本(里程碑9)..以及相应的artifactory插件。这对我来说适用于里程碑9和1.0 final。我得到的错误消息是“上下文URL不能为空”"如果我没有定义
contexture rl
。此消息似乎与您的消息不同。您是否在GitHub或其他存储库中拥有完整的源代码?是单个还是多模块项目?好的,我意识到如果父项目包含一个artifactory配置,并且您尝试在子项目。当您将artifactory构建粘贴到子构建中并且父构建中没有artifactory配置时,似乎也会发生这种情况。似乎只能对所有构建使用artifactory,或者不使用artifactory。