Java Dependencies during Development and Deployment

I have a general question on how to properly manage your jQuery compilation and deployment dependencies. I usually install dev directories as shown below for a simple library / application.

Calculator
   src
   test
   build
   lib

There are many ways to do this, but this is my typical layout for general projects. My question revolves around the lib directory. I usually install jars that my project depends on the lib directory (log4j, etc.). So during compilation, I can set various paths like lib \ log4j.jar or something like that. Now that we are creating a distribution package, I have tended to reflect this layout.

dist
   Calculator.jar
   lib
      log4j.jar
      addition.jar
      subtraction.jar

script, , (Calculator.jar ). , , , , .

, , - , .

, , , Calculator . , :

dist
   ScentificCalculator.jar
   lib
      Calculator.jar
      lib 
         Log4j.jar
         addition.jar
         subtraction.jar

, - :

SuperWhizBangCalculator.jar
lib
   ScientificCalculator.jar
   lib 
      Calculator.jar
      lib
         log4j.jar
         addition.jar
         subtraction.jar

- :

SuperWhizBangCalculator
   lib
      ScientificCalculator.jar
      Calculator.jar
      log4J.jar
      addition.jar
      subtraction.jar

- . , , , . , , , .

...

+3
7

. Apache Maven 2, " " .

, - Maven 2:)

, .

+1

, , , , lib-in-a-lib . jar, . , ...

, - .

, , Eclipse ... ...

+1

  • , log4j

lib . .

+1

: " Maven?"

Maven , , . Java , , Maven.

+1

- lib. , , , ( , JAR).

- . , - Maven, ANT Ivy , , - (OSGi).

+1

. A, B C, D. D , .

0

. "java -jar SuperWhizBang.jar" , . .

If you decide to have separate class loaders, then a hierarchy would be a good idea. This usually happens in OSGi setup, but it is probably too large for your solution.

0
source

Source: https://habr.com/ru/post/1734991/


All Articles