Vanilla Maven 3.3.9没有找到用于开花原型生成的Magnolia目录,并带有消息:“没有定义目录。使用内部目录”

时间:2017-02-14 13:08:48

标签: maven magnolia maven-archetype

Magnolia CORE Docs for Version 5.5要求Getting started with Blossom基于他们自己catalog repository的maven原型生成。我可以看到并输入archetype-catalog.xml,因为它应该是,而且一切似乎都在那里。

但是,如果我尝试使用文档中的给定命令生成它

files=(/somedir/file1.md
       /somedir/file2.md
       /somedir/file3.md
       /somedir/file4.md)


for f in "${files[@]}"; do
    [[ -f "$f" ]] && attachments+=(-a "$f")
done

echo "Body text" | mailx -s "The files" "${attachments[@]}"

我没有得到木兰外国回购的清单,但是来自后备maven-archetype回购。

mvn archetype:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/

与教程中一样

[INFO] Scanning for projects...
[INFO]
[INFO]     ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO]     ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.0:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.0:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.0:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
`enter code here`[INFO] No catalog defined. Using internal catalog
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: internal -> org.apache.maven.archetypes:maven-archetype-archetype (An     archetype which contains a sample archetype.)
2: internal -> org.apache.maven.archetypes:maven-archetype-j2ee-simple (An archetype which contains a simplifed sample J2EE application.)
3: internal -> org.apache.maven.archetypes:maven-archetype-plugin (An archetype which contains a sample Maven plugin.)
4: internal -> org.apache.maven.archetypes:maven-archetype-plugin-site (An archetype which contains a sample Maven plugin site.
  This archetype can be layered upon an existing Maven plugin project.)
5: internal -> org.apache.maven.archetypes:maven-archetype-portlet (An archetype which contains a sample JSR-268 Portlet.)
6: internal -> org.apache.maven.archetypes:maven-archetype-profiles ()
7: internal -> org.apache.maven.archetypes:maven-archetype-quickstart (An archetype which contains a sample Maven project.)
8: internal -> org.apache.maven.archetypes:maven-archetype-site (An archetype which contains a sample Maven site which demonstrates
  some of the supported document types like APT, XDoc, and FML and demonstrates how
  to i18n your site. This archetype can be layered upon an existing Maven project.)
9: internal -> org.apache.maven.archetypes:maven-archetype-site-simple (An archetype which contains a sample Maven site.)
10: internal -> org.apache.maven.archetypes:maven-archetype-webapp (An archetype which contains a sample Maven Webapp project.)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 7:
应该提出玉兰目录中的原型而不是maven目录。

该行

1: https://nexus.magnolia-cms.com/content/groups/public/ -> info.magnolia.maven.archetypes:magnolia-theme-archetype
2: ...

另外指向错误的目录定义。

我没有改变我的maven,因为它是一个非常新的装置,并尝试了多种可能的解决方案来让它运行,就像我的一个同事原型生成一样,对于其他所有它没有。即使我们删除了当地的回购,它仍然可以继续使用。降级到maven版本也没有解决问题。

有关如何运行的任何想法?它对你有用吗?

1 个答案:

答案 0 :(得分:4)

我建议暂时使用以下内容,以便为您解决问题。

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/

原因是Apache发布了一个新版本(3.0.0)并破坏了这个功能(ARCHETYPE-519)。