Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3333082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:45:26+00:00 2026-05-17T23:45:26+00:00

I’m currently experiencing a problem while trying to set up a project to deploy

  • 0

I’m currently experiencing a problem while trying to set up a project to deploy to an internal nexus repository. Since I’m rather new to Maven in general, I expect that there is just something that I’m not really comprehending in how to set up distribution management.

The basic issue is that when I execute “mvn deploy” the artifact is being successfully deployed to the snapshot repository, but Maven is also attempting to deploy it to the release repository, which is failing … as it should. My understanding of my current configuration is that it should NOT be deploying it to the release repository as well.

I’ve included the various configuration elements below, but I’m wondering if I actually am supposed to be managing the section with a profile so that snapshot builds only have defined, and release builds have only defined.

Any help/clarification on this would be incredibly appreciated.

I have the following in my POM for distribution management:

<distributionManagement>
<repository>
  <id>internal-releases</id>
  <name>Internal Releases</name>
  <url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
  <id>internal-snapshots</id>
  <name>Internal Snapshots</name>
  <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

Elsewhere in the POM I have the following set up to allow use of these repositories to obtain artifacts:

<repositories>
<repository>
  <id>internal-releases</id>
  <url>http://localhost:8081/nexus/content/repositories/releases</url>
  <snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
  <id>internal-snapshots</id>
  <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
  <snapshots><enabled>true</enabled></snapshots>
</repository>
<!-- other repos, etc, etc -->
</repositories>

I have the correct settings in my settings.xml to provide credentials to be able to publish to this test nexus instance running on my computer, and it is in fact successfully deploying the snapshot.

The problem is that it also tries to deploy the snapshot to the release repository, which is configured to disallow snapshots.

The output from “mvn deploy” includes the following:

[INFO] [deploy:deploy {execution: default-deploy}]
[INFO] Retrieving previous build number from internal-snapshots
Uploading: http://localhost:8081/nexus/content/repositories/snapshots/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-8.war
405K uploaded  (service-1.0.0-20101104.170338-8.war)
[INFO] Retrieving previous metadata from internal-snapshots
[INFO] Uploading repository metadata for: 'snapshot com.internal:service:1.0.0-SNAPSHOT'
[INFO] Retrieving previous metadata from internal-snapshots
[INFO] Uploading repository metadata for: 'artifact com.internal:service'
[INFO] Uploading project information for service 1.0.0-20101104.170338-8
[INFO] [deploy:deploy-file {execution: default}]
[INFO] Retrieving previous build number from remote-repository
[INFO] repository metadata for: 'snapshot com.internal:service:1.0.0-SNAPSHOT' could not be found on repository: remote-repository, so will be created
Uploading: http://localhost:8081/nexus/content/repositories/releases/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar. Return code is: 400

The log from Nexus contains the following (as I would expect it to):

jvm 1    | 2010-11-04 13:03:39 INFO  [p-759477796-118] - o.s.n.p.m.m.M2Repos~          - Storing of item releases:/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar is forbidden by Maven Repository policy. Because releases is a RELEASE repository
jvm 1    | 2010-11-04 13:03:39 ERROR [p-759477796-118] - o.s.n.r.ContentPlex~          - Got exception during processing request "PUT http://localhost:8081/nexus/content/repositories/releases/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar": Storing of item releases:/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar is forbidden by Maven Repository policy. Because releases is a RELEASE repository
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:45:27+00:00Added an answer on May 17, 2026 at 11:45 pm

    So the best clue actually turned out to be right in front of my eyes in the log. The only artifact I had thought was being produced by the POM I was working with was a .war, but you’ll notice in the log that the artifact which Maven is attempting to deploy to the release is actually a .jar.

    This was enough of a pointer (that someone on the Maven users mailing list pointed provided) to look for and eventually find that someone had included the following extra configuration for the deploy phase.

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-deploy-plugin</artifactId>
    <executions>
    <execution>
      <phase>deploy</phase>
        <goals>
          <goal>deploy-file</goal>
        </goals>
        <configuration>
          <packaging>jar</packaging>
          <generatePom>true</generatePom>
          <url>${project.distributionManagement.repository.url}</url>
          <artifactId>${project.artifactId}</artifactId>
          <groupId>${project.groupId}</groupId>
          <version>${project.version}</version>
          <file>${project.build.directory}/${project.build.finalName}.jar</file>
        </configuration>
      </execution>
    </executions>
    </plugin>
    

    Notice that this is in fact directly referencing ${project.distributionManagement.repository.url}. Also, this configuration was somewhat misguided and should really have been accomplished via the attachClasses property of the war plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.