Magnolia 原型无法解析 info.magnolia.ui:magnolia-ui-project:pom:5.3

Posted

技术标签:

【中文标题】Magnolia 原型无法解析 info.magnolia.ui:magnolia-ui-project:pom:5.3【英文标题】:Magnolia archetype can't resolve info.magnolia.ui:magnolia-ui-project:pom:5.3 【发布时间】:2014-07-20 15:03:24 【问题描述】:

我正在尝试使用 maven 原型通过运行来创建 Magnolia 项目:

D:\workingFolder\workspace\MagnoliaTutorial5.3\tryProjects> mvn archetype:generate -DarchetypeCatalog=http://nexus.magnolia-cms.com/content/groups/public/

然后选择

5: http://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-project-archetype(拱形 etype 创建 Magnolia 项目(父 pom 和 webapp))

并配置如下属性:

Confirm properties configuration:
groupId: com.try.projects
artifactId: tryProjects
version: 1.0-SNAPSHOT
package: com.try.projects
magnolia-version: 5.3
project-name: tryProjects

项目创建成功,但是当我运行时

mvn clean install

我遇到了以下问题:

[INFO] Error building POM (may not be this project's POM).


Project ID: info.magnolia.ui:magnolia-ui-project

Reason: POM 'info.magnolia.ui:magnolia-ui-project' not found in repository: Unable to download the artifact from any reposito
ry

  info.magnolia.ui:magnolia-ui-project:pom:5.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

 for project info.magnolia.ui:magnolia-ui-project


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: POM 'info.magnolia.ui:magnolia-ui-project' not found in repository: Unable
to download the artifact from any repository

  info.magnolia.ui:magnolia-ui-project:pom:5.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

 for project info.magnolia.ui:magnolia-ui-project
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'info.magnolia.ui:magnolia-ui-project' not found in reposit
ory: Unable to download the artifact from any repository

  info.magnolia.ui:magnolia-ui-project:pom:5.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

 for project info.magnolia.ui:magnolia-ui-project
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
        at org.apache.maven.project.DefaultMavenProjectBuilder.mergeManagedDependencies(DefaultMavenProjectBuilder.java:1456)

        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:999)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255)
        at org.apache.maven.project.DefaultMavenProjectBuilder.mergeManagedDependencies(DefaultMavenProjectBuilder.java:1456)

        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:999)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:50
8)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
        ... 12 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

  info.magnolia.ui:magnolia-ui-project:pom:5.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
        ... 25 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
        at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
        ... 27 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sun Jul 20 22:47:32 SGT 2014
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------

我尝试使用早期版本5.1.1没有出现这个问题。存储库看起来有问题,但我无法找到解决方案。 有什么理想的方法可以解决这个问题吗?

【问题讨论】:

【参考方案1】:

Magnolia 的模块位于它们自己的 maven 存储库中,因此您需要将此模块添加到您的 settings.xml

可以从.m2 存储库(通常为&lt;user-dir&gt;/.m2)中的终端执行以下命令,并将下载为 Magnolia CE 预配置的settings.xml 文件:

mvn org.sonatype.plugins:nexus-maven-plugin:1.9.2.4:settings-download -Dnexus.url=http://nexus.magnolia-cms.com -Dsettings.templateId=magnolia-community-public

您只需执行一次此步骤。之后,maven 知道 Magnolia 的 maven repo。

文档:http://documentation.magnolia-cms.com/display/DOCS/Maven+init

【讨论】:

在遇到错误之前我已经完成了这一步。但是我今天尝试重新生成setting.xml,它成功了!谢谢!【参考方案2】:

https://wiki.magnolia-cms.com/display/DEV/Maven+setup 对于 CE 用户,您需要在 .m2 文件夹中使用以下命令:

mvn org.sonatype.plugins:nexus-m2settings-maven-plugin:1.6.5:download -DnexusUrl=https://nexus.magnolia-cms.com -Dusername=anonymous -Dpassword=anonymous -DtemplateId=magnolia-community-public

【讨论】:

以上是关于Magnolia 原型无法解析 info.magnolia.ui:magnolia-ui-project:pom:5.3的主要内容,如果未能解决你的问题,请参考以下文章

基本 Magnolia 项目无法启动

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

文件无法在 Magnolia 中上传

Magnolia CMS 无法识别我的轻型模块 .jar 文件

在 Magnolia:用 MySQL 替换 H2:JackRabbit 无法实例化持久性管理器

Magnolia:启用缓存过滤器导致 Facebook 共享无法正常工作时,范围请求不提供内容