transitive dependencies (if any) will not be available, enable debug logging for more details错误

1. Problem description

I uploaded the jar to the remote warehouse, then deleted all the relevant jars in the local warehouse, refreshed the project that introduced the dependency, and asked him to download it from the remote warehouse to see if it is available. During the compilation process, the following error will be reported :

[WARNING] The POM for com.xxx:xxx-xxx:jar:1.0.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.xxx:xxx-xxx:jar:1.0.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.xxx:xxx-xxx:jar:1.0.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.xxx:xxx-xxx:jar:1.0.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

There is a problem with these jar packages. The above error is basically caused by the following two problems:
1. Network problem, which caused the jar to not be downloaded.
2. The problem of dependency transfer, which may be that the parent pom.

Two, the solution

The first one is easy to solve, delete the jar in the local warehouse and let him download it again.

In the second case, you can first print the dependency tree with the following command:

mvn -X dependency:tree>tree.txt

insert image description here
Find the problematic jar. The jars I have problems with are all in a certain project. The module structure is as follows:

root
   <modules>
        <module>a</module>
        <module>b</module>
        <module>c</module>
    </modules>

When I published it to the central warehouse, I did not publish the root project, but only the submodules under the root, so reinstalling it locally under the root project can be packaged and passed, or through the following command, only install the parent module Dependencies, do not handle submodules:

mvn install -N

But I published it to the central warehouse. It must not be installed locally, but I cannot also publish the root project, because some modules under the root are internal, so I can only delete the pom.xml of the root project. It's not a big problem. He is not allowed to manage the entire project. The pom.xml under the root module is just for packaging convenience. Only one execution can package all the modules under the project, and manually compile and publish them one by one.

Guess you like

Origin blog.csdn.net/mashangzhifu/article/details/123626968