Gradle + JRebel + rebel-remote.xml without JRebel IDE Plugin - intellij-idea

Can you use standalone + JRebel remote?
I have my IDE on Box A
I have my App on Box B
I want to be able to make gradle build on Box A and automatically have B hot deploy that.
If Possible I'd like all this needs to work without The intelliJ plugin because it's broken and produces the wrong paths to lib locations in our complex gradle project.

No.
Synchronization with remote servers can only done via JRebel IDE plugin.
If you have any troubles with the IDE plugin or the Gradle plugin, please contact support at support#zeroturnaround.com

It's not possible to use JRebel remoting without the IDE plugin as the remote server does licensing checks during a sync transaction and classes simply copied to the remote .cache folder will be rejected otherwise.
However you can still setup a manual remoting setup. For example you can create a "virtual" workspace on BoxB where classes/jars/wars are copied after the build. In this scenario disable the remoting plugin and use standard rebel.xml-s which map to the workspace on BoxB.
When doing changes, simply copy the files from BoxA to BoxB e.g. using rsync and they will be reloaded as usual. However note that in this setup you must provide the server on BoxB with a valid license.

Related

How to enable JRebel with gradle and tomcat plugin for IntelliJ

I have a IntelliJ Community Edition with Gradle 4.3.1 and com.bmuschko.tomcat plugin running. My application will be deployed currently and its working, now I want to enable JRebel for this. So that changes on my webapp folder will be hot-deployed.
At the plugin site is a description for this
Edit your Gradle startup script and add the following line to it to
tell Gradle to use the JRebel agent. Please make sure to set the
environment variable REBEL_HOME that points to your JRebel
installation directory.
JAVA_OPTS="-javaagent:$REBEL_HOME/jrebel.jar $JAVA_OPTS"
Currenty its not clear for me where do I need to change this? Obiously JRebel is not active when I start my tomcat with the pluging.
What I did:
installed the jrebel plugin in intellij
enabled the jrebel functionality with the ide
manually added a rebel.xml file (as described on the plugin site) in the build/classes/main folder
Where do I need to edit the gradle start up so that jrebel is active for gradle builds?
There are two ways you can run gradle that will affect how to add the arguments, with the daemon and without.
If you run gradle tomcatRun --no-daemon the arguments for JRebel must be added via JAVA_OPTS or GRADLE_OPTS environment variables. So this means either running as GRADLE_OPTS=-agentpath:/path/to/jrebel/lib/libjrebel64.so gradle tomcatRun --no-daemon or specifying the variable in a script(gradlew if you are using it). If you run the gradle task directly from IntelliJ, you can specify environment variables there.
If you run with the daemon, the GRADLE_OPTS variable will set JVM arguments for the launcher process, not the daemon. This will mean that JRebel is included in the wrong process and your changes aren't monitored. One way to set JVM arguments for the daemon is by adding the following to your gradle.properties
org.gradle.jvmargs='-agentpath:/path/to/jrebel/lib/libjrebel64.so'
Running with the daemon will mean that the JRebel banner is not displayed so don't be alarmed as the changes will still be monitored.
Also since JRebel 7.0 the folder structure was changed and the jrebel.jar located in installation root is the new core which requires additional bootstrapping provided by the included native agents in the jrebel/lib dir. It is suggested to use the corresponding native agent for your OS/arch using the agentpath argument and not the javaagent argument as in the tomcat plugin docs.

JRebel less useful in IntelliJ than Eclipse?

I just set up JRebel to use with my Spring web app in IntelliJ, and was very surprised to learn that I have to manually rebuild the project/recompile every time I want my changes to be reflected. Doesn't this defeat the whole purpose of JRebel? Is there something I'm missing here? With Eclipse it was nearly instant, make changes anywhere, save, instantly reflected in running app. With IntelliJ the process seems very clunky. Am I missing something here?
Running with JRebel in IntelliJ involves starting your application using Run > Run with JRebel and when you change your application code you have to build the project in order for IntelliJ to compile classes and update your application.
You can do this by running SHIFT + F9 or Build > Build Project
From the JRebel docs:
JRebel relies upon your IDE to do the compiling. JRebel reloads your compiled .class files and not your .java files. When you change code, JRebel pushes the changed classes and resources to the server without redeploying.
Regardless of what IDE you use, JRebel still needs the IDE to compile the classes before it can update the running application. IntelliJ is no different to Eclipse in this regard. Perhaps Eclipse was just auto building the project without you being aware of it. You can also instruct IntelliJ to auto build from Preferences > Build, Execution, Deployment > Compiler > Build project automatically.
Here's a screenshot showing that configuration setting:

Setup IntelliJ IDEA 12 with Play2 and framework sources (java)

I'm using IntelliJ IDEA 12, its Play2.0 plugin for a Java project.
Unfortunately Play 2 (2.1.4 at this time) does not ship with the sources for its dependencies, and running idea with-sources=yes only downloads the project's dependencies sources.
So far I've had to manually download the source jars and attach them whenever I needed them.
Of course I have to redo this every time the Play framework is updated.
Is there any better way, either within play, which I would prefer, or with an external solution?
Unfortunately IDEA's "Search in internet..." button usually doesn't work, most likely because it's looking on the wrong respositories. I suspect it is trying to use the Maven settings with the configured Nexus repos, but AFAIK Maven central is not in there.
It is as simple as running update-classifiers in the Play console and then regenerating the project files.
I wish this would be done automatically, but apparently it is too obvious to sbt users.

How to ensure eclipse plugin has required bundles available?

I'm just starting to develop a new eclipse plugin where I want a web application server running in Eclipse. I found a nice blog, OSGi as a Web Application Server, that describes how to do this. The author suggests creating a target environment for my bundle requirements, and some of those bundles get pulled in from the Equinox Project SDK (now called Equinox Target Components in Juno). I notice that the tutorial project runs fine when my target platform is the platform I created in the tutorial, but fails to start when it is the default platform. So, now for my question...
If I need bundles that are not part of the default, how will my plugin project get access to those bundles? Will I need to deploy them along with my plugin? How would I know if the user's eclipse does or does not already have those required bundles?
You was not much clear about what kind of application you are developing. Running a web server in an Eclipse IDE as a plugin don't make any sense to me. This kind of server application is best just running on top of Equinox.
Anyway, the right path is to create a "Product Configuration" file and add categories that contains the needed bundles (go to File/Plug-in Development/Product Configuration).
With this file you can run an instance of the product (inside the IDE) and can export it (create a zip containing all needed bundles)
And if you want to able your user to install plugin inside his IDE you must create a P2 repository (using a Target Definition File) and expose the exported directory within a Http server. You could research about Tycho to build this kind of components in a maven style.
Well, I'm not sure if re-inventing the wheel again is really sufficient.
You might take a look at Pax-Web for inspiration on how to do it, or take a look Apache Karaf as a OSGi-Container (using Pax-Web). Or even better start contributing to one of the two :-)

Has anyone been able to hotdeploy using m2eclipse on Websphere 6.1 with MyEclipse?

I've been looking around for a while how can I hotdeploy my projects when using m2eclipse plugin on MyEclipse and working with Websphere 6.1.
What I've done so far is to deploy my full application using the was6 maven plugin (http://mojo.codehaus.org/was6-maven-plugin/) but that plugin will only deploy the EAR into the Websphere.So whenever I have to change just one line of code I have to redeploy the application again. The server doesn't take the changes just by saving the modified source code or JSP file.
I am working with MyEclipse 8.5 IDE and with the original m2eclipse plugin (Not Maven4MyEclipse).
Has anyone been able to do that? And if so how?
Thanks in advance
JRebel is a commercial solution that would make your life much easier. It's cheap (like $60). I actually bought a personal license intead of waiting for my company to purchase it. There is a free 30 day trial!
JRebel will hotswap your .class files and resources. No need to maven package, just save the resource in Eclipse, and JRebel will put on the server. There a few limitations, but in my opinion, its a life save.
We have used JRebel on Jetty, and I have read it is supported on WAS.