How to make svnant / svnkit request for username / password

I have an Ant script that should check the directory from Subversion. This works using svnant / svnkit. However, access to Subversion is authenticated, and I do not want to store my user password in a file.

Can I make svnkit popup password dialog? Or is it even better if it uses the same credential caching that subversive / svnkit uses inside Eclipse (username can be read from build.properties)?

I cannot switch to public key authentication since I do not control the subversion server.

At the moment, he simply says: "svn: authentication is canceled."

+3
source share
4 answers

:

<input message="password:>" addproperty="password">
      <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>

, . Ant 1.7.1 .

+4

, Ant [input], , [svn].

 <target name="checkout">
    <input
        message="Please enter subversion password for ${username}:"
        addproperty="password"
      />

    <svn svnkit="${svnkit}" username="${username}" password="${password}">
        <checkout url="${urlRepos}/project" destPath="web/" />
    </svn> 
</target>

, * * * * *, ...

+3

Jera Ant [], :

<taskdef name="query" classname="com.jera.anttasks.Query" />
<target name="checkout">
  <query
    message="Please enter subversion password for ${username}:"
    name="password"  password="true"
  />

  <svn svnkit="${svnkit}" username="${username}" password="${password}">
    <checkout url="${urlRepos}/project" destPath="web/" />
  </svn> 
</target>
+2

ant -dialog (http://sourceforge.net/projects/ant-dialog/), java awt, . *** .

+1

Source: https://habr.com/ru/post/1698852/


All Articles