Spring roo多模块依赖 [英] Spring roo multi-module dependencies

查看:170
本文介绍了Spring roo多模块依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始第一次玩spring roo,第一印象非常令人兴奋。目前我正在努力创建多模块项目,希望你们能帮助我。

I just started to play around with spring roo for the first time, first impression was quite exciting. Currently I'm struggling to create multi-module project hope you guys can help me out.

假设我有父POM和2个Jar项目和1个战争项目。让我们按如下方式命名。

Lets say I have parent POM and 2 Jar projects and 1 war projects. Lets name them as follows.


  1. parent(POM)

  2. 服务API(jar)

  3. 服务IMPL(jar)

  4. 网络(战争)

  1. parent (POM)
  2. Service API (jar)
  3. Service IMPL (jar)
  4. Web (war)

所有jar和war文件我需要它们安排在父项目中的同级别。因此,所有三个项目都应该有一个父母,这是主要的POM。

All jars and war file I need them to arrange at peer level inside parent project. So all three projects should have a single parent which is the main POM.

依赖性应该是 - Web取决于>>服务Impl取决于>>服务API

Dependencies should be - Web depends on >> Services Impl depends on >> Services API

我不喜欢我非常了解spring roo多模块功能如何帮助我实现这一目标。等待你的专业知识。干杯。

I don't know much about how spring roo multi-module functionality can help me to achieve this. Waiting for your expertise. cheers.

推荐答案

Spring Roo支持自1.2.0版以来的多模块Maven项目,请查看 Spring Roo - 参考文档

Spring Roo supports multi-module Maven projects since version 1.2.0, check out Spring Roo - Reference Documentation.

在命令提示符下,您只需运行:

In command prompt, you can simply run:


roo script multimodule.roo

roo script multimodule.roo

这将创建一个示例多模块项目,该项目具有以下目录结构:

This creates a sample multi-module project, which has the following directory structure:

my-project/
  pom.xml -- <packaging>pom</packaging>
  core/
    pom.xml -- <packaging>jar</packaging>
    src/
  ui/
    pom.xml -- <packaging>pom</packaging>
    mvc/
      pom.xml -- <packaging>war</packaging>
      src/

子模块mvc项目的子模块核心作为依赖关系pom.xml中。创建此示例项目后,您可以在将其附加到IDE之类的IDE之前对其进行处理并手动更改其结构。

The sub-module mvc project has sub-module core as dependency in its pom.xml. Once you create this sample project, you can work on it and manually change its structure for your purpose, before attaching it to an IDE like Eclipse.

Spring Roo还提供了一些内置命令可帮助您创建新的子模块项目并管理相互依赖性,查看参考文档中的功能和限制。

Spring Roo also provide some built-in commands help you create new sub-module project and manage inter-dependency, check out the features and limitations in reference documentation.

希望这会有所帮助。

这篇关于Spring roo多模块依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆