Magnolia Demo 项目 mvn build 由于无法获取 magnolia-setproperty-maven-plugin 而失败

Posted

技术标签:

【中文标题】Magnolia Demo 项目 mvn build 由于无法获取 magnolia-setproperty-maven-plugin 而失败【英文标题】:Magnolia Demo project mvn build failed due to not able to fetch magnolia-setproperty-maven-plugin 【发布时间】:2016-04-02 02:09:33 【问题描述】:

我正在尝试构建https://documentation.magnolia-cms.com/display/DOCS/Travel+Demo+-+for+developers 中解释的演示应用程序

我遇到了以下依赖问题。

Downloading: https://repo.maven.apache.org/maven2/info/magnolia/maven/plugins/magnolia-setproperty-maven-plugin/1.2.1/magnolia-setproperty-maven-plugin-1.2.1.pom
[WARNING] The POM for info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:jar:1.2.1 is missing, no dependency information available

Downloading: https://repo.maven.apache.org/maven2/info/magnolia/maven/plugins/magnolia-setproperty-maven-plugin/1.2.1/magnolia-setproperty-maven-plugin-1.2.1.jar

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Magnolia Travel Demo (parent pom) .................. FAILURE [  2.141 s]
[INFO] Magnolia Travel Demo Module ........................ SKIPPED
[INFO] Magnolia Travel Tours Module ....................... SKIPPED
[INFO] Magnolia Demo Projects Reactor ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.366 s
[INFO] Finished at: 2016-03-28T13:02:23+13:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1 or one of its dependencies could not be resolved: Could not find artifact info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:jar:1.2.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]

请注意 Magnolia 存储库已添加,并且工件已从 Magnolia 存储库下载,这不是因为未添加 Magnolia 存储库。出于某种原因,它没有尝试从 Magnolia repo 下载,可能 mvn 尝试先从那里下载,然后由于 Magnolia repo 上的一些问题尝试 mvn public repo,有人可以帮我找出问题所在吗?

但是这个 jar 可以在 Magnolia repo 上找到,我已经下载了 jar 并手动安装,然后我收到以下错误,

[ERROR] Failed to execute goal info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1:set-property (currentDate) on project magnolia-travel-demo-parent: Execution currentDate of goal info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1:set-property failed: A required class was missing while executing info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1:set-property: org/apache/commons/lang/StringUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/software-install/repo/info/magnolia/maven/plugins/magnolia-setproperty-maven-plugin/1.2.1/magnolia-setproperty-maven-plugin-1.2.1.jar
[ERROR] urls[1] = file:/C:/software-install/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.commons.lang.StringUtils
[ERROR] -> [Help 1]

【问题讨论】:

【参考方案1】:

不是你想听,但我怀疑这确实是一个回购问题。您已经为普通工件设置了存储库,但是您缺少的是 maven 试图下载的是插件。

查看 Maven 文档,了解如何在 settings.xml 中设置插件仓库,例如here(略有不同,您想要发布而不是快照)。

另外,您可能需要查看 Magnolia Maven setup guide 底部的 Mathias 的说明

HTH, 一月

【讨论】:

是的,你是对的,我注意到我必须将存储库添加到 settings.xml 和 pom。非常感谢!不幸的是,我没有足够的声誉来标记您的答案是正确的。 很高兴它有帮助。干杯。

以上是关于Magnolia Demo 项目 mvn build 由于无法获取 magnolia-setproperty-maven-plugin 而失败的主要内容,如果未能解决你的问题,请参考以下文章

查看maven项目的依赖关系 mvn dependency:tree

如何在 Magnolia 社区版中编辑模块的 .java 源代码?

基本 Magnolia 项目无法启动

magnolia 中修改时间不更新

从官方目录开始 magnolia 的项目原型

将 JCR 节点转换为 Vaadin 项目 (Magnolia)