Home  >  Q&A  >  body text

java - maven 依赖问题

已经写好了一个公共的jar,xxx-common.jar

但是这个common的jar里面只是编译了,没有打进依赖

有一个程序需要用到这个jar,便加入了pom.xml

但是编译这个程序的时候发现,common里面的依赖缺少,无法完成编译。

总不能再把common的依赖复制到这个程序的pom.xml里吧

怪我咯怪我咯2743 days ago415

reply all(3)I'll reply

  • 迷茫

    迷茫2017-04-18 10:53:15

    xxx-common.jar does not contain pom.xml, right?

    This jar package must be packaged with mvn, and pom.xml must be packaged in it.

    reply
    0
  • 迷茫

    迷茫2017-04-18 10:53:15

    It is recommended to check the following places:

    1. It is recommended to use maven packaging command:

    mvn install

    2. Check whether there is an <exclusions> tag in the pom.xml of the project where you introduced xxx-common.jar, such as:

    <exclusions>
        <exclusion>
            <artifactId>slf4j-api</artifactId>
            <groupId>org.slf4j</groupId>
        </exclusion>
    </exclusions>

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 10:53:15

    Can you explain the problem in more detail? I don’t understand what your problem is

    reply
    0
  • Cancelreply