StefanPG
StefanPG

Reputation: 195

Maven Encrypt Password ArrayIndexOutOfBoundsException

I have a problem with the mvn --encrypt-password function from maven.

I just installed Maven on my PC, added the bin directory to the PATH and now I'm trying to encrypt my password for the settings.xml. I have seen in the internet, that you normaly use mvn --encrypt-password for this, but everytime I try to use it I get the following error:

C:\Users\USER>mvn -ep
Password:
[ERROR] Error executing Maven.
[ERROR] java.lang.ArrayIndexOutOfBoundsException
[ERROR] Caused by: null

I already tried to switch from JRE 1.8.0_112 to JDK 1.8.0_111 and maven realised the change:

C:\Users\USER>mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:1
3+02:00)
Maven home: F:\Programme\apache-maven-3.5.2\bin\..
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_111\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

But I'm still getting the error. I would be very pleased if someone could help me with this problem.

Sincerely StefanPG

Upvotes: 2

Views: 4046

Answers (1)

StefanPG
StefanPG

Reputation: 195

SOLUTION: As khmarbaise said, just using mvn -emp worked fine for me.

Again, thanks alot.

EDIT: A coworker just told me, that the mvn -ep only works, if you have a master password in your %USER%/.m2/settings-security.xml

Upvotes: 6

Related Questions