vaadin4spring icon indicating copy to clipboard operation
vaadin4spring copied to clipboard

Gradle-based build (spring-boot-sample) needed

Open rpomeroy opened this issue 11 years ago • 14 comments

Try as I may @ https://github.com/Muhuru-Bay-Microgrid/muhuru-bay-dashboard/tree/ron-spring-vaading-switch I cannot seem to get the widget sets to build an load.

It would be HUGELY helpful to see this exact same project (specifically the Spring Boot example) working with a Gradle-based build.

Be gentle :-) I'm new (but committed to learning) Gradle, Vaadin, Spring-boot. I'm happy to do some of the work if someone can provide some hints.

Regards

Ron

rpomeroy avatar May 03 '14 22:05 rpomeroy

I got a gradle build working (gradle widgetset bootRun) does the trick with some added config. I merged it to master at project above. Being new to Gradle I suspect it's not an "exemplar" build. I'd still like to see how a "pro" would do it :-)

rpomeroy avatar May 04 '14 18:05 rpomeroy

Hello! I'm a Gradle noob myself, so I can't really help you right now. But a Gradle example will be created in the future, don't worry. :-)

peholmst avatar May 08 '14 09:05 peholmst

Hello, maybe this can help you:

https://github.com/knacht-net/spring-boot-vaadin-bootstrap

Although some features are still missing.

toplac avatar Aug 19 '14 12:08 toplac

Thanks!

peholmst avatar Aug 19 '14 12:08 peholmst

Sure, go ahead! :-)

Sent from Samsung Mobile

-------- Original message -------- From: Chris Phillipson [email protected] Date:
To: peholmst/vaadin4spring [email protected] Cc: Petter Holmström [email protected] Subject: Re: [vaadin4spring] Gradle-based build (spring-boot-sample) needed (#46)

Petter, I can take this one on. I can update the mvp-sample to include a Gradle build option.

— Reply to this email directly or view it on GitHub.

peholmst avatar Aug 27 '14 18:08 peholmst

I put together my own "starter" for projects some time ago. I reference it here as food for thoughts: https://github.com/christoph-frick/springboot-groovy-vaadin-starter/blob/master/build.gradle

christoph-frick avatar Sep 26 '14 08:09 christoph-frick

@christoph it seems this build packages project as a .jar. is it rather simple to change to .war packaging?

fastnsilver avatar Sep 28 '14 15:09 fastnsilver

@fastnsilver The gradle-vaadin-plugin packages war by default and spring-boot allows it too. A gradle war produces something, that is not totally far off (still runs as java -jar the.war), but simply putting it in a jetty instance fails with a missing web.xml (I have not yet deployed spring-boot as war, so i can not tell what would make it work adhoc). Please try for yourself :)

christoph-frick avatar Sep 29 '14 07:09 christoph-frick

This would be great specially if there's an example of how to do it as a war as well. I was able to put something together that worked but had some minor issues for things like the custom widget compile build step and had to switch back to maven. A way to set everything up properly with gradle would be nice

FearlessHyena avatar Nov 20 '14 15:11 FearlessHyena

@FearlessHyena if your widgetset compile run was messing up because spring-boot-web pulled in javax validation 1.1 or something similar happended you can get rid of those with an afterEvaluate (the only place i could make it work at least). i updated my starter as bitrot crept in

project.afterEvaluate {
    configurations.'vaadin-client' {
        exclude module: 'spring-boot-starter-web'
    }
}

christoph-frick avatar Nov 21 '14 14:11 christoph-frick

@christoph-frick ah I see thanks for the info

FearlessHyena avatar Nov 24 '14 16:11 FearlessHyena

The snippet from @christoph-frick didn't work for me I used the following code to force the correct versions. I had the problem that despite the afterEvaluate I still had an 1.1 version of validation-api on the classpath which caused problems in the gwt compiler.

allprojects {
    configurations.all { resolutionStrategy.force "javax.validation:validation-api:1.0.0.GA" }
    configurations.all { resolutionStrategy.force "org.hibernate:hibernate-validator:4.3.2.Final" }
}

ssindelar avatar Dec 17 '14 12:12 ssindelar

just for the records: above code is not a silver bullet for each project. you have to check with the list of gradle dependencies for the vaadin-client config, what pulls in the "wrong" jars.

christoph-frick avatar Dec 17 '14 13:12 christoph-frick

validation-api 1.1.0.Final was only a dependency of spring-boot-starter-web through hibernate-validator 5.1.3. So I thought the above code would fix the problem in this constellation.

ssindelar avatar Dec 17 '14 13:12 ssindelar