构建alfresco-repository JAR遇alfresco-super-pom缺失错误,求排查
解决Alfresco Repository构建时父POM无法解析的问题
嘿,这个问题我碰到过不少次,本质是Maven找不到Alfresco专属的父POM——因为它根本不在默认的Maven中央仓库里。Alfresco把自己的核心依赖、POM都托管在官方的Nexus仓库,直接跑mvn clean install没配置这个仓库的话,肯定会报错。
下面是具体的解决步骤:
第一步:配置Alfresco官方Maven仓库
你需要修改Maven的settings.xml文件(路径一般是~/.m2/settings.xml,如果没有就新建一个),添加Alfresco的仓库配置,让Maven知道去哪里找这些专属依赖。示例配置如下:<settings> <profiles> <profile> <id>alfresco-public</id> <repositories> <repository> <id>alfresco-public</id> <url>https://artifacts.alfresco.com/nexus/content/groups/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>alfresco-public</id> <url>https://artifacts.alfresco.com/nexus/content/groups/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>alfresco-public</activeProfile> </activeProfiles> </settings>第二步:强制更新依赖并重新构建
有时候本地Maven仓库会缓存之前的失败请求,所以建议加上-U参数强制更新,再执行构建命令:mvn clean install -U额外检查:确保仓库克隆完整
偶尔也会因为仓库克隆不完整导致问题,如果你不确定,可以重新克隆一次仓库,或者执行git submodule update --init(如果项目包含子模块的话)。
简单说,README里的构建步骤默认你已经配置了Alfresco的Maven仓库,所以没特意提这一步——这是很多企业级开源项目的常见情况,他们的核心依赖不会放到公共中央仓库里。
内容的提问来源于stack exchange,提问作者Nicolas Raoul
相关产品推荐
相关产品推荐

