简体   繁体   English

如何使用在典型的Spring应用程序中基于Spring引导构建的依赖项?

[英]How to work with a dependency that is built on Spring boot into typical spring application?

We have built a jar say ABC around Activiti with spring boot dependencies and packed as a dependency. 我们在Activiti周围建立了一个罐子,说ABC,带有Spring Boot依赖项,并打包为依赖项。 The dependencies that are added are as follows on the jar we built. 添加的依赖项在我们构建的jar上如下所示。

  1. Spring-boot-starter-tomcat Spring-boot-starter-tomcat
  2. Activiti-spring-boot-starter-basic Activiti-spring-boot-starter-basic
  3. Activiti-spring-boot-starter-rest-api Activiti-Spring-boot-starter-rest-api
  4. Activiti-spring-boot-starter-actuator Activiti-spring-boot-starter-actuator
  5. In dependency management we added the artifact spring-boot-depenencies. 在依赖管理中,我们添加了工件spring-boot-penpenencies。

When I inject this jar ABC as a dependency in to a typical spring application I run into multiple issues. 当我将这个jar ABC作为依赖项注入到典型的spring应用程序中时,我遇到了多个问题。 Is there a way that I can use this jar in typical spring application (with XML based configuration)? 有没有一种方法可以在典型的Spring应用程序(基于XML的配置)中使用此jar?

You can inject Spring boot dependenc in two ways: 您可以通过两种方式注入Spring BootDependenc:

  • By specifying it as a parent (explained here ) 通过将其指定为父级( 在此处进行说明)
  • By specifying it as another dependency using <dependencyManagement> tag (explained here ) 通过使用<dependencyManagement>标记将其指定为另一个依赖项( 在此处说明)

Once done, you can use Spring boot's classed into your application. 完成后,您可以使用Spring Boot的分类到您的应用程序中。

When I inject this dependency in to a typical spring application I run into multiple issues 当我将这种依赖关系注入典型的spring应用程序时,我遇到了多个问题

Are these issues ClassNotFound and MethodNotFound exceptions? 这些问题是ClassNotFoundMethodNotFound异常吗? If yes then you might have conflicts in different dependency versions. 如果是,那么您在不同的依赖项版本中可能会有冲突。

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

相关问题 Spring Boot应用程序作为依赖项 - Spring boot application as dependency 如何在现有 springboot 应用程序中使用 spring boot 应用程序作为依赖项 - How to use spring boot application as dependency in existing springboot application 如何在Spring Boot应用程序中正确使用ThreadPoolExecutor - How to work correctly with ThreadPoolExecutor in Spring Boot Application 如何在Spring Boot应用程序中使用多个控制器 - how to work with multiple controllers in spring boot application 如何理解 Spring Boot 应用程序已准备就绪? - How to understand that spring boot application is ready to work? 如何在STS内置服务器上重新部署Spring Boot应用程序 - How to redeploy spring boot application on STS built-in server 将spring boot应用程序添加为另一个Spring启动应用程序的依赖项 - Add spring boot application as dependency to another spring boot application 如何使用 map 的依赖注入测试 Spring 启动应用程序配置 class? - How to test Spring boot application configuration class with dependency injection of map? 如何将一个Spring Boot应用程序包含在另一个应用程序中 - How to include one Spring Boot application as a dependency in another 将Spring Boot应用程序用作gradle的依赖项 - Use a Spring Boot Application as a Dependency with gradle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM