0

For our maven project, each time that we call the deploy command:

mvn deploy -Dmaven.test.skip=true

it asks for a user-name password:

Kerberos username [ccgadmin]: 
Kerberos password for ccgadmin: 

I am fine entering username/password, but the issue is that, since our project has multiple modules (about 15), it asks username/password for every single module (which is really time-consuming.)

I tried updating settings.xml to set the username/pass:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

<localRepository>/pool0/webserver/resources/m2repo</localRepository>
        <servers>
            <server>
                <id>ssh-repository</id>
                <username>USERNAME</username>
                <password>PASS</password>
            </server>
        </servers>
</settings>

but unfortunately, this didn't solve it.

Wondering if anyone has experienced a similar problem.

Daniel
  • 5,839
  • 9
  • 46
  • 85
  • Why are you using scp for a maven repository? Why not using a real repository like Nexus, Artifactory which handle that via http/https ...makes life easier.... – khmarbaise Jun 10 '19 at 16:17
  • Ah, that's a different story ... this system has been set up this way for a few years and now that would require quite some restructuring. – Daniel Jun 10 '19 at 18:17
  • I would strongly recommend to change that cause it's harder than it needs to be. Otherwise this is hard to do. Best would be to use wallet which stores credentials that you don't to give them each time...other option would be to use SSH-Public Keys..Apart from that if you need to type them each time there is something wrong with your setup... – khmarbaise Jun 11 '19 at 16:16

1 Answers1

2

JSch has by default Kerberos as PreferredAuthentication and you should set it to "password" instead.

You could do that by adding your server configuration of your settings file:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

<localRepository>/pool0/webserver/resources/m2repo</localRepository>
        <servers>
            <server>
                <id>ssh-repository</id>
                <username>USERNAME</username>
                <password>PASS</password>
                <configuration>
                     <PreferredAuthentications>password</PreferredAuthentications>
                </configuration>
            </server>
        </servers>
</settings> 
Raulio
  • 21
  • 2