Skip to content

Commit

Permalink
chore: added HTTP options to make Maven call more resilient (#3865)
Browse files Browse the repository at this point in the history
The build of `@jsii/java-runtime` may sometimes fail in the pipeline with a message like this:

> [ERROR] Plugin org.apache.maven.plugins:maven-source-plugin:3.2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-source-plugin:jar:3.2.1: Could not transfer artifact org.apache.maven.plugins:maven-source-plugin:pom:3.2.1 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-source-plugin/3.2.1/maven-source-plugin-3.2.1.pom: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.32.215] failed: Connection timed out (Connection timed out) -> [Help 1]

The recommended solution is to disable the connection pooling with `-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false`

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
otaviomacedo authored Dec 2, 2022
1 parent 2b69722 commit 3509a0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@jsii/java-runtime-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"types": "lib/index.d.ts",
"scripts": {
"build": "bash ./generate.sh",
"test": "node ./user.xml.t.js > ./project/user.xml && cd project && mvn -B test --settings=user.xml",
"test": "node ./user.xml.t.js > ./project/user.xml && cd project && mvn -B test --settings=user.xml -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false",
"test:update": "UPDATE_DIFF=1 npm run test"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/java-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"types": "lib/index.d.ts",
"scripts": {
"gen": "bash ./generate.sh",
"build": "tsc --build && npm run gen && cd project && mvn -version && mvn -B deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo --settings=user.xml",
"build": "tsc --build && npm run gen && cd project && mvn -version && mvn -B deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo --settings=user.xml -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false",
"dist-clean": "rm -rf dist maven-repo && cd project && mvn -B clean --settings=user.xml",
"test": "echo 'Tests are run as part of the build target'",
"test:update": "UPDATE_DIFF=1 npm run test",
Expand Down

0 comments on commit 3509a0c

Please sign in to comment.