Open DanielFran opened 9 months ago
I'm getting a similar issue as well... any feedback? ...BTW, also with the 0.19 version however, when running in debug mode I can see this
DEBUG] -- end configuration -- [DEBUG] Determined os: LINUX_X64 [DEBUG] Downloading node from url: https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.gz [java.net.SocketTimeoutException: Connect timed out, java.net.SocketTimeoutException: Connect timed out, java.net.SocketException: Network is unreachable] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.744 s [INFO] Finished at: 2023-12-15T14:16:11+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.hubspot.maven.plugins:prettier-maven-plugin:0.19:print-args (default-cli) on project myervice: Error downloading node: Network is unreachable -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.hubspot.maven.plugins:prettier-maven-plugin:0.19:print-args (default-cli) on project my-service: Error downloading node at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) 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)
so, it tries to download node and this is not allowed, when building behind a proxy ... at least in my case
....hm, this does not work as well:
$ which node /home/dev/.nvm/versions/node/v16.13.2/bin/node
$ mvn prettier:print-args -Dprettier.nodePath=/home/dev/.nvm/versions/node/v16.13.2/bin/node
[DEBUG] Loading mojo com.hubspot.maven.plugins:prettier-maven-plugin:0.19:print-args from plugin realm ClassRealm[plugin>com.hubspot.maven.plugins:prettier-maven-plugin:0.19, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@5cb0d902]
[DEBUG] Configuring mojo execution 'com.hubspot.maven.plugins:prettier-maven-plugin:0.19:print-args:default-cli' with basic configurator -->
[DEBUG] (f) disableGenericsLinebreaks = false
[DEBUG] (f) extractPrettierToTargetDirectory = false
[DEBUG] (f) ignoreConfigFile = false
[DEBUG] (f) ignoreEditorConfig = false
[DEBUG] (f) inputGlobs = [src/main/java/**/*.java, src/test/java/**/*.java]
[DEBUG] (f) localRepository = /home/dev/.m2/repository
[DEBUG] (f) nodePath = /home/dev/.nvm/versions/node/v16.13.2/bin/node
[DEBUG] (f) nodeVersion = 16.13.2
[DEBUG] (f) prettierJavaVersion = 0.7.0
[DEBUG] (f) printWidth = 90
[DEBUG] (f) tabWidth = 4
[DEBUG] (f) useTabs = false
[DEBUG] (f) pluginDescriptor = Component Descriptor: role: 'org.apache.maven.plugin.Mojo', implementation: 'com.hubspot.maven.plugins.prettier.CheckMojo', role hint: 'com.hubspot.maven.plugins:prettier-maven-plugin:0.19:check'
role: 'org.apache.maven.plugin.Mojo', implementation: 'com.hubspot.maven.plugins.prettier.PrintArgsMojo', role hint: 'com.hubspot.maven.plugins:prettier-maven-plugin:0.19:print-args'
role: 'org.apache.maven.plugin.Mojo', implementation: 'com.hubspot.maven.plugins.prettier.WriteMojo', role hint: 'com.hubspot.maven.plugins:prettier-maven-plugin:0.19:write'
----
[DEBUG] -- end configuration --
[INFO] Using customized nodePath: /home/dev/.nvm/versions/node/v16.13.2/bin/node
[DEBUG] Determined os: LINUX_X64
[DEBUG] Downloading node from url: https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.gz
...
so, it still tries to download?
@jhaber Any feedback on this, I believe this is impacting lot of users
Hi sorry for the delay. The plugin needs both node
and npm
, so if you set a nodePath
AND an npmPath
it should avoid any downloading. I can think more about the best way to add proxy support (would supporting a literal socks/http proxy work for your use-case?)
Updating Maven plugin version from 0.19 to 0.21 introduces changes to the way the node is downloaded.
Since I am using a proxy, I get current error now:
@jhaber Can you introduce a way to manage downloads when using a proxy?
Full log detail