New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classpath too long exception #188

Closed
jvmlet opened this Issue Jun 16, 2015 · 8 comments

Comments

3 participants
@jvmlet
Copy link

jvmlet commented Jun 16, 2015

Hello
I have issue with generateWidgetset task in project with very loooong dependency list.
The task fails with "classpath too long" exception.
Would you please filter the jars in the class path to accept only those with Vaadin-Widgetsets attribute in MANIFEST.MF while building the classpath for com.google.gwt.dev.Compiler?
Thanks

@johndevs

This comment has been minimized.

Copy link
Owner

johndevs commented Jun 16, 2015

Limiting the classpath to only the jars with the Vaadin-Widgetsets attribute is unfortunately not possible as many times you may want to use other GWT dependencies than Vaadin addons.

Have you tried using the single jar classpath approach by setting vaadin.plugin.useClassPathJar = true?

@christoph-frick

This comment has been minimized.

Copy link
Contributor

christoph-frick commented Jun 16, 2015

@johndevs since this arises once in a while: what are the downsides of useClassPathJar? would it make a good default?

@jvmlet

This comment has been minimized.

Copy link

jvmlet commented Jun 16, 2015

Yes, I tried to set useClassPathJar to true, but then the gwt Compiler fails with Illegal argument exception- it does't like some class from the dependency list

@christoph-frick

This comment has been minimized.

Copy link
Contributor

christoph-frick commented Jun 16, 2015

@jvmlet can you track them down in the dependecies (configuration vaadin-client)? if so you could exclude them for this configuration.

@jvmlet

This comment has been minimized.

Copy link

jvmlet commented Jun 17, 2015

I ended up with 2 source sets

sourceSets {
    main {
        java {
            srcDirs = ['src/dummy/java']
        }
    }
    dummy {
        java {
            srcDirs = ['src/main/java']
        }
        compileClasspath += [project.configurations.providedCompile]
    }
}
dependencies {
  dummyCompile(group: 'org.springframework', name: 'spring-context', version: spring_version)
  compile 'vaadin.addons.someAddon'
}

dummy source set substitutes the main source and all java source dependencies go to dummyCompile configuration. As compileWidgetset task grabs only main source set classpath - it sees only jars with vaadin addons.
Then I tweaked the compileJava and war tasks to compile and include dummy source set with dependencies to WEB-INF/classes.
Hope this helps others to overcome this issue.

@christoph-frick

This comment has been minimized.

Copy link
Contributor

christoph-frick commented Jun 17, 2015

@johndevs

This comment has been minimized.

Copy link
Owner

johndevs commented Jun 26, 2015

@christoph-frick The downsides/upsides of using the classpath jar approach is pretty nicely described here. The Maven Surefire plugin set it as a default a while ago and I think it would work for the Vaadin plugin as well. I think we could set it as default in the upcoming 0.10.0.

@johndevs

This comment has been minimized.

Copy link
Owner

johndevs commented Jul 15, 2015

Classpath jar is used as default on windows in 0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment