Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

The filename or extension is too long #92

Closed
TSergey opened this issue Mar 13, 2014 · 21 comments
Closed

The filename or extension is too long #92

TSergey opened this issue Mar 13, 2014 · 21 comments

Comments

@TSergey
Copy link

TSergey commented Mar 13, 2014

Hi.
When I try to build vaadin application with the plugin I get the following error:
Execution failed for task ':rms-ui:updateAddonStyles'.
> Cannot run program "java": CreateProcess error=206, The filename or extension is too long

Debugging plugin I see that my classpath is really long and it's longer than allowed limit in windows (32 767 characters are allowed and I have about 33400).

Is there a chance this could be fixed?

@johndevs
Copy link
Owner

Your working directory is probably so long already that every path on the classpath becomes so long that the total classpath exceeds the windows path limit. You can try working from a shorter working path (try C:/myproject for instance) and see if you get the same result. You could also check if you have unnecessary dependencies on the classpath and remove those.

Besides that there is not much that can be done by the plugin as it is a Windows OS limitation.

@dstine
Copy link

dstine commented Mar 16, 2014

We ran into the same problem with the findbugs plugin, as did other people. This was fixed via GRADLE-2167 by forking a separate process. It looks like initial implementation was this commit.

This may not immediately useful since forking a process would probably be a sizeable effort, but thought I'd at least mention it.

@johndevs
Copy link
Owner

Thanks @dstine for the suggestion, looks like it could be solved in the plugin after all.

I'm going to reopen this if anyone with wants to take a stab at solving this.

@johndevs johndevs reopened this Mar 16, 2014
@ghost
Copy link

ghost commented Mar 16, 2014

Most of file pathes in my classpath was not related to project, there were pathes to gradle artifacts.
So, for now I've fixed that changing gradle cache path setting it to root of disk. (For that I set "GRADLE_USER_HOME=C:.gradle" variable, maybe this will help to someone who will encounter the same issue)

@johndevs
Copy link
Owner

Another approach it seems would be to create a dummy jar with a manifest listing all the dependencies as done here http://stackoverflow.com/questions/201816/how-to-set-a-long-java-classpath-in-msdos-windows. This could be done on-the-fly before running the tasks that require the long classpath.

Edit: Looks like Maven's Surefire plugin also uses a booter jar for long classpaths http://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html

@ssindelar
Copy link

This problems starts to hit me too. I have an application with many larger dependencies (jasper reports, Apache Poi, ...) and up until now I could circumvent it by excluding unused parts of the dependency but it gets harder and harder now. Everytime I add a dependency I pray that I don't reach the limit again. :(

PS: this "Long Path Tool" sound very fishy and also wouldn't be a solution for this problem.

@TSergey
Copy link
Author

TSergey commented Dec 15, 2014

@ssindelar we solved this issue changing GRADLE_HOME to the root of disk instead of having it in user home dir. This operation made classpath shorter.

@ssindelar
Copy link

@TSergey Thanks thats a good idea, but i fear it only delays the problem.

@ssindelar
Copy link

With the GRADLE_HOME trick I am at around 28k now. So I have some room to breath now.

Maybe instead of building some intermediate jar it would be easier to provide a possibility to exclude some groups/modules or a simple text based filter. Most of the classpath just isn't needed for compiling the widgetset

Maybe just another gwt property, e.g:
vaadin.gwt.excludeFromClasspath = ['org.apache.lucene', 'org.springframework.boot']

After the classpath in Util.getClientCompilerClassPath is collected just filter out the entries that match the any entry in the given exclude-list.

@johndevs
Copy link
Owner

@ssindelar The filter sounds like a good idea.

@johndevs
Copy link
Owner

johndevs commented Feb 3, 2015

I recently added an option for using a classpath jar when the classpath gets too long (27613e0). It should be available through the snapshots and by setting the property vaadin.plugin.useClassPathJar = true.

Maybe it will work better for you?

@johndevs
Copy link
Owner

johndevs commented Apr 8, 2015

Closing this as vaadin.plugin.useClassPathJar = true should work.

@johndevs johndevs closed this as completed Apr 8, 2015
@peterlitvak
Copy link
Contributor

While using this option I get:

Execution failed for task ':xxx:vaadinCompileWidgetset'.
Cannot get property 'mainAttributes' on null object

any suggestions?

@kjordan2001
Copy link

Would it be possible to add this to the vaadinUpdateAddonStyles task? I'm getting a "filename or extension is too long" there too.

@johndevs
Copy link
Owner

@kjordan2001 Yes, fixed this in #208. Should work with the next maintenance release (0.10.3).

@christoph-frick
Copy link
Contributor

christoph-frick commented Aug 15, 2016

@Samantha258 do you plan to create new github users every week now to report back here? assuming, that you are an employee or do the "marketing" for that tool, it must be pretty pish, if that's your attempt in selling it...

@christoph-frick
Copy link
Contributor

Oh great, the marketing department is back from summer vacation. What viral surprise strategy will it take this time? The last one found it's early end by GH deleting that user...

@ahoehma
Copy link

ahoehma commented Oct 7, 2016

Hello, we run into the same problem but with the maven plugin for vaadin :( https://vaadin.com/forum#!/thread/14201472

@christoph-frick
Copy link
Contributor

@wrightsanches1 reported you again. Long Path pleeps are the worst...

Repository owner deleted a comment from frederik12345 Aug 3, 2017
@christoph-frick
Copy link
Contributor

@PeterCooks2 reported

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

14 participants