0

Note: I am talking about a Java application, specifically, focusing on Apache Axis libraries.

Can compile dependency version and runtime dependency version be different ?

Let's say, you are developing an application. And this application uses some 3rd party libraries. In my case, using Apache Axis libraries. When a 3rd party library says: compile dependency requires NewVersion of a jar. Can I deduce that, even at runtime, my application server should provide versionA of the same jar?

Can I deduce that, since, at compile time, NewVersion is being used, my application code should be modified as per that version? (so, I cannot assume that, magically, my application will still work, if OldVersion of the same jar is deployed by application server ).

If someone is interested, have a look at this page from Apache Synapse - https://synapse.apache.org/dependency-management.html

It says that, it requires Apache Axis2 with version 1.7.7 for many of the jars. Now, our application is written assuming 1.6.2. So, should I go ahead and update my code , as per 1.7.7, since the basic premise is that upgrading to Apache Synapse 3.0.1, brings the entire family stack of Apache Axis2 also?

  1. Is it possible, in theory/practice, to compile our application with 3rd party library of versionA and run our application with the same 3rd party library of versionB ?
mck
  • 40,932
  • 13
  • 35
  • 50
a3.14_Infinity
  • 5,653
  • 7
  • 42
  • 66
  • 1
    It really quite unclear what you're asking: a.) "is it possible in theory to compile against a different version than is used at runtime?" b.) "does a given build system support this?" c.) "does this work with these specific axis2 versions?" or d.) something else entirely. – Joachim Sauer Sep 28 '20 at 12:25
  • 1
    Additionally: if one of your dependencies requires 1.7.7, why don't you just switch to 1.7.7 (for both compile time and runtime) and see if everything still works? – Joachim Sauer Sep 28 '20 at 12:26
  • thank you @JoachimSauer, will make it more clear – a3.14_Infinity Sep 28 '20 at 13:14

0 Answers0