Re-load groovy files from jar within WAR - spring

I have set of groovy files within JAR (rules.jar) and have added this JAR as dependency to WAR (project.war) through Maven. I have done the groovy configuration using Spring and it all works fine and it gets called.
<lang:groovy id="primaryScript" script-source="classpath:org/sample/rules/PrimaryScript.groovy" refresh-check-delay="5">
</lang:groovy>
The issue comes when I change something in Groovy file and it doesn't reflect till I re-build the jar and copy the jar within project.war's WEB-INF/lib.
I want to use the capability of Groovy re-loading and I don't want to keep the groovy within the WAR. Can anyone please help me out here.
I am using JDK 1.8, Groovy 2.4.7 and Tomcat 8 and use Netbeans.
Thanks

Related

Use of spring-boot-maven-plugin

While creating a spring boot project I define property in pom.xml as <packaging>war</packaging> with which I can create a war and thereafter deploy the war into server maybe tomcat or WAS.
But I came across a plugin named spring-boot-maven-plugin whose documentation states that it's use is to package executable jar or war archives and run an application in-place.
My query is why do we need this at all ?
If my packaging can tell me what to create and then can deploy it to run, what is the used of this plugin.
I am trying to understand a new project so wanted to be sure that every line makes sense
The maven plugin will create an "executable" archive. In the case of the war packaging, you would be able to execute your app with java -jar my-app.war. If you intend to deploy your Spring Boot application in an existing Servlet container, then this plugin is, indeed, not necessary.
The maven plugin does more things like running your app from the shell or creating build information.
Check the documentation
The Spring Boot Maven Plugin provides Spring Boot support in Apache Maven, letting you package executable jar or war archives and run an application “in-place”.
Refer this - https://www.javaguides.net/2019/02/use-of-spring-boot-maven-plugin-with.html

WildFly - Adding JARs to classpath

I am using WildFly 8.2.1.
I need to add specific JAR files to the class path. How can I do that?
Do I need to get inside the module hell?
All I need is to add a couple of extra Oracle JAR files to enable using TLS on the data source connection...
When you build your .war file, add them to the /WEB-INF/lib directory. They will be accessible on the classpath from there. In eclipse the eclipse maven plugin, m2e, will do it by reading your POM file, or of course, maven run by hand will do it.
In the POM file, have it packaged as a war
<packaging>war</packaging>
and declare your jar as a dependency.

Jar files for spring-hibernate integration

I'm working on Spring Hibernate Integration program as Ant with MySQL but I'm stuck with which jar files to add and at which location
I'm using org.springworks.orm.hibernate.*. Which specific jar file needs to be added?
You can download the jar from MVNRepository.
But as suggest by M. Deinum, you should try upgrading to Maven or Gradle.

Adding open source jars inside jdk using maven

I want to put some jaxb jars inside the jdk so that when i compile my code the classes are taken from the jdk library instead of the war library. An d i want to do it through maven .Please help

What should be in the build.gradle file to support imports of the standard groovy libraries

I had created a groovy project. It worked by itself.
After some additions I had to add a new jar of a new library into the imports.
While the whole workspace runs on Gradle, I added the appropriate Maven reference to the gradle.build file.
After running gradle cleanEclipse Eclipse the new library works OK.
But. All project references to the Groovy libraries disappeared. Foolish me, I had to put some references to them into the gradle.build, too.
The list of libraries:
groovy.util.slurpersupport
groovy.xml
org.codehaus.groovy.tools.xml
groovy.lang
But I don't know how to include them into gradle.build. I can't found them in maven repository. And even so, I have them installed in my Eclipse, and I should take these. And I can't google any help, because gradle groovy gives the results on how to call gradle from groovy, not vice versa.
Moving from plain Groovy to Gradle won't help, it is really about gradle support for calling a java library from groovy.
I have nothing against getting dependencies from Maven rep., but I don't know how to do it in my case - The problem is, that I have Eclipse 3.6. And I should use the last version of groovy for Eclipse 3.6. So, I have installed it from http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/. And I don't know what is the equivalent version in Maven - there is no info about it.
There was some error in the groovy in Eclipse installation. Now after running gradle cleanEclipse Eclipse while build.gradle has NO dependencies to groovy, almost everything runs OK, I only have to add the groovy nature to the project

Resources