Would JRebel work with this project setup? - jrebel

we have a project where we use Maven to deploy to Tomcat on mvn clean install. I'm fairly new to Java development and finding it difficult to continually wait for install to complete to view changes. I use IntelliJ and I think the class files are only created during mvn install in the target directory.
Is it possible to use JRebel so when I save a file in IntelliJ the compiled class updates Tomcat immediately like they show on the JRebel video?
Thanks

IntelliJ saves the file automatically for you. All you need to do is to recompile the changed classes and these will be picked up by JRebel, given you have included rebel.xml configuration file into the deployed archive.

Related

Running gauge tests from jar file

I am new to gauge testing tool .I have a maven project that consists of specs and step implementations. Mvn package phase does generate a jar file with all the required classes. However I cant figure out how i can run the gauge specs using a Main class in java, such that i can just run the jar file to run the tests. Is this possible?
Unfortunately no, Gauge binary must be installed and available to execute the specs.
As the Gauge binary is not written in java it cannot be bundled in a jar file and invoked from a Main class.
If you'd like to automatically download and use Gauge in a CI/CD environment, try something like https://github.com/maven-download-plugin/maven-download-plugin to download gauge into a convenient location as part of your mvn build itself.
More info about this here
There is a way to do this. You have to package maven and gauge inside the project directory and include them in the jar. In the main method, unzip all files, then run a shell script to export maven and gauge in the project directory to $PATH, then execute mvn gauge:execute as usual. It's a bit of a hack as it extracts everything to the directory in which the jar is located, but it works on RHEL 7 and I haven't managed to find a cleaner method.

JRebel - sync new gradle jars on classpath

Can jrebel detect a jar file has been added to maven/gradle and then automatically add it my libs folder and add it to the classpath?
For example I'm running IntelliJ and Jetty and I make a gradle change to add a new version of a jar dependency and then click "gradle refresh."
Can jrebel be set up to load that jar? Otherwise this requires a full restart which partially makes jrebel less useful.
The short answer is no.
JRebel works by reloading individual class files, but not whole JARs.
If you add a new dependency or update the version of an existing dependency then it won't get reloaded.
However, if this library you're updating or adding is your own internal library that you build yourself, then it is possible to reload the changes.
In that case you need to build a rebel.xml file into the root of that library jar and configure it to point to the build directory of the library.

Jboss Fuse and Cobertura

I have my application which runs in Jboss Fuse on Linux. I deploy my artifacts as jar files under the /deploy directory. I was planning to make use of Cobertura to get code coverage report after executing my jmeter tests. I instrumented my jars and placed under /deploy. I ran my jmeter tests.
Now I am unable to find the location where .ser file will be present.
I tried searching inside fuse directory.
Can anyone help me in getting Cobertura working with Jboss Fuse?
For most versions of Cobertura, you can add:
-Dnet.sourceforge.cobertura.datafile=<filename>.ser
to the JBoss/JVM startup parameters (e.g. run.conf) to specify explicitly the file where you want the report to be created.
Also, you need to make sure the cobertura.jar itself is present in the classpath if you haven't done so yet.

Adding Jar dependency in gradle custom plugin

Assuming all my Gradle plugin user going to have a MYAPP_HOME sys variable set in there system
in MYAPP_HOME page i have a jar at $MYAPP_HOME/lib/mylib.jar
i am writing my own plugin....
I can find the MYAPP_HOME variable is set and fine the jar exists..
How can i add this jar dependency in my custom gradle plugin... ? when user runs my plugin say compileMyplugin my custom gradle plugin need to set the $MYAPP_HOME/lib/mylib.jar jar as compiler dependent
How to do this any one help me ?
The plugin just needs to do:
project.dependencies {
compile project.files("${System.getenv("MYAPP_HOME")}/lib/mylib.jar"))
}
PS: In general, I wouldn't recommend relying on an environment variable and the availability of a Jar on the local file system. Instead, I'd publish the Jar to an artifact repository or put it under source control.

Error with cssparser-0.9.5.jar in Netbeans using richfaces/JSF

For some reason when I make minor chances to the title or anything linked to css I get the following error:
Deleting directory C:\Users...
C:\Users...\nbproject\build-impl.xml:1057: Unable to delete file
C:\Users...\build\web\WEB-INF\lib\cssparser-0.9.5.jar
BUILD FAILED (total time: 6 seconds)
Line 1057: <delete dir="${build.dir}"/>
I undid the changes but the error seems to persist.
Why would it want to delete the cssparser jar file?
What's the solution to the problem.
I am using Richfaces in JSF using Netbeans as my IDE, thanks.
By default, NetBeans does a Clean to the project, that means NetBeans will try to delete the compiled files and any libraries it has copied into the deploy directory. In Windows, NetBeans can't find the deploy dir and shows this error, specially when this dir is inside My Documents. I recommend you to change your project directory, or just performing Run or Debug, these commands will Compile, Build, Deploy and Launch your application so there won't be the Clean error.
For more info, see http://forums.netbeans.org/topic39444.html

Resources