Skip to content

Maven and Gradle proxy settings not respected for Eclipse[Jdt/Cdt/Groovy] (equo-based steps) #1658

Open

Description

@jpraet

Since the upgrade from spotless-maven-plugin 2.34.0 to 2.35.0 I get a "java.net.SocketTimeoutException: Connect timed out" (see full stacktrace below).

It looks like it's not respecting the configured proxy settings in my ~/.m2/settings.xml.

When I manually specify the proxy via the -Dhttps.proxyHost and -Dhttps.proxyPort system properties, it works.

Stacktrace:

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.35.0:apply (default) on project buildtools: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:2.35.0:apply failed: java.net.SocketTimeoutException: Connect timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.35.0:apply (default) on project buildtools: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:2.35.0:apply failed: java.net.SocketTimeoutException: Connect timed out
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:347)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:195)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:2.35.0:apply failed: java.net.SocketTimeoutException: Connect timed out
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:195)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: java.net.SocketTimeoutException: Connect timed out
    at dev.equo.solstice.p2.Unchecked.wrap (Unchecked.java:25)
    at dev.equo.solstice.p2.P2Model.query (P2Model.java:133)
    at com.diffplug.spotless.extra.EquoBasedStepBuilder.get (EquoBasedStepBuilder.java:88)
    at com.diffplug.spotless.FormatterStepImpl.calculateState (FormatterStepImpl.java:58)
    at com.diffplug.spotless.LazyForwardingEquality.state (LazyForwardingEquality.java:56)
    at com.diffplug.spotless.LazyForwardingEquality.toBytes (LazyForwardingEquality.java:85)
    at com.diffplug.spotless.LazyForwardingEquality.hashCode (LazyForwardingEquality.java:102)
    at java.util.ArrayList.hashCodeRange (ArrayList.java:595)
    at java.util.ArrayList.hashCode (ArrayList.java:582)
    at com.diffplug.spotless.Formatter.hashCode (Formatter.java:276)
    at java.util.HashMap.hash (HashMap.java:338)
    at java.util.HashMap.put (HashMap.java:610)
    at com.diffplug.spotless.maven.FormattersHolder.create (FormattersHolder.java:43)
    at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:220)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:195)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.net.SocketTimeoutException: Connect timed out
    at sun.nio.ch.NioSocketImpl.timedFinishConnect (NioSocketImpl.java:546)
    at sun.nio.ch.NioSocketImpl.connect (NioSocketImpl.java:597)
    at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:327)
    at java.net.Socket.connect (Socket.java:633)
    at okhttp3.internal.platform.Platform.connectSocket (Platform.kt:128)
    at okhttp3.internal.connection.RealConnection.connectSocket (RealConnection.kt:295)
    at okhttp3.internal.connection.RealConnection.connect (RealConnection.kt:207)
    at okhttp3.internal.connection.ExchangeFinder.findConnection (ExchangeFinder.kt:226)
    at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection (ExchangeFinder.kt:106)
    at okhttp3.internal.connection.ExchangeFinder.find (ExchangeFinder.kt:74)
    at okhttp3.internal.connection.RealCall.initExchange$okhttp (RealCall.kt:255)
    at okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.kt:32)
    at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
    at okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.kt:95)
    at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
    at okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.kt:83)
    at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp (RealCall.kt:201)
    at okhttp3.internal.connection.RealCall.execute (RealCall.kt:154)
    at dev.equo.solstice.p2.P2Client.getBytes (P2Client.java:145)
    at dev.equo.solstice.p2.P2Client.getString (P2Client.java:116)
    at dev.equo.solstice.p2.P2Client$Folder.<init> (P2Client.java:209)
    at dev.equo.solstice.p2.P2Client.addUnits (P2Client.java:94)
    at dev.equo.solstice.p2.P2Session.populateFrom (P2Session.java:34)
    at dev.equo.solstice.p2.P2Model.queryRaw (P2Model.java:96)
    at dev.equo.solstice.p2.P2Model.query (P2Model.java:125)
    at com.diffplug.spotless.extra.EquoBasedStepBuilder.get (EquoBasedStepBuilder.java:88)
    at com.diffplug.spotless.FormatterStepImpl.calculateState (FormatterStepImpl.java:58)
    at com.diffplug.spotless.LazyForwardingEquality.state (LazyForwardingEquality.java:56)
    at com.diffplug.spotless.LazyForwardingEquality.toBytes (LazyForwardingEquality.java:85)
    at com.diffplug.spotless.LazyForwardingEquality.hashCode (LazyForwardingEquality.java:102)
    at java.util.ArrayList.hashCodeRange (ArrayList.java:595)
    at java.util.ArrayList.hashCode (ArrayList.java:582)
    at com.diffplug.spotless.Formatter.hashCode (Formatter.java:276)
    at java.util.HashMap.hash (HashMap.java:338)
    at java.util.HashMap.put (HashMap.java:610)
    at com.diffplug.spotless.maven.FormattersHolder.create (FormattersHolder.java:43)
    at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:220)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:195)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Activity

  1. nedtwigg commented on Apr 5, 2023

    @nedtwigg
    Member

    Can you copy-paste the proxy part of your ~/.m2/settings.xml? Obviously replace sensitive info with foo, but include enough so we can have a testcase for parser.

    Equo makes its network requests like so:

    Not sure how to pass proxy information from your settings.xml through to those clients, we might need to merge a PR into the EquoIDE project too...

  2. changed the title [-]Maven proxy settings not respected when downloading eclipse equi-ide[/-] [+]Maven proxy settings not respected for Eclipse[Jdt/Cdt/Groovy] (equo-based steps)[/+] on Apr 5, 2023
  3. jpraet commented on Apr 6, 2023

    @jpraet
    ContributorAuthor
        <proxies>
                <proxy>
                        <id>http-proxy</id>
                        <active>true</active>
                        <protocol>http</protocol>
                        <username/>
                        <password/>
                        <host>proxyapp.acme.com</host>
                        <port>8080</port>
                        <nonProxyHosts>localhost|*.acme.inet|10.*.*.*|192.168.*.*</nonProxyHosts>
                </proxy>
        </proxies>
    
  4. blacelle commented on Apr 7, 2023

    @blacelle
    Contributor

    Regarding proxy configuration in mvn plugins:

  5. rdifrango commented on May 25, 2023

    @rdifrango

    I just ran into the same thing as reported here. Please note in my case, I never had the proxy settings in my settings.xml as the plug-in is honoring my environment variables of HTTP_PROXY, HTTPS_PROXY, and NO_PROXY thus it should continue to do so.

    This seems to have been broken since 2.34.0 as I went back to 2.33.0 and it worked just fine.

  6. lkoe commented on Nov 3, 2023

    @lkoe

    Is there any update on this? This blocks us from using the latest spotless version - with additional troubles downstream.

    For instance the appears to be an issue when configuring the older spotless version for eslint/prettier with recent versions of those packages. This leads to certain files becoming corrupted during spotless-eslint/prettier.

  7. rcfja commented on Jan 16, 2024

    @rcfja

    We are having this issue also at my company.

  8. changed the title [-]Maven proxy settings not respected for Eclipse[Jdt/Cdt/Groovy] (equo-based steps)[/-] [+]Maven and Gradle proxy settings not respected for Eclipse[Jdt/Cdt/Groovy] (equo-based steps)[/+] on Aug 12, 2024
  9. blacelle commented on Sep 25, 2024

    @blacelle
    Contributor

    mvn users can workaround the issue/configure further the proxy so it is handled by Spotless/EquoIde by:

    1. Rely on a ./.mvn/jvm.config file
    2. Add -Dhttp.proxyHost=my.proxy.host -Dhttp.proxyPort=8080 -Dhttps.proxyHost=my.proxy.host -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts="localhost|127.0.0.1|10.*.*.*|*.example.com|etc"
    3. Ensure these values are consistant with those in settings.xml in <proxy> section
  10. gregallen commented on Jan 24, 2025

    @gregallen

    Note that in many corporate environments there is no proxy solution to this. All our dependencies must be downloaded via a corporate repo.

    IMHO the plugin should not silently add additional repos by default.

    See also google assured OSS for further info on the importance of this

  11. CloudSen commented on Mar 24, 2025

    @CloudSen

    Please provide a custom solution for users.
    Proxy solution is not applicable to all scenarios.

  12. gregallen commented on Mar 24, 2025

    @gregallen

    Seconded. Owing to the risk of supply chain attacks it is important that no part of the build chain be able to perform arbitrary downloads.

    Corporate build environments now commonly firewall builds to only be able to download anything from an approved repository.

    Anyone trying to build assured open source would not be able to use this plugin

  13. blacelle commented on Mar 27, 2025

    @blacelle
    Contributor

    A side-issue for Enterprise users with restrictive environment: some Spotless processors may rely on an executable. In the case of Biome, it is downloaded in m2 repository, which is typically C:\Users\someUser\.m2\repository. Some Enterprise environmenent forbids execution and random executables from random location, but requires them to be executed from a given folder, let's say C:\Users\someUser\sandbox.

    One can workaround Biome execution issue by switching <localRepository>C:\Users\someUser\sandbox\m2_repository</localRepository> in C:\Users\someUser\.m2\settings.xml. But it laters fails around P2 jars as it seems equo does is not fully compliant around localRepository:

    15:08:15,595 [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.2:apply (applySpotless) on project aggregator-
    adhoc: Execution applySpotless of goal com.diffplug.spotless:spotless-maven-plugin:2.44.2:apply failed: java.nio.file.NoSuchFileException: C:\Users\someUser\.m2\repository\d
    ev\equo\p2-data\bundle-pool\https-download.eclipse.org-eclipse-updates-4.34-R-4.34-202411201800-\com.sun.jna_5.15.0.v20240915-2000.jar 
    
  14. djKianoosh commented on May 9, 2025

    @djKianoosh

    The issue isn't just about supporting proxies. Many corporate environments run with restricted environments and tools like ZScaler, which intercept SSL traffic as a MITM and present their own certificates. Our system keychain (on mac, but similar on Windows) will have the correct CA roots. These system properties should work, but for some reason the gradle (and I'm assuming maven) plugins here don't make http connections the same way that Gradle/Maven do.

    systemProp.javax.net.ssl.trustStore=/dev/null
    systemProp.javax.net.ssl.trustStoreType=KeychainStore
    systemProp.java.security.KeyStore=KeychainStore
    ## For Windows:
    #systemProp.javax.net.ssl.trustStore=NUL
    #systemProp.javax.net.ssl.trustStoreType=Windows-ROOT
    

    I've had to rollback to 6.16 in my gradle projects as suggested above:

      dependencies {
        classpath "com.diffplug.spotless:spotless-plugin-gradle:6.16.+"
      }
    
  15. CluelessAardvark commented on Nov 7, 2025

    @CluelessAardvark

    my config (gradle):

    spotless {
      groovyGradle {
        target '*.gradle'
        greclipse().withP2Mirrors([
            "https://download.eclipse.org":"https://my.mirror/deo",
            "https://groovy.jfrog.io/artifactory/plugins-release":"https://my.mirror/gji"
        ])
      }
    }
    

    there is no proxy involved at all but there is also no connection to the internet. the mirrors seem to work - if i dont configure them, i get an exception about missing mirrors. but that doesnt really help, because now i get a SocketTimeoutException and it doesnt even say what url its trying to open.

    is there a workaround for this? if not, that would be a bummer, because it drastically reduces the usefulness of spotless in a corporate environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions