有一些用户在编译publiccms时,遇到从中央库查找publiccms-core依赖找不到

甚至怀疑产品源码没有全部开放,其实这些依赖的源码已经在你本地了,只不过他们没有发布到你本地仓库,也没发布到中央库

[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.publiccms:publiccms >-----------------------
[INFO] Building publiccms V4.0.202004.b
[INFO] --------------------------------[ war ]---------------------------------
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-core/V4.0.202004.b/publiccms-core-V4.0.202004.b.pom
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-core/V4.0.202004.b/publiccms-core-V4.0.202004.b.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-core/V4.0.202004.b/publiccms-core-V4.0.202004.b.pom
[WARNING] The POM for com.publiccms:publiccms-core:jar:V4.0.202004.b is missing, no dependency information available
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-oauth/V4.0.202004.b/publiccms-oauth-V4.0.202004.b.pom
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-oauth/V4.0.202004.b/publiccms-oauth-V4.0.202004.b.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-oauth/V4.0.202004.b/publiccms-oauth-V4.0.202004.b.pom
[WARNING] The POM for com.publiccms:publiccms-oauth:jar:V4.0.202004.b is missing, no dependency information available
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-redis/V4.0.202004.b/publiccms-redis-V4.0.202004.b.pom
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-redis/V4.0.202004.b/publiccms-redis-V4.0.202004.b.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-redis/V4.0.202004.b/publiccms-redis-V4.0.202004.b.pom
[WARNING] The POM for com.publiccms:publiccms-redis:jar:V4.0.202004.b is missing, no dependency information available
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-analyzer/V4.0.202004.b/publiccms-analyzer-V4.0.202004.b.pom
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-analyzer/V4.0.202004.b/publiccms-analyzer-V4.0.202004.b.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-analyzer/V4.0.202004.b/publiccms-analyzer-V4.0.202004.b.pom
[WARNING] The POM for com.publiccms:publiccms-analyzer:jar:V4.0.202004.b is missing, no dependency information available
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-trade/V4.0.202004.b/publiccms-trade-V4.0.202004.b.pom
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-trade/V4.0.202004.b/publiccms-trade-V4.0.202004.b.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-trade/V4.0.202004.b/publiccms-trade-V4.0.202004.b.pom
[WARNING] The POM for com.publiccms:publiccms-trade:jar:V4.0.202004.b is missing, no dependency information available
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-core/V4.0.202004.b/publiccms-core-V4.0.202004.b.jar
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-analyzer/V4.0.202004.b/publiccms-analyzer-V4.0.202004.b.jar
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-trade/V4.0.202004.b/publiccms-trade-V4.0.202004.b.jar
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-redis/V4.0.202004.b/publiccms-redis-V4.0.202004.b.jar
[INFO] Downloading from : https://maven.aliyun.com/nexus/content/repositories/central/com/publiccms/publiccms-oauth/V4.0.202004.b/publiccms-oauth-V4.0.202004.b.jar
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-core/V4.0.202004.b/publiccms-core-V4.0.202004.b.jar
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-redis/V4.0.202004.b/publiccms-redis-V4.0.202004.b.jar
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-analyzer/V4.0.202004.b/publiccms-analyzer-V4.0.202004.b.jar
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-oauth/V4.0.202004.b/publiccms-oauth-V4.0.202004.b.jar
[INFO] Downloading from : https://jcenter.bintray.com/com/publiccms/publiccms-trade/V4.0.202004.b/publiccms-trade-V4.0.202004.b.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-core/V4.0.202004.b/publiccms-core-V4.0.202004.b.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-analyzer/V4.0.202004.b/publiccms-analyzer-V4.0.202004.b.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-redis/V4.0.202004.b/publiccms-redis-V4.0.202004.b.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-oauth/V4.0.202004.b/publiccms-oauth-V4.0.202004.b.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/publiccms/publiccms-trade/V4.0.202004.b/publiccms-trade-V4.0.202004.b.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10:52 min
[INFO] Finished at: 2020-05-27T20:39:56+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project publiccms: Could not resolve dependencies for project com.publiccms:publiccms:war:V4.0.202004.b: The following artifacts could not be resolved: com.publiccms:publiccms-core:jar:V4.0.202004.b, com.publiccms:publiccms-oauth:jar:V4.0.202004.b, com.publiccms:publiccms-redis:jar:V4.0.202004.b, com.publiccms:publiccms-analyzer:jar:V4.0.202004.b, com.publiccms:publiccms-trade:jar:V4.0.202004.b: Could not find artifact com.publiccms:publiccms-core:jar:V4.0.202004.b in nexus-aliyun (https://maven.aliyun.com/nexus/content/repositories/central/) -> [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

publiccms作为publiccms-parent的一个子模块,编译时依赖其他几个模块,如果其他子模块不经常变更可以安装到本地库,在每个子模块执行install就好了

不过这并不是最正确的姿势,最好的方式应该是在publiccms-parent上执行clean package,这时所有子模块会依次编译打包

package命令比install的好处是它只打包,不部署到本地库,这样能避免某些时候在publiccms上直接打包使用的不是最新代码,而是从本地库拿到的以前的包,从而导致源码和实际运行程序不一致的情况

image.png

0条评论
发表评论