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:
- No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
- Could not transfer artifact org.glassfish:javax.el:pom:3.0.1-b06-SNAPSHOT from/to jvnet-nexus-snapshots (https://maven.java.net/content/repositories/snapshots)
- Eclipse: Troubleshooting of error reports packaged with Maven
- [Solved] maven 3.5.0 combined with eclipse suggests solutions to lambda expressions are allowed only at source level 1.8 or above errors
- Maven Error: Failed to execute goal on project xxx: Could not resolve dependencies for project
- How to Solve compile error: package junit.framework does not exist
- [Solved] Maven install failed (package com.google.gson does not exist)
- Maven packaging failed invalid LOC header (bad signature)
- Maven [error] no longer supports source option 5. Please use version 7 or later
- How does IntelliJ idea use Maven Tomcat plug to run web projects