Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different Maven versions + Custom configuration #14

Open
MitchK opened this issue May 18, 2015 · 12 comments
Open

Different Maven versions + Custom configuration #14

MitchK opened this issue May 18, 2015 · 12 comments

Comments

@MitchK
Copy link
Contributor

MitchK commented May 18, 2015

Hi!

We would like to be able to choose the Maven version in Java builds for different projects (due to corporate requirements). This might be also great for the public Travis CI offering.

Currently, our developers download and install a custom Maven version on the fly. As we are internal service providers and would like to offer Travis as a tool that takes care of such things, it would be awesome being able to specify the Maven version.

Furthermore, we have a custom settings.xml that we currently provide with our machine images. I would be also great to provide a custom settings file for the builds.

All this could be done by implementing a maven key in the `.travis.yml``:

maven: 
  version: 3.0.0
  config: settings.xml
  ...
@MitchK MitchK changed the title Different Maven versions Different Maven versions + Custom configuration May 18, 2015
@hanasim
Copy link

hanasim commented Dec 3, 2015

+1

1 similar comment
@tecris
Copy link

tecris commented Feb 24, 2016

+1

@McFoggy
Copy link

McFoggy commented May 24, 2016

That would be good especially for maven plugins matrix build, so +1 also for me.

Meanwhile did someone solved that differently?

@fsquillace
Copy link

+1

1 similar comment
@trojanc
Copy link

trojanc commented Nov 1, 2016

+1

@colameo
Copy link

colameo commented Dec 10, 2016

is this supposed to be available in travis? would be really nice...

@TuomasMatilainen
Copy link

+1

@TuomasMatilainen
Copy link

Workaround
before_install:

@McFoggy
Copy link

McFoggy commented Jan 19, 2017

I personnally switched to docker using the following (see it in action in jgitver-maven-plugin for example)

language: bash

sudo: required

services:
  - docker

script:
  - docker run --rm -v $(pwd):/root/sources -w /root/sources maven:3.3.9-jdk-8 mvn -Prun-its clean install

after_failure:
  - find target/it -name *.log -exec echo {} \; -exec cat {} \;

branches:
    except:
        - gh-pages

@TheSnoozer
Copy link

@TuomasMatilainen Thanks for the suggestion with before_install!!
That is currently still working.

Note my travis.yml looks like similar (I know it might not be the most compact config but does exactly what I want to test):

language: java
sudo: false
dist: trusty
jdk:
  - oraclejdk9
  - oraclejdk8
  - openjdk7

matrix:
  include:
  - jdk: openjdk7
    env: CUSTOM_MVN_VERION="3.0"
  - jdk: openjdk7
    env: CUSTOM_MVN_VERION="3.1.1"
  - jdk: openjdk7
    env: CUSTOM_MVN_VERION="3.2.5"
  - jdk: openjdk7
    env: CUSTOM_MVN_VERION="3.3.9"
  - jdk: oraclejdk9
    env: CUSTOM_MVN_VERION="3.5.0"

install:
  - if [[ -n "${CUSTOM_MVN_VERION}" ]]; then
      echo "Download Maven ${CUSTOM_MVN_VERION}....";
      if [[ "${CUSTOM_MVN_VERION}" == "3.0" ]]; then
        wget https://archive.apache.org/dist/maven/binaries/apache-maven-3.0-bin.zip || travis_terminate 1;
      else
        wget https://archive.apache.org/dist/maven/maven-3/${CUSTOM_MVN_VERION}/binaries/apache-maven-${CUSTOM_MVN_VERION}-bin.zip || travis_terminate 1;
      fi;
      unzip -qq apache-maven-${CUSTOM_MVN_VERION}-bin.zip || travis_terminate 1;
      export M2_HOME=$PWD/apache-maven-${CUSTOM_MVN_VERION};
      export PATH=$M2_HOME/bin:$PATH;
      mvn -version;
    fi

feel free to use it for whatever project / license

str4d added a commit to str4d/ed25519-java that referenced this issue Dec 2, 2017
mgudemann pushed a commit to diffblue/deeptest-utils that referenced this issue May 15, 2018
Adds Oracle JDK 8 / openJDK 6/7/8 as build JDKs. Oracle JDK7 isn't
available. Also adds custom maven version 3.2.5 for Java6 builds.

cf. travis-ci/enterprise-installation#14 (comment)
mgudemann pushed a commit to diffblue/deeptest-utils that referenced this issue May 16, 2018
Adds Oracle JDK 8 / openJDK 6/7/8 as build JDKs. Oracle JDK7 isn't
available. Also adds custom maven version 3.2.5 for Java6 builds.

cf. travis-ci/enterprise-installation#14 (comment)
mgudemann pushed a commit to diffblue/deeptest-utils that referenced this issue May 16, 2018
Adds Oracle JDK 8 / openJDK 6/7/8 as build JDKs. Oracle JDK7 isn't
available. Also adds custom maven version 3.2.5 for Java6 builds.

cf. travis-ci/enterprise-installation#14 (comment)
@PhilMFischer
Copy link

Is there any news about this idea?

@pingsutw
Copy link

Is there any news about this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests