上下文URL不能为空 - Artifactory Gradle插件 [英] Context URL cannot be empty - Artifactory Gradle Plugin

查看:156
本文介绍了上下文URL不能为空 - Artifactory Gradle插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图去Artifactory Gradle插件工作,发布到我的本地Artifactory实例。



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



然而,用我最低限度的例子..我得到一个无法找到上下文URL错误

请注意,我已经指定了所有必需的Artifactory配置设置 - (如Artifactory Gradle WebPage所示)..包括Context 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'//如果发布者/解析器不覆盖基本Artifactory URL
publish {
repository {
repoKey ='integration-libs'//发布到
username ='admin'的Artifactory存储库密钥//发布者用户名
密码='密码'
}
}
解析{
存储库{
repoKey ='libs-releases'// Artifactory(最好是虚拟)存储库密钥从
解决


解决方案解决方案

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

  artifactory {
contextUrl ='http:// localhost:8081 / artifactory'//如果发布者/解析器不覆盖基本Artifactory URL
publish {
contextUrl ='http:// localhost :8081 / artifactory'//< - 这是修正
存储库{
repoKey ='integration-libs'//发布到
username ='admin'的Artifactory存储库密钥/ /发布者用户名
password ='密码'
}
}
解析{
储存库{
repoKey ='libs-releases'// //从
}
}
}


$ b $解析的Artifactory(最好是虚拟的) b

您可能还必须在resolve元素中再次定义它。


I'm trying to get to the Artifactory Gradle plugin working to publish to my local Artifactory instance.

I have the latest version (default install) running at localhost:8081/artifactory. I can verify this with access via a webbrowser.

However, with my bare minimum example .. I am getting a "Context URL cannot be found error

Note that I have specified all the mandatory required Artifactory configurations settings - (as indicated on the Artifactory Gradle WebPage) .. including the Context 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
    }
  }
}

解决方案

This looks like a weird bug and I'm not sure what causes it. I get it in some of my gradle build files but others seem to work fine. I fixed it by defining the contextUrl again inside the publish element, so your script will now look like:

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
    }
  }
}

You might also have to define it again inside the resolve element.

这篇关于上下文URL不能为空 - Artifactory Gradle插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆