blue-sky
blue-sky

Reputation: 53846

Unable to upload a shared pom to Nexus

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.

Upvotes: 1

Views: 2666

Answers (2)

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77981

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/

Upvotes: 3

khmarbaise
khmarbaise

Reputation: 97447

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?

Upvotes: 0

Related Questions