Expand my Community achievements bar.

Get ready! An upgraded Experience League Community experience is coming in January.
SOLVED

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 Accepted Solution

Avatar

Correct answer by
Level 10

It appears from the error message that the <useProxy> tag is placed after the </extensions> tag, which is incorrect. The tag must be placed under the <configuration> tag of the <plugin>. Please have a look at my previous examples on how to use <useProxy>.

View solution in original post

5 Replies

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.​

 
 

Avatar

Level 2

Hi @giuseppebaglio 
[ERROR] Some problems were encountered while processing the POMs:
“Unrecognised tag: 'useProxy'” in AEM All Package POM

Malformed POM ... Unrecognised tag: 'useProxy' (position: START_TAG seen ...</extensions><useProxy>... )

Avatar

Correct answer by
Level 10

It appears from the error message that the <useProxy> tag is placed after the </extensions> tag, which is incorrect. The tag must be placed under the <configuration> tag of the <plugin>. Please have a look at my previous examples on how to use <useProxy>.

Avatar

Employee

Hello @SuneethaKo 
- Check if http://localhost:4502/crx/packmgr/service.jsp works directly.
- Update targetURL in pom.xml (no trailing /):
<targetURL>http://localhost:4502/crx/packmgr/service.jsp</targetURL>
- Verify username/password in pom.xml
- If using HTTPS, change to:
<targetURL>https://localhost:4502/crx/packmgr/service.jsp</targetURL>
and allow insecure SSL if needed.
- Match AEM version with project dependencies (AEM 6.5 vs Cloud SDK).

Avatar

Administrator

@SuneethaKo Just checking in! Were you able to get this resolved? If you found your own solution, sharing the details would be a big help to others who might face the same issue later on. And if one of the replies here helped, whether it fully solved the problem or simply pointed you in the right direction, marking it as accepted makes it much easier for future readers to find. Thanks again for helping close the loop and contributing to the community!



Kautuk Sahni