Expand my Community achievements bar.

Maven clean install unauthorized error

Avatar

Level 2

When running the maven clean install command:

mvn clean install -PautoInstallPackage -Daem.host=remoteserver -Daem.port=4502 -Dsling.user=admin -Dsling.password=<password>

I am getting:

[DEBUG] Authorization required

[DEBUG] Supported authentication schemes in the order of preference: [ntlm, digest, basic]

[DEBUG] Challenge for ntlm authentication scheme not available

[DEBUG] Challenge for digest authentication scheme not available

[INFO] basic authentication scheme selected

[DEBUG] Using authentication scheme: basic

[DEBUG] Authorization challenge processed

[DEBUG] Authentication scope: BASIC 'Sling (Development)'@remoteserver:4502

[DEBUG] Credentials required

[DEBUG] Credentials provider not available

[INFO] Failure authenticating with BASIC 'Sling (Development)'@remoteserver:4502

[ERROR] Request to http://remoteserver:4502/crx/packmgr/service.jsp failed, response=Unauthorized

[DEBUG] Should close connection in response to directive: close

[DEBUG] Releasing connection back to connection manager.

Surprisingly the curl call to the same server, with exact same credentials is successful:

curl -u admin:<password> http://remoteserver:4502/crx/packmgr/service.jsp?cmd=ls

I tried to find the logs in error.log, access.log, and request.log for either calls, but AEM does not seem to be keeping the logs for call to /crx/packmgr/service.jsp

Is there anyway, I can setup the AEM to log the calls to /crx/packmgr/service.jsp?

Thanks you very much for looking at my question. Would greatly appreciate a suggestion.

8 Replies

Avatar

Level 10

WHen you run this command from the same machine - does it work?

mvn -PautoInstallPackage install

Avatar

Level 10

can you share properties defined in pom.xml for host/credentials

I mean you can surely hide host name and password but I wanted to look at the property names

Avatar

Employee

Hi,

Please verify following properties are defined in your POM file:

aem.host

aem.port

sling.user

sling.password

Also check targetURL is properly defined under content-package-maven-plugin in autoInstallPackage profile

Avatar

Level 2

Scott- the mvn -PautoInstallPackage install completes with success

<properties> <aem.host>localhost</aem.host> <aem.port>4502</aem.port> <aem.publish.host>localhost</aem.publish.host> <aem.publish.port>4503</aem.publish.port> <sling.user>admin</sling.user> <sling.password>admin</sling.password> <vault.user>admin</vault.user> <vault.password>admin</vault.password> </properties>

Avatar

Level 2

Scott-

Locally, it works perfectly well. No errors when executing:

mvn -PautoInstallPackage install

It even works well on the AEM instance that is on another VM on local network

Avatar

Level 2

Abhishek- The pom.xml properties are default properties as created by the maven archetype 10. Kindly seem my other post

Avatar

Level 2

Praveen- It is default pom.xml with default host, port, user, and password. However, since I am using

mvn clean install -PautoInstallPackage -Daem.host=remoteserver -Daem.port=4502 -Dsling.user=admin -Dsling.password=<password>

the default credentials would be overridden.

Avatar

Employee

Have you checked this thread - Request to http://localhost:4502/crx/packmgr/service.jsp failed, response=Unauthorized

Not sure if your pom file are customized after Archetype generation.