Maven deployment keeps asking for username/password

1.5k Views Asked by At

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.

1

There are 1 best solutions below

0
Raulio On

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>