Hakan Hakan - 3 months ago 27
Java Question

How can i configure my travis.yml for Play framework?

I want to configure my travis.yml for Play framework 2.4.3 Java project but i couldn't find anything about that.

This is my current travis.yml:

language: java
sudo: false

addons:
apt:
packages:
- oracle-java8-installer

jdk:
- oraclejdk8

env:
PLAY_VERSION=2.4.3

before_script:
wget http://downloads.typesafe.com/releases/play-${PLAY_VERSION}.zip
unzip -q play-${PLAY_VERSION}.zip
script: play-${PLAY_VERSION}/play deps --sync

notifications:
email: false


As you know, Play framework use Activator since 2.3.8 version and how can i download play framework 2.4.3 from full URL? bacause http://downloads.typesafe.com/releases/play-${PLAY_VERSION}.zip this URL not working.

My Project Spec:


  • Play Framework 2.4.3

  • MySQL 5.7.9

  • Hazelcast (Maybe could be Redis)

  • Debian 8 (on cloud)

  • Travis-CI (Pro)

  • Github

  • IntelliJ Idea 14



Someone can help me?

Thanks.

Answer

If your project uses the standard project setup that activator provides, there's very little you need to do to integrate with Travis-Ci. I am not sure why you are downloading the framework, when sbt should be doing that for you.

All you need is a .travis.yml file at the root of the project with the following content:

For Java:

language: java
jdk:
    - oraclejdk8

For Scala:

language: scala
jdk:
    - oraclejdk8

Travis will find your projects sbt files and will fetch the Play Dependencies for you. See my scala example here