Expand my Community achievements bar.

AEM Maven Build Failing: Package Installation Error “Moved Permanently” when uploading to /crx/packmgr/service.jsp

Avatar

Level 2

Hi Team,

I am facing an issue during the Maven build and installation of an AEM package to my local instance.
The build completes successfully for all modules, but the All-in-one package fails during the installation step.

Environment:

AEM Version: (add your version, e.g., AEM 6.5.20 or AEM Cloud SDK)

Java Version: (example: Java 11)

Maven Version: (example: Maven 3.8.8)

OS: (Windows 10 / macOS, etc.)

Local AEM running on: http://localhost:4502

 

 

Full Error Snippet:
Request to http://localhost:4502/crx/packmgr/service.jsp failed, response=Moved Permanently
...
Error while installing package. Check log for details.

1 Reply

Avatar

Level 10

The error may occur because Maven is attempting to use system or IDE proxy settings when connecting to http://localhost:4502/crx/packmgr/service.jsp, which causes the request to be redirected (HTTP 301) instead of being processed directly by your local AEM instance.

Try to disable proxy usage for the content package plugin in your POM file. Add the following configuration to your content-package-maven-plugin or filevault-package-maven-plugin section: <useProxy>false</useProxy>

content-package-maven-plugin:

<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>content-package-maven-plugin</artifactId>
    <configuration>
        <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
        <username>${vault.user}</username>
        <password>${vault.password}</password>
        <useProxy>false</useProxy>
    </configuration>
</plugin>
filevault-package-maven-plugin:
 
<plugin>
    <groupId>org.apache.jackrabbit</groupId>
    <artifactId>filevault-package-maven-plugin</artifactId>
    <configuration>
        <serviceURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</serviceURL>
        <userId>${vault.user}</userId>
        <password>${vault.password}</password>
        <useProxy>false</useProxy>
    </configuration>
</plugin>

 

If you require proxy configuration for external repositories but not for localhost, update your Maven settings.xml to exclude localhost from proxy routing:​

<proxies>
    <proxy>
        <id>corporate-proxy</id>
        <active>true</active>
        <protocol>http</protocol>
        <host>proxy.company.com</host>
        <port>8080</port>
        <nonProxyHosts>localhost|127.0.0.1|*.local</nonProxyHosts>
    </proxy>
</proxies>

The nonProxyHosts element ensures local connections bypass the proxy.​