java - Keeping Project JAR Files Up To Date -


when using multiple apis in single project, jar files required each api added project in addition other needed libraries such apache commons, logging, etc. used project. results in large number of jar files.

when api or library no longer used, nice remove jar files associated it. however, there risk api or library requires it. not become apparent during building of project. sometimes, jars missing throw errors @ runtime.

i have following questions:

  1. what best way deal issue? in other words, able remove jars without running risk of runtime errors later?
  2. i have been told maven solves problem. it? work if external apis used not maven-based? able remove jars without worrying runtime errors? need rewrite entire project based on maven?
  3. how non-jvm platforms deal issue of shared libraries , removing them? java lacking in area or common issue platforms?

yes agree maven in case. in maven compile & runtime dependencies each artifact (jar/war/ear/etc) declared on pom.xml file. if multiple dependencies depends on same artifacts latest version used -- example:

a-1.0.jar -- depends on --> c-2.0.jar b-1.0.jar -- depends on --> c-2.1.jar 

only c-2.1.jar is included in project.

if required dependency couldn't found / taken out, maven build automatically fail. avoid runtime dependency missing, can declare dependency in runtime scope particular artifact -- , when no longer need take out


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -