'Maven svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option

When I try to do a mvn release: perform, I get this error

[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option
svn: E215004: Commit failed (details follow):
svn: E215004: No more credentials or we tried too many times.
Authentication failed
svn: E215004: Additional errors:
svn: E215004: No more credentials or we tried too many times.
Authentication failed

So I thought something maybe wrong with my pom. So I tried doing

mvn scm:checkin -Dmessage="relase" -Dusername=<username> -Dpassword=<password>.

I have the scm related section in pom in this manner:

<scm>
  <url>url</url> 
  <connection>scm:svn:url</connection> 
  <developerConnection>scm:svn:url</developerConnection>

  </scm>

But I still get the same error.

I have subclipse installed in eclipse. I have collabnet and tortoise SVN installed on my machine. All are 1.8.1 version. When I try to checkin directly from eclipse using Team--> Commit, I am able to commit using the same credentials. Also I am able to commit using the same credentials from TortoiseSVN. But using the same credentials I am not able to release perform or scm checkin from maven. I saw some links which talk about ${user.home}.scm\svn-settings.xml where we can configure interactive svn. But I do not see it on my machine. I do not see the .scm folder itself. Am I doing anything wrong here?

These are software that I installed in eclipse

Collabnet merge client -4.0.2 Subclipse- 1.10.4 Subclipse client adapter -1.10.1 Subversion JavaHL native library adapter- 1.8.8.1



Solution 1:[1]

The only place I've seen this documented is in the Maven release plugin FAQ. You may add a server entry to your POM, then configure the project to use it.

<!-- Project POM, or a corporate parent -->
<properties>
  <project.scm.id>my-scm-server<project.scm.id>
</properties>

<!-- User's settings.xml file -->
<server>
    <id>my-scm-server</id>
    <username>username</username>
    <password>password</password>  <!-- encrypted I hope! -->
</server>

I can't find the reference for this (maybe I looked at the source code), but once upon a time I discovered that if you set the ID to the Subversion host, then the server info will be located by many plugins, including release and scm. It would look like this:

<!-- Project POM, or a corporate parent -->
<properties>
  <project.scm.id>your.subversion.host<project.scm.id>  <!-- note, no scm:svn part -->
</properties>

<!-- User's settings.xml file -->
<server>
    <id>your.subversion.host</id>
    <username>username</username>
    <password>password</password>  <!-- encrypted I hope! -->
</server>

Solution 2:[2]

Subversion really changes from 1.6.x to 1.8.x. This problem may be due to that (especially using Windows + Active Directory).

If invoking maven from eclipse it then tries to access the SVN not using Subclipse. Assume that you even use an external Maven installation. This external installation does not know your Eclipse / Subclipse and thus calls SVN available on your platform (depending on Windows path variable). This SVN for does not know of your Eclipse and hence has to get the credentials from somewhere else (for example %USER%\AppData\Roaming\Subversion\auth). Unfortunately at this point something seems to have been broken with the maven-release-plugin since SVN protocol version 1.6.

Currently no best solution is known and it is unclear what exactly causes the maven-release-plugin to fail. The best work around maybe to provide the credentials in the Eclipse Run configuration (JRE tab, then argument Dusername=... -Dpassword=...).

I would recommend not to store the credentials somewhere where they might be accidentally exploited to others.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user944849
Solution 2 Sebastian