File tree 3 files changed +22
-3
lines changed
3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ language: java
3
3
jdk :
4
4
- openjdk8
5
5
6
+ # See https://docs.travis-ci.com/user/languages/java/#caching
7
+ before_cache :
8
+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
9
+ - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
6
10
cache :
7
11
directories :
8
12
- $HOME/.m2
@@ -121,8 +125,9 @@ script:
121
125
# fail if generators contain tab '\t'
122
126
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
123
127
# run integration tests defined in maven pom.xml
124
- - mvn --quiet --batch-mode clean install
125
- - mvn --quiet --batch-mode verify -Psamples
128
+ # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
129
+ - mvn --quiet --batch-mode --show-version clean install
130
+ - mvn --quiet --batch-mode --show-version verify -Psamples
126
131
after_success :
127
132
# push to maven repo
128
133
- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
@@ -162,3 +167,4 @@ after_success:
162
167
163
168
env :
164
169
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5
170
+
Original file line number Diff line number Diff line change
1
+ <settings xmlns =" http://maven.apache.org/SETTINGS/1.0.0"
2
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : schemaLocation =" http://maven.apache.org/SETTINGS/1.0.0
4
+ https://maven.apache.org/xsd/settings-1.0.0.xsd" >
5
+ <!-- This directory matches what is defined in run-in-docker.sh -->
6
+ <localRepository >/var/maven/.m2/repository</localRepository >
7
+ </settings >
Original file line number Diff line number Diff line change @@ -7,12 +7,18 @@ maven_cache_repo="${HOME}/.m2/repository"
7
7
8
8
mkdir -p " ${maven_cache_repo} "
9
9
10
+ # !! The -u option below needs to be defined so we don't write to a user's bound ~/.m2/repository as root.
11
+ # !! but using this also means we either need to setup a user with the same id, or we execute without a username and home directory.
12
+ # !! This means we can't bind the .m2 directory to any user's directory (like /root/.m2).
13
+ # !! We _must_ define $MAVEN_CONFIG explicitly as a location that is not /root/.m2; the user executing this may not have access to the container's user's directory.
10
14
docker run --rm -it \
11
15
-w /gen \
12
16
-e GEN_DIR=/gen \
13
17
-e MAVEN_CONFIG=/var/maven/.m2 \
18
+ -e MAVEN_OPTS=" -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=/var/maven/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" \
14
19
-u " $( id -u) :$( id -g) " \
15
20
-v " ${PWD} :/gen" \
16
- -v " $HOME /.m2" :/root/.m2 \
21
+ -v " ${PWD} /CI/run-in-docker-settings.xml:/var/maven/.m2/settings.xml" \
22
+ -v " ${maven_cache_repo} :/var/maven/.m2/repository" \
17
23
--entrypoint /gen/docker-entrypoint.sh \
18
24
maven:3-jdk-8 " $@ "
You can’t perform that action at this time.
0 commit comments