I'm trying to migrate a netbeans/ant gwt project to an eclipse/maven gwt project.
For that I used the archetype gwt-maven-archetypes, to create a maven project, and after that I copied the sources.
I had succesfully been able to run codeserver and the application itself, using maven comands, as suggested by the archetype author. I even can debug on chrome dev console.
The problem, is that I want to debug from eclipse, and it seems eclipse gwt plugin, doesn't support the current structure.
Any ideas?
Thanks
I ended up, giving up this archetype, and I'm using now simple webapp maven archetype. I figured it out, but still a little tricky on my project.
So, as #ElHoss, has suggested I'm using SDBG. Besides that, I'm not using jetty, but my own tomcat installation, so I've followed this video instructions, together with the SDBG page video's instruction.
At the end, I have 3 Running Configuration items:
The one that starts Tomcat;
The one that starts codeserver;
Chrome Launcher, as instructed on SDBG page.
If you need plus information, please comment.
Thanks.
Related
I have an application built in Spring Tool Suite and using angular as well for frontend. I am building my maven and the deploying the war in Tomcat. While the Spring dev-tools work fine for any application when it is deployed form the tomcat container within STS but not when I put the war in external Tomcat. Is there any way to hotSwap the application other than blackboxing my javascript in Chrome. Can anyone list down the complete steps to follow. I'm a noob.
I have already put a dependency sping-devtools in maven. There are many answers related to that but none of them is working. It is a big project and takes 4 minutes to build and then I need to deploy it in tomcat which is a lot of burden.
Looks like you are looking to hot reload the static files. In IntelliJ, it's simple as saving your code changes and doing a Build Project CTRL + F9. It's even better if you install a Live Reload extension for your browser so that any changes made is refreshed automatically. There are also other similar options for compile & build automatically in IntelliJ as well other IDEs such as Eclipse.
See title. I would also like the project to redeploy after every change. I am new to this area so my knowledge isnt that good. I tried googling and searching here, but I can't find any answer.
thanks for any help
There are two plugins that combined together in Eclipse work quite well together to perform what you want:
M2E: M2Eclipse which handles everything related to Maven.
Eclipse Web Tool Platform (WTP): which handles everything Java EE related (Tomcat, JBoss, etc...)
For M2E to work properly with WTP, you need to add m2e-wtp. You may find several useful information as well as some good links here.
I would start from the Eclipse Java EE distribution (it includes already Eclipse-WTP) and then add M2E (either with their update site or through eclipse market place: look for M2E and M2E-WTP).
From there, you create a Web Project and you can run it on a Tomcat server. The first time you try to run you project on a server, you will install Tomcat and it will appear in view named "Server". Double click on the server to configure ports, automatic deployment etc...
You can easily deploy a webapp using the Cargo Tomcat plugin. Here's helpful articles on this topic:
Maven Tomcat Deployment using Cargo plugin.
Autodeployment with Maven, Tomcat, and Cargo.
I am considering using Maven 3 for my Spring projects which I have been developing using Eclipse and Tomcat. Until now;
I have been disabling "Republish automatically" because sometimes I don't need publish, I only save .java files (classes) and keep development on debug mode.
I republish (by clicking Eclipse's "publish" button on Servers view) only when I changed js, jsp or htm-like files, not class files, so I can keep developing without restarting Tomcat.
Now I am going to use Maven for debug/run on development but whenever I changed my code, I don't know how to do this "publish" issues on Maven as it doesn't use Eclipse's Tomcat directly. I stop maven and start again. Do I have to do this for all changes on my code? How can I make this maven -tomcat:run- "publish/republish" for js/jsp/html files and "do nothing" for .java files?
Unfortunately, yes, you'll have to run maven for every change.
Maven't isn't really intended to be used this way - it assumes that you're going to use maven when you're ready to build (ie after development), but use something like Eclipse if you're trying to see your changes in real time. It has no mechanism for listening for changes.
For my webapps I use both maven and Eclipse, with the m2e and the 'Maven Integration for Eclipse WTP' plugins. With that setup I can see my changes in real time using an embedded Tomcat instance in Eclipse, and when I'm done, I use maven to build.
Give those two plugins a shot - I think it'll meet your needs.
I had the same problem. And it happens because I ran maven eclipse:eclipse. Then, Server stop publishing (click on publish and said it was synchronized). I downloaded again .classpath and .project and other innerit files of eclipse project structure from cvs and server starts publishing again. May be this could help.
Regards,
For the benefit of Googlers:
I was getting NoClassDefFound errors using tomcat:run to start the app.
It took some googling but the following post notes that using tomcat:run-war enables your dependencies to get picked up from the WAR:
http://www.hascode.com/2010/06/java-server-facesjsf-2-tutorial-step-1-project-setup-maven-and-the-first-facelet/
However, for debugging and hot code replace, it's simplest to run Tomcat from the Servers view in Eclipse.
Eclipse Vaadin plugin has cool autobuild feature. Just clicking "restart application" in debug console will bring up to date application version to live.
Unfortunately importing maven generated vaadin project(using m2e) and copy-pasting .project buildCommands and natures from vaadin eclipse plugin generated project does not works.
I'm unnable to "Run on server...", tomcat does not deploy app for unknown reason. I can see app in wtpapps folder but it still does not deploys.
You can build your Vaadin app as a regular Java library, by itself (not as a WAR, or anything complicated). Then do two things: Create another project that builds the actual WAR file, and create another project that sets up Jetty for direct execution (google for details on how to get Vaadin operating under Jetty standalone, using Jetty as a library). With that in place you can treat your Vaadin UI like a regular java program (fast, direct restart through the standard debug window), and still have it be a WAR file for deployment.
See this thread for details on how to set up Jetty (look for Launcher).
I have also stumbled upon this problem some time ago and eventually found this:
http://www.streamhead.com/maven-spring-vaadin-appengine/
It eventually helped me to get up and running after a scenario that has been very similar to what you have described.
I have setup Spring / WTP in eclipse as well as successfully started a Tomcat 6 server within eclipse. I'm at the point where I can create a new Spring project and add source files as necessary.
Could somebody please describe (or point me to) how I can setup of some sort of 'Hello World' test and how to run it? I have experience developing in Java SE but am trying to learn Java EE / Spring.
Start with "Spring MVC Step by Step".
I know this does not answer your question directly, but you may want to consider generating a base project using Maven and then generating an Eclipse project from that.
If you decide to go down the Maven path, the process would be:
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring-archetype -DarchetypeVersion=2.1.0-M1 -DgroupId=com.mycompany -DartifactId=myproject
Details: AppFuse
Once you run the above command, it will set up a complete maven project for you with a Spring MVC project stubbed out.
The next step is to simply run: mvn eclipse:eclipse to generate the project.
Details: Maven Eclipse Plugin
Once you get the code generated and the Eclipse project set up, you can read on the AppFuse Quickstart page how to run the application locally, how to debug it, and go from there.
If you're looking at using Spring in a Web-app, then perhaps this previous answer I wrote might help?
For building Spring apps, SpringSource provides a build of Eclipse 3.5 called SpringSource Tool Suite. It includes a bunch of plugins that you can download independently, but this comes with them pre-integrated. It also includes a lot of guides, documentation, wizards, and so on, which might be good to get you started.
You may find interesting the Spring Roo project which creates a Spring MVC based project directly on the IDE or via the command line.
You might want to see the ten minute video to see how it can get you up and running in no time and it also includes other features which can be not that easy to set up like security and internationalization.