I all,travis gitflow java maven工作流程
在github上托管的java项目上工作。 我想将代码直接推送到开发和主分支上的sonatype。
目前只有发展分支作品,因为我跳过了GPG签署
我使用Setting.xml的 .travis文件夹在我的凭据
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- Maven Central Deployment -->
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
我travis.yml看起来像这样:
language: java
jdk:
- oraclejdk8
script:
- mvn --settings .travis/settings.xml clean verify
deploy:
-
provider: script
script:
- mvn --settings .travis/settings.xml deploy -D gpg.skip -P release
on:
branch: develop
-
provider: script
script:
- mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.3:set -D newVersion=$TRAVIS_TAG -P release
- .travis/gpg.sh
- mvn clean deploy --settings .travis/settings.xml -D skipTests=true --batch-mode --update-snapshots -P release
on:
tags: true
我的发行版配置文件包含所需的部署插件。
当我推送标签/版本(如0.0.2)时出现错误。我期望这个使用标签部署一个版本。
开发分支工作正常,快照部署到sonatype回购正确。
https://github.com/effectus-io/effectus-parent
在此先感谢
这里是特拉维斯记录错误。
The command "mvn --settings .travis/settings.xml clean verify" exited with 0. Skipping a deployment with the script provider because this branch is not permitted dpl.0 Fetching: dpl-1.8.31.gem (100%)Fetching: dpl-1.8.31.gem (100%) Successfully installed dpl-1.8.31 1 gem installed dpl.1 Installing deploy dependencies !!! Script support is experimental !!! Preparing deploy Cleaning up git repository with `git stash --all`. If you need build artifacts for deployment, set `deploy.skip_cleanup: true`. See https://docs.travis-ci.com/user/deployment/#Uploading-Files. No local changes to save dpl.3 Deploying application No stash found. /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:54:in `system': wrong first argument (ArgumentError) from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:54:in `shell' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/provider/script.rb:18:in `push_app' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/provider.rb:146:in `block in deploy' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:41:in `fold' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/provider.rb:146:in `deploy' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:32:in `run' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:7:in `run' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/bin/dpl:5:in `<top (required)>' from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `load' from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `<main>' failed to deploy
不完全确定如何帮助你,但浏览DPL我确实看到这个:https://github.com/travis-ci/dpl/pull/466,你可以看看那里,看看是否有任何提交为您提供有关如何使其工作的线索。 – DarthHater