无法将共享 pom 上传到 Nexus
我有一个使用 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 的 -
我在哪里上传 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“禁止”消息向我表明您的 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/
这个共享的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?