[GRADLE-2941] Start gradle.bat from an UNC path in windows Created: 31/Oct/13  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Task
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 3


 Description   

Hi, all,

When I start gradle.bat in windows using a UNC path, there is an error as below:
> $ \\UNCPath\gradle.bat --help
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.(File.java:368)
at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:41)
at org.gradle.api.internal.classpath.EffectiveClassPath.(EffectiveClassPath.java:32)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:61)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)

It does works well when I access it from a mapped driver.

The problem is we put gradle.bat on a shared network location and we don't expect users to always do a subst themselves first. is there a way to make gradle work under a UNC path?

Thanks.



 Comments   
Comment by Luke Daley [ 01/Nov/13 ]

We are getting a few reports of this:

We should consider prioritising.

Comment by Endre Stølsvik [ 04/Nov/13 ]

I just got this inside Eclipse when my Windows machine had rebooted during the weekend. Started up Eclipse, get this in a "problem dialog".

Problem Occured
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.8/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
java.lang.IllegalArgumentException: URI has an authority component
	at java.io.File.<init>(File.java:397)
	at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:41)
	at org.gradle.api.internal.classpath.EffectiveClassPath.<init>(EffectiveClassPath.java:32)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:61)
	at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:55)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
	at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)

Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.8-bin.zip'.

"Solved" it by not using the grade-wrapper solution in Eclipse, instead pointing both the "Gradle distribution" and "Gradle User Home (.gradle folder location)" to a local installation and a local directory respectively.

AND, Update: I can apparently still use the gradle-wrapper distribution, but having the .gradle folder on a local drive.

PS: How do I "globally" change the Gradle home direction (the location of the .gradle folder itself). This because my Windows user home is set to be a mounted network disk). I do not want to use a command line argument every time I start Gradle!

Comment by Iain [ 20/May/14 ]

Just had the following error when trying to import a Gradle project in Intellij IDEA 13 with "Use default gradle wrapper" setting enabled.

URI has an authority component
at java.io.File.<init>(File.java:397)
at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:41)
at org.gradle.api.internal.classpath.EffectiveClassPath.<init>(EffectiveClassPath.java:32)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:61)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)

Consult IDE log for more details (Help | Show Log)

The problem is due to the "service directory path" being a UNC path. Unfortunately, this is the enterprise solution for backing up user directories in my organisation. I can get around this issue by using the "Use local gradle distribution" option when importing a Gradle project but this is not ideal.

Comment by Michael Meyers [ 14/Jul/14 ]

I have this issue as well. From the command line I can change my user home directory and make the wrapper work, but in IntelliJ, I can't figure out a way to override my user home to a local directory.

Comment by Endre Stølsvik [ 14/Jul/14 ]

(Note: I am not an IntelliJ user)
Unless IntelliJ doesn't honor standard Java system variables, you can override it with -Duser.home=tralala on the command line that starts IntelliJ. Here's a StackOverflow answer that explains it nicely: http://stackoverflow.com/a/1501261/39334

Comment by Michael Meyers [ 14/Jul/14 ]

I tried adding it to IntelliJ's "idea.properties" file and that didn't do anything. I'll see if I can find somewhere else to add the user home variable.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:35:33 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.