Search code examples
mavenmaven-3maven-pluginaemuberjar

How to add aem Uber jar dependency in maven build


I have used the maven archetype10 as shown below and created the project structure and everything was fine.

mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=10 -DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/

Now i wanted to add the aem uber-jar dependency and added the below dependency tags in the project pom.xml and in core module pom.xml respectively and also my repository tags are same as https://repo.adobe.com/

       <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <version>6.2.0</version>
            <scope>provided</scope>
        </dependency>

after adding the above dependency tag when i compile it is giving me the below error.

[ERROR] Failed to execute goal on project aemexample.core: Could not resolve dependencies for project com.krishh.example:aemexample.core:bundle:0.1: Could not transfer artifact com.adobe.aem:uber-jar:jar:6.2.0 from/to adobe-public-releases (http://repo.adobe.com/nexus/content/groups/public): hostname in certificate didn't match: <repo.adobe.com> != <devedge.day.com> OR <devedge.day.com> -> [Help 1]

Is there anything am missing to add extra dependencies to compile and run this successfully.


Solution

  • You seem to be missing a classifier in your dependency. Try adding the one for AEM APIs, as suggested in the documentation. This should help Maven locate the necessary JAR in the repository:

    <dependency>
        <groupId>com.adobe.aem</groupId>
        <artifactId>uber-jar</artifactId>
        <version>6.2.0</version>
        <classifier>apis</classifier>
        <scope>provided</scope>
    </dependency>
    

    If that doesn't help, you should also look at the certificate warning. Check out the answers to this question for more information on the subject.

    TL;DR - possible causes could be:

    • an old Maven version using an HTTP library that is not compliant with the certificate being used by the repository - try upgrading Maven
    • erroneous certificate used by the server
    • potential network configuration issues between you and the repository
    • an actual attempt at getting you to download a malicious file by a party pretending to be the Nexus