peholmst / vaadin4spring

Vaadin integration for Spring and Spring Boot
Apache License 2.0
266 stars 131 forks source link

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

Open rpomeroy opened 10 years ago

rpomeroy commented 10 years ago

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 commented 10 years ago

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 :-)

peholmst commented 10 years ago

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. :-)

toplac commented 10 years ago

Hello, maybe this can help you:

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

Although some features are still missing.

peholmst commented 10 years ago

Thanks!

peholmst commented 10 years ago

Sure, go ahead! :-)

Sent from Samsung Mobile

-------- Original message -------- From: Chris Phillipson notifications@github.com Date:
To: peholmst/vaadin4spring vaadin4spring@noreply.github.com Cc: Petter Holmström petter.holmstrom@abo.fi 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.

christoph-frick commented 10 years ago

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

fastnsilver commented 10 years ago

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

christoph-frick commented 10 years ago

@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 :)

FearlessHyena commented 9 years ago

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

christoph-frick commented 9 years ago

@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'
    }
}
FearlessHyena commented 9 years ago

@christoph-frick ah I see thanks for the info

ssindelar commented 9 years ago

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" }
}
christoph-frick commented 9 years ago

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.

ssindelar commented 9 years ago

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.