This guide helps resolve common issues when using this Gradle template in corporate environments with firewalls, proxies, and SSL inspection.
Error: PKIX path building failed: unable to find valid certification path to requested target
Cause: Corporate SSL inspection replaces certificates with internal ones that Java doesn't trust.
Error: 407 Proxy Authentication Required or connection timeouts
Cause: Corporate proxy requires authentication that Gradle isn't configured for.
Error: Connection refused or DNS resolution failures
Cause: Corporate firewall blocks access to external repositories.
# Run in PowerShell as Administrator
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\setup-corporate-network.ps1# Double-click or run in Command Prompt
setup-corporate-network.bat- Windows Settings: Settings → Network & Internet → Proxy
- Control Panel: Internet Options → Connections → LAN Settings
- Ask IT Team: Get proxy host, port, and authentication details
# Replace with your actual proxy details
systemProp.http.proxyHost=proxy.yourcompany.com
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=proxy.yourcompany.com
systemProp.https.proxyPort=8080
# If authentication required
systemProp.http.proxyUser=DOMAIN\\username
systemProp.http.proxyPassword=your-password
systemProp.https.proxyUser=DOMAIN\\username
systemProp.https.proxyPassword=your-password# Get corporate root certificate from IT team
# Import to Java trust store (run as Administrator)
keytool -import -alias corporate-root -file corporate-cert.crt -keystore "%JAVA_HOME%\lib\security\cacerts" -storepass changeitThe provided gradle.properties includes SSL bypass flags. Use only for development!
# Point to Windows certificate store
systemProp.javax.net.ssl.trustStoreType=Windows-ROOTIf Gradle wrapper can't download automatically:
- Download from: https://services.gradle.org/distributions/gradle-8.11.1-all.zip
- Extract to project directory as
gradle-8.11.1/ - Run:
gradle-8.11.1\bin\gradle.bat build
If your company has Nexus/Artifactory:
# In gradle.properties
systemProp.gradle.wrapperBaseUrl=http://your-nexus.company.com/gradle/distributions/Set these in Windows Environment Variables or your IDE:
JAVA_OPTS=-Dtrust_all_cert=true -Djava.net.useSystemProxies=true
GRADLE_OPTS=-Dtrust_all_cert=true -Djava.net.useSystemProxies=trueWhen contacting your IT team, ask for:
- HTTP/HTTPS proxy host and port
- Proxy authentication method (basic, NTLM, etc.)
- PAC (Proxy Auto-Configuration) file location
- Non-proxy hosts list
- Corporate root certificate file
- Instructions for importing certificates
- Whether they can whitelist gradle.org and services.gradle.org
- Internal Maven/Gradle repository URLs
- VPN requirements for external access
- Approved external repository domains
# Check Java version
java -version
# Test basic connectivity
ping gradle.org
nslookup services.gradle.org
# Test HTTPS connectivity
curl -I https://services.gradle.org/distributions/gradle-8.11.1-all.zip# Windows proxy settings
netsh winhttp show proxy
# Environment variables
echo %HTTP_PROXY%
echo %HTTPS_PROXY%# Verbose Gradle output
gradlew build --info --stacktrace
# Debug SSL issues
gradlew build -Djavax.net.debug=ssl:handshake:verbose- Build project from home network
- Commit built artifacts
- Use in corporate environment
- Temporarily use mobile hotspot
- Download dependencies
- Switch back to corporate network
- Build once with internet access
- Use
--offlineflag for subsequent builds - Gradle will use cached dependencies
- Use Docker with pre-configured Gradle
- Build inside container with network access
- Mount project directory
- IT Help Desk: [Your company's IT contact]
- Development Tools Team: [Your DevOps/Tools team]
- Network Security: [Your security team]
- Gradle Forums: https://discuss.gradle.org/
- Stack Overflow: https://stackoverflow.com/questions/tagged/gradle
- Gradle Documentation: https://docs.gradle.org/current/userguide/userguide.html
Important: The SSL bypass configurations in this template are for development only.
For production environments:
- Always use proper certificate validation
- Never commit passwords to version control
- Use secure credential storage (environment variables, credential managers)
- Remove temporary SSL bypass flags
You'll know everything is working when:
-
gradlew buildcompletes without errors -
gradlew testruns successfully -
gradlew runexecutes the sample application - No SSL or proxy error messages appear
Once these work, you're ready to develop with the Gradle template! 🎉