无法将共享 pom 上传到 Nexus

发布于 2025-01-05 21:03:18 字数 1517 浏览 0 评论 0原文

我有一个使用 spring api 的共享 pom。

pom.xml:

   <project>

        <groupId>com.spring</groupId>
        <artifactId>spring</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>pom</packaging>
        <modelVersion>4.0.0</modelVersion>

    <profiles>
        <profile>
            <id>profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>nexus-snapshot</id>
                    <url>https://mynexusrepo</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>
        <dependencies>
            <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-aop</artifactId>
              <version>3.0.6.RELEASE</version>
            </dependency>   
        </dependencies>
    </project>

当我尝试将 pom 文件上传到快照 nexus 存储库时,我收到错误:
原因短语:禁止。 -

我已经上传了其他 pom 文件,但它们是 jar 的 - jar 我在哪里上传 pom - pom

如何将共享 pom 上传到 Nexus 以便其他项目可以引用它?这是标准做法吗? Pom 文件被缩短,大部分依赖项已被删除。

I have a shared pom which uses the spring api.

pom.xml :

   <project>

        <groupId>com.spring</groupId>
        <artifactId>spring</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>pom</packaging>
        <modelVersion>4.0.0</modelVersion>

    <profiles>
        <profile>
            <id>profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <distributionManagement>
                <snapshotRepository>
                    <id>nexus-snapshot</id>
                    <url>https://mynexusrepo</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>
        <dependencies>
            <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-aop</artifactId>
              <version>3.0.6.RELEASE</version>
            </dependency>   
        </dependencies>
    </project>

When I try to upload the pom file to the snapshot nexus repository I receive the error :
ReasonPhrase:Forbidden. -

I have uploaded other pom files but they were jar's - <packaging>jar</packaging>
where here I am uploading a pom - <packaging>pom</packaging>

How can I upload a shared pom to Nexus so that other projects can reference it? Is this standard practice ?
Pom file is shortened, most of dependencies have been removed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谜兔 2025-01-12 21:03:18

“禁止”消息向我表明您的 Nexus 用户 ID 没有发布该工件的正确权限。

如果您的 Nexus 管理员让您将内容发布到共享存储库,则问题可能出在存储库目标上。目标控制允许您访问的 URL 路径。

以下博客文章介绍了管理 Nexus 存储库的不同方法:

http ://www.sonatype.com/people/2009/06/optimal-nexus-repository-configuration/

The "forbidden" message would indicate to me that your nexus userid does not have the correct permissions to publish the artifact.

If your Nexus administrator has you publishing content to a shared repository the issue could be with the repository target. Targets control the URL path which you're allowed to access.

The following blog article describes different approaches to managing the Nexus repo:

http://www.sonatype.com/people/2009/06/optimal-nexus-repository-configuration/

只等公子 2025-01-12 21:03:18

这个共享的pom是否属于可以通过mvn部署部署的项目?它有正确的 scm 配置吗?执行此类操作的通常方法是通过 mvn release:prepare 和 release:perform。你是怎么尝试的?

Does this shared pom belong to a project which can be deployed via mvn deploy ? Does it have correct configurations for scm ?. The usual way to do such a thing is via mvn release:prepare and release:perform. How did you tried it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文