gpt4 book ai didi

java - 我应该在哪里保存我的 jar 文件以便所有项目都常用它们?

转载 作者:太空宇宙 更新时间:2023-11-04 12:49:37 25 4
gpt4 key购买 nike

I Have to deploy 40 to 50 Spring Mvc project on Linux server So every project must contains Spring jar file in its lib folder

Is there any way to keep all jar file at one one place so that all the projects could use

I have tried to placed all file in Apache-tomcat's lib folder and remove Spring's jar file from the Spring MVC's project lib folder

But after that all the url stop working and i didn't get any exception and i also compile all java files by using the

javac -cp :/path of Apache-tomcat's lib/*.jar: className.java

I didnt get any exception all filed compiled successfully

If anyone knows how can i managed these jar files then please let me know

Should i need to define the path in projects files like web.xml or meta-inf So that When the projects run it automatically find the jar at some specific place...

最佳答案

  • 当您将 Web 应用程序部署到生产服务器(在本例中为 Apache Tomcat)时,您不需要复制任何 JAR 文件来使应用程序正常工作,因为应用程序以 WAR 文件格式打包。
  • 如果您想使用许多基于 Spring 的 Web 应用程序进行开发、测试,您也不需要多次复制 JAR 文件。使用 Gradle 或 Maven 依赖管理工具。 (当使用 Gralde、Maven 等新一代构建工具时,您可能需要将遗留项目隐藏到新的项目结构中)。

关于java - 我应该在哪里保存我的 jar 文件以便所有项目都常用它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37662069/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com