简体   繁体   English

如何在Spring MVC中将另一个项目添加为依赖项

[英]How to add another project as dependency in Spring MVC

I am working on Spring MVC 3.1 project. 我正在从事Spring MVC 3.1项目。 We have two project (both projects are in same workspace): 我们有两个项目(两个项目都在同一个工作空间中):

  1. Core_Project - contains all the model and DB services etc. Core_Project-包含所有模型和数据库服务等。
  2. WebApp_Project - contains controllers, views, web.xml etc. WebApp_Project-包含控制器,视图,web.xml等。

WebApp_Project need jar/maven of Core_Project so we need to build the jar of Core_project and add jar using Install or deploy an artifact to a maven repo option in STS. WebApp_Project需要的JAR /行家Core_Project所以我们需要建立Core_project的罐子,并使用添加JAR Install or deploy an artifact to a maven repo的STS选项。 Any small change in Core_Project need to repeat all this steps. Core_Project任何小更改Core_Project需要重复所有这些步骤。

I tried adding Dependency using artifact details of Core_project in this way I need not to make jar and deploy into .m2 again and again. 我尝试以这种方式使用Core_project工件详细信息添加Dependency, Core_project无需制作jar并一次又一次地部署到.m2中。

But when I run my project I got HTTP Status 404 - error page. 但是,当我运行我的项目时,我得到了HTTP Status 404 -错误页面。

Go to the location - WEB_PROJECT folder > target > yourfile.war > WEB-INF > lib. 转到以下位置-WEB_PROJECT文件夹>目标> yourfile.war> WEB-INF> lib。 Lib folder should contain your jar file. Lib文件夹应包含您的jar文件。

If your file is present there, your dependency is added to your WEB project. 如果您的文件在那里,则您的依赖项将添加到您的WEB项目中。 Then you will need to check your web project for 404 error. 然后,您需要检查您的Web项目是否存在404错误。

If your jar file is not present in lib project, something is going wrong with your method of adding dependency. 如果lib项目中没有jar文件,则添加依赖项的方法出了点问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将Spring MVC依赖项添加到Maven项目 - Unable to add Spring MVC dependency to Maven Project 如何在另一个Spring启动项目中添加本地spring启动项目作为依赖项 - How to add local spring boot project as a dependency in another spring boot project 如何在 spring mvc URL 中的项目名称之前添加另一个名称 - how to add another name before project name in spring mvc URL 将 spring boot maven 项目作为依赖添加到另一个项目(本地) - Add spring boot maven project as dependency to another project (locally) 如何在另一个项目中添加基于弹簧的项目作为 Maven 依赖项? - How can I add a spring-based project as a Maven dependency in another project? 如何将maven项目作为依赖项添加到另一个项目中 - How to add a maven project as a dependency to another one Gradle、Kotlin:如何在 intellij 中添加另一个 Spring Boot 项目作为模块依赖项 - Gradle, Kotlin : How to add another spring boot project as a module dependency in intellij 如何将CSS和JS添加到Spring MVC项目 - How to add CSS and JS to Spring mvc project 如何将项目作为JAR添加为另一个项目的依赖项? (摇篮) - How do I add a project as JAR as a dependency of another project? (Gradle) 将另一个Spring MVC项目添加为依赖项后,Spring Boot无法找到适当的URL映射 - Spring boot can't find the appropriate URL mapping after adding another spring MVC project as a dependency
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM