I have projects that need to be built using a specific version of the JDK.
The problem is not in the source and target parameters, but in the banks of the runtime used at compile time. In some cases, I get a compilation error if I try to compile with the wrong JDK, but sometimes the build is successful, and I get runtime errors when using banners.
For example, in eclipse, I have the ability to set the runtime for a project in a .classpath file.
Is there a way to handle this situation in maven?
What I would like to have is the ability to handle the JRE dependency, like the other project dependencies in the POM file.
UPDATE:
The decision I made was the best when I asked this question, so I wonβt change it. Meanwhile, a new solution to such problems was introduced: the Maven Toolchain . Follow the link for more information.
java maven-2 dependencies
Andrea Polci
source share