Run/Debug Apache Fineract using Eclipse?? - eclipse

Github guides suggest building the war and running in embedded tomcat through gradle wrapper....
This takes a lot of time to implement code changes.....I would like to run the project from Eclipse/IntelliJ and debug, hot code replacement, etc.
The wiki guides to do this are outdated, did not worked for me because there are problems in the build path, the main class cannot be found, etc.
https://github.com/MifosX-WITH-PENTAHO/incubator-fineract

Apparently, the only way to do run/debug the project is running using embedded gradle task and attaching remote debugger to it:
http://osdir.com/apache-fineract-developers/msg02767.html

Related

Why does gradle project creation take SO LONG with eclipse STS plugin?

I just installed a brand new eclipse mars and Spring Tool Suite 3.7.1. And I started with an empty workspace.
I create a gradle project as below:
But it seems to take forever to Create Gradle project.. as below:
Even I force to exit eclipse, it remains there and block the eclipse from exiting. As below:
I have to kill it with task manager.
Why is it so difficult to create a simple gradle project?
ADD 1
Just see this, it seems working.
https://www.timroes.de/2013/09/12/speed-up-gradle/
It takes a long time the first time because all the dependencies are being downloaded to local cache as part of the project setup. Just be patient it should complete eventually (unless there's something preventing gradle from accessing the internet).
The second project you create should be a lot faster as all the dependencies will already be locally cached.
If it already took too much time during the build. Then probably everything got downloaded. Just try switching off the internet during import. That worked for me...

best way to enable hot deployment on Jetty when using Gradle+Eclipse

I'm used to mvn, but I'm testing Gradle (v1.8) for a small web development project.
I've noticed that the Jetty Gradle plugin support autoscan and hot deployment, so I've enabled it. My goal is to recompile from Eclipse and get a Jetty reload the context every time I change a Controller, etc.
However, this is non working, mainly because Gradle compilation output goes to build/, however the Gradle Eclipse plugin creates a .classpath configuration that directs all the Eclipse output to /bin (even mixing test and main source folders).
Is there a way to?...
Run graddle jettyRun on a separate console.
Save a modified class on Eclipse (triggering a compilation)
See that Jetty picks up the change and reloads the context.
As per my research, I've identified three workarounds, but none of them solves the question above (I'm posting them in case you have related comments or more recommendations)
Tweak Gradle Eclipse config to direct test and main build output to the same directory that Gradle uses (using the pattern seen here). This is not recommended by some people, as it means using two different compilation systems that could interfere with each other.
Use the Gradle eclipse-wtp plugin to generate a WTP2 config, and use Eclipse's "Run AS -> Run on Server". This accomplishes the hot deployment / iterative goal and keeps both systems (IDE and Gradle) isolated. However, you need to setup the server on Eclipse.
(Not really a workaround): I've tested Spring's Eclipse build (STS) Gradle integration, however it seems that the integration is focused on the project setup, and while Gradle builds can be automatically triggered, Eclipse compilation is still redirected to bin/.
So you are interested in fine-tuning hot-deployment, right?
Please, consider using Gretty gradle plugin: https://github.com/akhikhl/gretty
It is an advanced gradle plugin for running web-apps on jetty. It does exactly what you want, regarding hot-deployment (and, possibly, even more).
Disclosure: I am author of Gretty plugin.
If you don't want to change to other plugins, here are two steps for the workaround:
add below configurations into your build.gradle:
jettyRun {
reload = "automatic"
scanIntervalSeconds = 1
}
each time after you changed java code, run the following task:
gradle compileJava
Because jetty is watching the *.class files, it will hot reload only after *.class files changed.
Refer to this link: https://discuss.gradle.org/t/hot-deploy-with-jetty-plugins-jettyrun/7416

How to configure the web container to run continuously so it will perform a hot redeploy using GRADLE jetty?

According to gradle.org :
Once started, the web container can be configured to run continuously,
scanning for changes in the project and automatically performing a hot
redeploy when necessary.
Searching around I can find a lot related to maven but the project I am working on uses gradle. I have the gradle jetty plugin installed but can not work out how to set it to hot redeploy when I have made changes to a html+thymeleaf file.
This should work:
apply plugin: "jetty"
jettyRun {
scanIntervalSeconds = 10
}
The scanIntervalSeconds and reload properties are inadvertently not listed on the JettyRun page of the Gradle Build Language Reference (fixed for Gradle 1.7), but the page links to the Groovydoc ("API Documentation" on the top), where you can find them on the superclass.
So, I've been looking for a way to hot deploy for a few days using the jetty plugin for gradle. I had no luck whatsoever with:
reload = "automatic"
scanIntervalSeconds = 1.
Jetty checks the build for any changes, whereas the changes that take place are in src. Changing jetty to watch the src folder seemed messy to me.
Instead I used the tomcat plugin for gradle.
Just follow the usage section on https://github.com/bmuschko/gradle-tomcat-plugin
Hot deployment is already configured in the plugin so just making the requisite changes to build.gradle did the trick. Hot deployment with gradle works for me now... a HUGE timesaver :)
If anyone has been able to hot deploy using jetty with gradle please share the process... until then tomcat is the way to go

GWT Post build command in Eclipse

I am starting getting used to Eclipse, but I have much more experience with Visual Studio. In Visual Studio it is possible to run auto commands after the build has finished.
Now I am creating a GWT project and several other projects at once in one solution (or workspace) in Eclipse. Some files which are compiled with the GWT project needs to be copied to another location when they have been compiled. I am currently doing this manually and would like to do it automatically. I am not doing it often, since the project works fine in debug mode (...?gwt.codesvr=localhost:9997).
But where is the location for executing a post build command for a GWT project in eclipse? Is it possible?
Just open project properties, choose 'Builders' item and click on 'New...' button.
Good question! I'm using Eclipse since about 2003, and I remember that I also wanted a functionality like that back then. However, I got so used to using ant for any serious build, that I completely forgot about it.
There is some useful ant integration in Eclipse (e.g. the ant view), and if you create your GWT project with webAppCreator you already get a few good ant targets you can build upon.
It would still be nice sometimes to have something more GUI-like to do simple multi-step builds with Eclipse. I haven't found anything like that yet, but it's absolutely possible that it exists, especially as a plugin.

How to run Eclipse launch configurations programmatically?

I'm finding it difficult to phrase this question well, as there are quite a few generic terms (run, configuration, launch, etc.). Here goes:
You can save run configurations in a .launch file. (in the Run Configuration Dialog, under the Common tab, Save as a shared file.
We check these in to SVN. The developers can pass them around, and it helps getting new devs running a working application quicker.
I'd like to check these out as part of our build and use them to programatically run the application, the tests, etc, without spinning up the whole IDE.
What would be the best way to run a .launch file outside of the UI?
Edit: I am trying to unify the tests run on the build server and the IDE. I do not
particularly want to give up integrated debugging, which would be the case with an ant script to run the tests .
This is probably more a problem for integration testing with multiple bundles, or unit testing a whole bundle, where you'd like to mock up extensions.
there is an eclipse plugin built over JUnit, called TPTP. It provides an automation client which can be used to launch the test from eclipse with no gui. maybe it helps
Ant4Eclipse may provide a good starting point on how to do this.
Unfortunately, this is limited to Java Applications and JUnit configurations; I am more interested in PDE applications and Plugin JUnit tests.
I have recently had alot of success building an Eclipse RCP app inside a Hudson CI server using Eclipse Buckminster. It took a bit of doing, but once I setup both features, made my RCP product be based on features, and added the Buckminster query files and the like, it worked. There is a Hudson/Jenkins Buckminster plugin that allowed me to have hudson build the application.
After saving the launch configurations for each test fragment, I created hudson commands to invoke them (yes one line per test fragment unfortunately), but after that I got the automated CI build that I wanted.
You could also use the shell command Eclipse uses. To get it:
Run your program in Eclipse
Go to the "Debug" view
Right-click on the process (probably the second item in the tree) and select "Properties"
Copy shell command and delete the agentlib flag to run in bash
I think you don't need to use the .launch configurations to run the tests. If you build an application using the Eclipse Build System, then you can use the AntRunner application from Eclipse to run your units tests. This doesn't start the whole IDE.
This article describes how to run the tests during your build process. With this process, you use a special "Test" Eclipse and load the plugins you want to test.
Perhaps running the configurations the way you would run your own custom run configurations would help here. It is described in this article.