我不知道这里有什么问题。当我执行release:prepare时出现此错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project myproject: Unable to commit files
[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
[ERROR] svn: E215004: Commit failed (details follow):
[ERROR] svn: E215004: Unable to connect to a repository at URL 'https://localhost/svn/repo/myrepo/myapp/trunk/com.mydomain.mygame-TRUNK'
[ERROR] svn: E215004: No more credentials or we tried too many times.
[ERROR] Authentication failed
[ERROR] -> [Help 1]
在settings.xml中定义的用户和密码将由Maven识别,由....检查。
$ mvn help:effective-settings
我甚至可以通过svn命令连接到存储库。用户和密码也是正确的。
当我使用此命令执行时,release:prepare将通过:
$ mvn release:prepare -Dusername=myself -Dpassword=mypass
settings.xml
<servers>
<server>
<id>svnrepo</id>
<username>myself</username>
<password>mypass</password>
</server>
</servers>
pom.xml
<scm>
<connection>scm:svn:https://localhost/svn/repo/myrepo</connection>
<developerConnection>scm:svn:https://localhost/svn/repo/myrepo/myapp/trunk</developerConnection>
<url>scm:svn:https://localhost/svn/repo/myrepo</url>
</scm>
<distributionManagement>
<repository>
<id>svnrepo</id>
<url>svn:https://localhost/svn/repo/myrepo/myapp/releases</url>
</repository>
<snapshotRepository>
<id>svnrepo</id>
<url>svn:https://localhost/svn/repo/myrepo/myapp/snapshots</url>
</snapshotRepository>
</distributionManagement>
当我省略用户名和密码时,为什么它不起作用?
答案 0 :(得分:-1)
我发现您使用的是https。可能它与您的服务器证书有关。它是否使用自签名证书? 如果是这样,请设置maven以信任这些:like this
要点: 在您的用户目录中创建一个名为svn-settings.xml的文件(例如:C:\ Users \ YourUsername.scm \ svn-settings.xml),其中包含以下内容:
<svn-settings>
<trustServerCert>true</trustServerCert>
</svn-settings>