问题描述
自从我们升级到Sonatype Nexus 3.x以来,我们在存储库中都缺少自定义原型.
Ever since we've upgraded to Sonatype Nexus 3.x we are missing our custom archetypes in the repository.
浏览到http://repo/repository/maven-releases/archetype-catalog.xml
时,显示的是空的原型XML:
When browsing to http://repo/repository/maven-releases/archetype-catalog.xml
I am being shown an empty archetype XML:
我尝试重建存储库的索引,还尝试部署新的原型版本,但是似乎没有什么可以填充archetype-catalog.xml.该目录正在使用Nexus 2.
I have tried rebuilding the index of the repository and also tried deploying a new archetype version, but nothing seems to populate the archetype-catalog.xml. The catalog was working with version 2 of Nexus.
推荐答案
好,我找到了罪魁祸首.我必须使用 architetype-packaging 中的maven-archetype
包装:
Ok, I found the culprit. I had to use the maven-archetype
packaging from archetype-packaging:
<project>
<groupId>com.example</groupId>
<artifactId>example-archetype</artifactId>
<version>1.0.0</version>
<packaging>maven-archetype</packaging>
...
<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>2.4</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
使用该包装进行部署时,原型将显示在Nexus的原型目录中.
When deploying with that packaging, the archetypes will show up in Nexus' archetype-catalog.
这篇关于Sonatype Nexus 3.1:未生成原型目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!