Repository navigation
Open
Labels
Description
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)
Reacted by rdifrango, Michael Prankl, rcfja, Peter Van den Bosch, CloudS3n, Yevhen Tienkaiev and Steve Swinsburg
Activity
nedtwigg commentedon Apr 5, 2023
Can you copy-paste the proxy part of your
~/.m2/settings.xml? Obviously replace sensitive info withfoo, 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.xmlthrough to those clients, we might need to merge a PR into the EquoIDE project too...[-]Maven proxy settings not respected when downloading eclipse equi-ide[/-][+]Maven proxy settings not respected for Eclipse[Jdt/Cdt/Groovy] (equo-based steps)[/+]jpraet commentedon Apr 6, 2023
blacelle commentedon Apr 7, 2023
Regarding proxy configuration in
mvnplugins:rdifrango commentedon May 25, 2023
I just ran into the same thing as reported here. Please note in my case, I never had the proxy settings in my
settings.xmlas 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.0as I went back to2.33.0and it worked just fine.nedtwigg commentedon May 25, 2023
lkoe commentedon Nov 3, 2023
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.
rcfja commentedon Jan 16, 2024
We are having this issue also at my company.
[-]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)[/+]blacelle commentedon Sep 25, 2024
mvnusers can workaround the issue/configure further the proxy so it is handled by Spotless/EquoIde by:./.mvn/jvm.configfile-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"settings.xmlin<proxy>sectiongregallen commentedon Jan 24, 2025
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
CloudSen commentedon Mar 24, 2025
Please provide a custom solution for users.
Proxy solution is not applicable to all scenarios.
gregallen commentedon Mar 24, 2025
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
blacelle commentedon Mar 27, 2025
A side-issue for
Enterpriseusers with restrictive environment: some Spotless processors may rely on an executable. In the case of Biome, it is downloaded in m2 repository, which is typicallyC:\Users\someUser\.m2\repository. SomeEnterpriseenvironmenent forbids execution and random executables from random location, but requires them to be executed from a given folder, let's sayC:\Users\someUser\sandbox.One can workaround
Biomeexecution issue by switching<localRepository>C:\Users\someUser\sandbox\m2_repository</localRepository>inC:\Users\someUser\.m2\settings.xml. But it laters fails aroundP2jars as it seemsequodoes is not fully compliant aroundlocalRepository:djKianoosh commentedon May 9, 2025
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.
I've had to rollback to 6.16 in my gradle projects as suggested above:
CluelessAardvark commentedon Nov 7, 2025
my config (gradle):
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.
chore(ci): cache spotless Equo P2 data + cap step at 5 min
chore(ci): speed up Style Checks workflow (7850)