2016-08-09 54 views
1

Meine travis build job schlägt ständig fehl, weil es nicht die Abhängigkeiten, die ich auf Artefakte von bintray habe, auflösen kann.Travis-Ci-Job mit bintray Abhängigkeiten

Es sagt einfach: Failed to execute goal on project deployer: Could not resolve dependencies for project com.github.t1:deployer:war:2.2.0-SNAPSHOT: The following artifacts could not be resolved: com.github.t1:test-tools:jar:1.1.1, auch wenn ich bintray meine repositories in der Pom hinzufügen.

Antwort

2

Wenn die Abhängigkeiten sind alle in JCenter, fügen Sie eine Datei .travis.settings.xml enthält:

xml <?xml version="1.0" encoding="UTF-8" ?> <settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <profiles> <profile> <id>bintray</id> <repositories> <repository> <id>central</id> <name>bintray</name> <url>http://jcenter.bintray.com</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>bintray</activeProfile> </activeProfiles> </settings>

und fügen Sie die folgende Zeile in .travis.yml:

install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --settings .travis.settings.xml

Wenn Sie auch Plug-ins benötigen oder Abhängigkeiten von anderen Repositories, fügen Sie sie genauso wie in Ihrem lokalen settings.xml hinzu.