How to start a spring-mvc application with gradle on netbeans - netbeans

Hi i am trying to find out how to initialize a spring mvc application on netebans.
When you create a new gradle project on netbeans is a java project, but how can i configure it to make it a spring mvc project.
Is there any tutorial out there?
Thanks!

You are pretty much on your own. You will need to configure Gradle to build your application. I assume it means using 'war' plugin and adding various Spring MVC dependencies. NetBeans with https://github.com/kelemen/netbeans-gradle-project plugin will then be able to understand Java related part.
There is a work in progress to add support for web application development to this plugin but nothing publicly available as far as I know.

Related

Hot code deployment during development with embedded Apache Felix and Eclipse?

I am trying to embed Felix in an application of ours to handle plugins. Everything is working fine, however, development and debugging is very cumbersome.
Is there a solution where I can tell Felix to automatically reload a plugin bundle or its classes when I recompile a plugin in Eclipse?
I cannot use any OSGi specific launchers because Felix is embedded in our application
Felix' fileinstall supports directories, but expects a specific structure, which is incompatible with the layout of the Eclipse project.
Any help or pointers to a solution would be greatly appreciated.
You could take a look at Bndtools and the remote launcher. You only need to install a remote agent in your framework and then Bndtools can update any bundle that has changed in the workspace.
This is explained in remote launching. In OSGi enRoute you find an IoT tutorial that uses this model as well as a Karaf App Note.

Initial setup of a Spring project

I'm having trouble grasping the correct way of developing a Spring application. I'm following through the tutorial found here: https://spring.io/guides/gs/rest-service/
I understand from reading the instructions that Gradle will download the specified dependencies, but that's only during the build phase. During the development phase, am I supposed to manually download the JAR files and include them as libraries in my Eclipse project?
There are plugins for eclipse that will help you use gradle to develop:
http://gradle.org/tooling
Follow the link here for detailed instructions:
https://github.com/spring-projects/eclipse-integration-gradle/
There's also this. I'm not sure if they are the same plugin:
http://marketplace.eclipse.org/content/gradle-integration-eclipse-44
Manually loading the jars kind of defeats the purpose of using a dependency management tool.
If you want to use an Eclipse-based IDE, you can also use the Spring Tool Suite. It has all the required plugins to develop Spring applications with Gradle or Maven. (http://spring.io/tools/sts)

Best practice for create web project in Eclipse/STS that supports maven and spring 3+

I recently completed the SpringCore training but never got this answer. I want to know the best possible way to create Dynamic Web Project in STS/Eclipse that supports Maven and Spring 3+
Is it to use the wizard and create a Dynamic Web Project then add Maven support and Spring Behavior?
Is it to use the wizard and create a Maven project and use archetype webapp then add Spring support?
Is it to use the wizard and create a Spring project add the Java EE project facet and Maven Support?
Is it something totally different?
I choose to create first dynamic web project, then add spring behavior and finally to build the project i am using maven.. which is really a powerfull tool.

Spring installation with Eclipse

I have downloaded and installed Spring STS for Eclipse...
But when I've Created a Spring Project I can't to
import org.springframework.context.ApplicationContext;
So I tried to add library like spring.jar but I couldn't find this jar.(properties-->java build path-->libraries)
What's wrong with this setting? Or my installation is not ended?
Spring STS is only a Eclipse plugin which helps the developer managing spring beans. It is not mandatory for developing a spring-based application.
So your second approach was the right one to add the spring library. You can download spring here: Spring Downloads and then add it as a library to your project.
But serious... I would encourage you to do a tutorial first: http://www.springsource.org/tutorials
Plugins does not includes library of spring.
Plugin is only to manage the reference of configuration in your project build in eclipse.
Libraries are actual jar file which is required at compile as well as run time.
If you skip the plugin installation then your code will work if your configuration is correct
But if you skip spring library installation or download then your code will not compile of run.
Please go through step by step tutorial by following these tutorial
Spring Step By Step Tutorial

building development environment for GWT with JBoss

I am using eclipse IDE and want to build up a development environment for creating an app.
I have an EJB module on Jboss5 and would like to add a GWT project.
I could see that GWT during development is executed on it's development host mode, but the problem is that in this case I can not local EJB services deployed on my JBoss.
Is there anyway to overcome this challenge? how can I use the eclipse along with JBoss to develop, run and debug GWT application? I don't mind using ANT script in order to compile and deploy on JBoss, just need to know if this is possible (Also to debug the GWT application).
Thanks in advance.
Best regards.
There is a sample setup to use JBoss Tools with GWT and GWT Plugin. http://community.jboss.org/wiki/UseJBossToolsWithGoogleGWTPlugin
Strelok's sample page now recommends following the guidelines for creating a GWT project using a general Eclipse Web Tool Project approach.
https://community.jboss.org/wiki/CreateGWTProjectsWithJBossToolsAndEclipseWTP