Maven多模块项目 - 包括通用模块作为其他模块中的编译单元

时间:2017-06-30 07:58:18

标签: maven spring-boot

我有几个maven模块:common,A,B,C。 我想知道是否可以将公共模块作为编译单元包含在其他三个模块中。

我通过使用

声明公共模块来尝试这个

<packaging>pom</packaging> 在模块A中,我将common作为依赖项包含在内:

<dependencies>
    <dependency>
        <groupId>group.id</groupId>
        <artifactId>common</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>

但是,当我这样做时

  

mvn clean compile

在整个项目中,编译模块A时会抛出一个错误:

  

无法从..

转移神器group.id:common:jar:1.0

它正在尝试从maven远程存储库下载获取公共依赖项。我不想这样做:我不想在本地或远程存储库上安装公共模块。我只想编译common并在其他模块中包含已编译的类。

有可能吗?我也在使用弹簧靴。

0 个答案:

没有答案
相关问题