adobe / aemanalyser-maven-plugin

A Maven plugin used by developers who develop Java components for AEMaaCS (AEM as a Cloud Service) during their local Java builds to ensure that their components work correctly in when deployed to AEM as a Cloud Service.
Apache License 2.0
23 stars 20 forks source link

Issue with aemanalyser-maven-plugin Artifact Resolution With AEM as cloud services and Azure #305

Open v-fnuab opened 2 months ago

v-fnuab commented 2 months ago

I am facing an issue with the aemanalyser-maven-plugin artifact. According to our security team, we need to use the central repository ID. However, during the build process, we receive the following error:

Failed to execute goal com.adobe.aem:aemanalyser-maven-plugin:1.5.8:project-analyse (aem-analyser) on project aem-quantumhub-project.all: Failed to resolve version for com.adobe.aem:aem-sdk-api:jar:RELEASE: Could not find metadata com.adobe.aem:aem-sdk-api/maven-metadata.xml in local (/root/.m2/repository) -> [Help 1]

Platform and Version

AEM as cloud service and Azure

Sample Code that illustrates the problem

Example POM Structure:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>example-project</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>com.adobe.aem</groupId>
                <artifactId>aemanalyser-maven-plugin</artifactId>
                <version>1.6.0</version> <!-- Make sure to use the latest release -->
                <extensions>true</extensions>
                <repositories>
                    <repository>
                        **<id>central</id>**
                        <url>https://my-company-maven-pkg</url>
                    </repository>
                </repositories>
            </plugin>
        </plugins>
    </build>
</project>

The build fails to resolve the version for com.adobe.aem:aem-sdk-api due to missing metadata in the local repository. We need assistance in resolving this issue. Specifically, we are looking to understand if there is any restriction on using the central repository ID for this plugin. If I am using any other ID then build is working fine.

Seems AEM Analyser Maven Plugin is open-source and not part of the official AEM product. Can someone provide guidance on how to address this issue or suggest any alternatives?

kwin commented 2 months ago

central is a reserved id (https://maven.apache.org/ref/3.9.9/maven-model-builder/super-pom.html) and should be used only for Maven Central. Overriding is basically similar to mirroring and in your case obviously not intended as https://my-company-maven-pkg doesn't seem to be a fully compliant Maven repository.