Sonatype Nexus 3.1:未生成原型目录 [英] Sonatype Nexus 3.1: Archetype catalog not generated

查看:98
本文介绍了Sonatype Nexus 3.1:未生成原型目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我们升级到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:未生成原型目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆