Skip to content

Document proxy configuration for JS build instead of modifying pom.xml#1479

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/fix-pnpm-proxy-configuration
Closed

Document proxy configuration for JS build instead of modifying pom.xml#1479
Copilot wants to merge 4 commits intomainfrom
copilot/fix-pnpm-proxy-configuration

Conversation

Copy link

Copilot AI commented Feb 28, 2026

Description

Building behind a proxy fails during the JS build because Node.js child processes (e.g., kiota-gen downloading the Kiota CLI binary) cannot reach external hosts. Setting pnpmInheritsProxyConfigFromMaven=true is not viable — it appends --proxy/--https-proxy CLI args to all pnpm commands, which wireit rejects as unrecognized arguments.

Changes:

  • Reverted js/pom.xml to its original state — removed the hardcoded NODE_USE_ENV_PROXY=1 environmentVariables block, since shell env vars are already inherited by Maven's child processes automatically
  • Added proxy documentation to docs/building.md explaining the correct command-line approach

Usage — no pom.xml modification needed:

export HTTP_PROXY=http://your-proxy:port
export HTTPS_PROXY=http://your-proxy:port
export NO_PROXY=localhost,127.0.0.1
export NODE_USE_ENV_PROXY=1
./mvnw clean install -DskipTests

NODE_USE_ENV_PROXY=1 (Node.js v24.5.0+) makes built-in http/https/fetch() respect HTTP_PROXY/HTTPS_PROXY. These env vars propagate to all child processes (pnpm → wireit → kiota-gen) without injecting CLI args that break wireit.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Change pnpmInheritsProxyConfigFromMaven from false to true in js/pom.xml
so that Maven's proxy settings are propagated to pnpm and child processes.

This fixes build failures behind TLS-terminating proxies where the
kiota-gen package cannot download the Kiota CLI binary from GitHub,
resulting in ETIMEDOUT errors during the generate:openapi build step.

Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pnpm proxy configuration issue in build process Enable pnpm to inherit proxy configuration from Maven Feb 28, 2026
Instead of passing proxy as CLI args via pnpmInheritsProxyConfigFromMaven
(which breaks wireit and doesn't help child processes), set
NODE_USE_ENV_PROXY=1 environment variable. This leverages Node.js v24.5.0+
built-in support for HTTP_PROXY/HTTPS_PROXY/NO_PROXY env vars, making all
Node.js http/https requests (including kiota-gen binary download) go
through the proxy when users have standard proxy env vars configured.

Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot AI changed the title Enable pnpm to inherit proxy configuration from Maven Fix proxy configuration for Node.js processes during JS build Feb 28, 2026
Revert the environmentVariables block from js/pom.xml since shell
environment variables are inherited by child processes automatically.

Add documentation to docs/building.md explaining how to build behind
a proxy using NODE_USE_ENV_PROXY=1 and HTTP_PROXY/HTTPS_PROXY env vars,
which is the correct approach for Node.js v24+.

Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot AI changed the title Fix proxy configuration for Node.js processes during JS build Document proxy configuration for JS build instead of modifying pom.xml Feb 28, 2026
@tnorimat tnorimat closed this Mar 2, 2026
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

Successfully merging this pull request may close these issues.

2 participants