【问题标题】:Travis not publishing to Bintray properlyTravis 没有正确发布到 Bintray
【发布时间】:2017-12-08 06:53:26
【问题描述】:

我正在尝试将 java 库发布到 Bintray,然后通过在 gradle 中定义 bintray 存储库在另一个项目中使用该库。

当从我的本地机器部署到 Bintray 时,这一切都有效,但是当我尝试从 Travis CI 让它工作时,它似乎无法正确发布。

当我尝试在不同的 gradle 项目中添加依赖项时,它找不到工件,即使我知道它在哪里并且文件已上传。

我注意到当我使用 Travis 时,maven-metadata.xml 似乎没有正确创建,我的印象是 Bintray 会为我创建它。

.travis.yml

language: java

before_install:
  - if [ -n "$TRAVIS_TAG" ]; then ./travis_prebuild.sh; fi

script:
  - echo "Building artifacts"
  - gradle clean build
  - if [ -n "$TRAVIS_TAG" ]; then gradle createPom; fi

before_deploy:
  - echo "Creating description file for bintray."
  - ./travis_postbuild.sh

deploy:
  provider: bintray
  file: "descriptor.json"
  user: $BINTRAY_USER
  key: $BINTRAY_API_KEY
  passphrase: $BINTRAY_GPG_PASSWORD
  skip_cleanup: true
  on:
    tags: true

bintray-conf.json

{
  "package": {
    "name": "core",
    "repo": "Qatja",
    "subject": "wetcat",
    "issue_tracker_url": "https://github.com/Qatja/core/issues",
    "vcs_url": "https://github.com/Qatja/core.git",
    "labels": ["MQTT", "Java"],
    "public_download_numbers": true,
    "public_stats": true
  },

  "version": {
    "name": "@VERSION@",
    "gpgSign": true
  },

  "files":
  [
    {"includePattern": "build/libs/(.*\.jar)", "uploadPattern": "@VERSION@/$1"},
    {"includePattern": "build/(.*\.pom)",  "uploadPattern": "@VERSION@/$1"}
  ],

  "publish": true
}

Bintray repo

Github repo

【问题讨论】:

标签: travis-ci bintray


【解决方案1】:

我猜你需要将“descriptor.json”重命名为“bintray-conf.json”。其余的看起来与我的工作配置几乎相同。

deploy:
  provider: bintray
  file: ./bintray-conf.json

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-18
    • 2012-12-29
    • 2015-10-20
    • 1970-01-01
    • 2015-08-03
    • 2017-08-19
    • 1970-01-01
    • 2021-02-13
    相关资源
    最近更新 更多