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
Related
I am buliding small Spring Boot app - pacakged as jar file (I'm using maven plugins).
I know that there are solutions which allow me to build jar file with all desired dependecies (e.g. maven assembly plugin).
The question is what if I don't pack maven required depedencies using those solutions? Am I correct that I will always get "NoClassDefFoundError" ? So should I always pack my project with all depedencies into jar file or there is another solution to "makes thigns work"?
I am new to Maven and have a quick question. I am using the JBoss IDE and have my Maven project set up. I have several jar files in my Maven Dependencies build path that need to be updated to a newer version. I have tried adding the external jars manually, but they do not go within the Maven Dependencies library and the outdated jar remains within that library.
What is the best way to update the jars with the Maven Dependencies library?
I have created a Spring Starter data jpa project and its connecting with mysql. through STS its running fine.
i wanted to deploy it individually so i clean install the application using maven and used java jar <jarfile.jar> in command prompt.
I followed the video of java brains.
Below is the error which get
JAXB is not found.
It seems that you set the scope of the JAXB dependency to provided or built the project for an old Java Version (like Java 8) that comes with JAXB and run it with a newer Java version (like Java 10) that does not come with JAXB.
You can fix this by adding the JAXB dependency to the classpath when running the JAR or by adding the dependency to your project manually(or set the scope to compile)
We have a dependency dep which was originally compiled in Java 8. The project requiring this dependency is compiled and run with Java 6. This results ``bad major version'' error.
We have the sources available in our central repository for dep and looking for a way that the sources are downloaded in build.gradle:
compile('dep_group:dep_artifact:version:sources')
and then recompile in JDK 6 to produce the required jar file.
Is it possible? Or any suggestions?
Alternatively, we have to download the code of dep offline, recompile with JDK 6, publish the jar file and finally add it as a dependency. But we are looking to avoid this long route. This is just for testing purposes and we do not want to publish a new version compiled with an older version of Java.
Without original build file (POM / build.gradle / ant.xml) you cannot recompile library. If it is a rather simple library - possible option is to include its sources as additional module in multi-module Gradle project:
Download sources
Create folder for them in your project
Create additional module as described in Gradle docs: https://docs.gradle.org/current/userguide/multi_project_builds.html
Apply java plugin for module
Set dependency on this project in format: compile(project(':dep'))
Finally, when you build your project Gradle will compile this module and use it as dependency for your main module.
Do not forget to check library license, e.g. Apache License 2 permits such a simple usage of sources.
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