[Solved] Could not resolve dependencies for project xxx: Could not find artifact xxx

introduction

When running a module, an error is reported if the dependency of B module cannot be found. A. B modules are all in the project.

Error message

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.totainfo.schedulingsystem:aps >------------------
[INFO] Building aps 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.totainfo.schedulingsystem.strategy:aps-strategy-schedule-wip:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.872 s
[INFO] Finished at: 2021-12-30T20:55:47+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project aps: Could not resolve dependencies for project com.totainfo.schedulingsystem:aps:jar:0.0.1-SNAPSHOT: Could not find artifact com.totainfo.schedulingsystem.strategy:aps-strategy-schedule-wip:jar:0.0.1-SNAPSHOT -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1

Cause analysis

I previously delegated the build of the code to Maven through setup.

So when I click Run, idea will not use the built-in build function to build, but use Maven to build.

When you click the run configuration, you will find that the behavior before startup is build .

Looking at the log, we can see that Maven will only build the current module, so the dependencies of other modules cannot be found.

Solution:

Modify the run configuration and build project before running.

Click Run. You can see from the log that Maven has built other modules. The problem has been solved.

Similar Posts: