[GRADLE-2897] Eclipse not handling absolute URL file in gradle.build when used to specify dependency. Created: 25/Sep/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: 1


 Description   

Absolute Windows file URL not handled correctly.

I have this URL, which is recognized by Internet Explorer -> file:///C:/svnRepo/trunk/tmp-workdir-quantcommons/quantcommons-20130925110051.jar

Then when I used it for a dependency in build.gradle using -> files('file:///C:/svnRepo/trunk/tmp-workdir-quantcommons/quantcommons-20130925110051.jar')

I get the following error in the Eclipse Problems tab -> The container 'Gradle Dependencies' references non existing library 'C:\svnRepo\trunk\ReferenceData\svnRepo\trunk\tmp-workdir-quantcommons\quantcommons-20130925110051.jar'

I uses Gradle 1.7, the problem happen only when doing the build in Eclipse and work fine in command line. I use latest STS release, based on Kepler Eclipse.



 Comments   
Comment by Gradle Forums [ 25/Sep/13 ]

The `files` method only accepts (relative or absolute) file paths, but not file URLs.

Comment by Gradle Forums [ 25/Sep/13 ]

Fair enough. So it works by accident in the command line and it's understood that Eclipse could fail (and do fail).

But, if I do the following I get the same exact behavior -> files(file('file:///C:/svnRepo/trunk/tmp-workdir-quantcommons/quantcommons-20130925110051.jar'))

Then I can see from [1]http://www.gradle.org/docs/current/us... an example passing "file" in "files" ->
FileCollection collection = files('src/file1.txt', new File('src/file2.txt'), ['src/file3.txt', 'src/file4.txt'])

Also from same URL we can read -> The file() method also understands URLs, such as file:/some/path.xml.

Well, the all thing is not clear at all. I know you guys are executing the examples in the documentation, so it will be appreciated you add to the examples how to specify an absolute Windows path in a dependency.
----------------------------------------------------------------------------------------
[1] http://www.gradle.org/docs/current/userguide/working_with_files.html

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:34:24 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.