AEM 6.5.0 - Maven Archetype Project - Build Failure

836 views Asked by At

I'm creating an AEM project using Maven Archetype but I keep getting errors:

[WARNING] Archetype not found in any catalog. Falling back to central repository.

[WARNING] The POM for com.adobe.aem:aem-project-archetype:jar:23 is missing, no dependency information available

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.adobe.aem:aem-project-archetype:23) -> [Help 1]

AEM Version: 6.5.0

Java Version: 11.0.17

Maven Version: 3.8.6

Commands used:

mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -D archetypeGroupId=com.adobe.granite.archetypes -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=23 -D appTitle="My Site" -D appId="mysite" -D groupId="com.mysite" -D frontendModule=general 
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=23 -D appTitle="My Site" -D appId="mysite" -D groupId="com.mysite" -D frontendModule=general 

I tried many archetype versions (older and newer than the required one "23") and tried these solutions but didn't solve the problem:

Cannot build a project using maven archetype installed locally

Maven Unable to Find AEM Archetype

2

There are 2 answers

2
ronnyfm On

Try adding -P adobe-public to the maven command.

0
Lê Thọ On

I also encountered this issue when generating AEM 6.5.0 project which require archetype version 23.

The cause is that in this maven repository https://repo.maven.apache.org/maven2/com/adobe/granite/archetypes/aem-project-archetype/23/ we do not have the aem-project-archetype-23.jar file but aem-project-archetype-23.maven-archetype file. I don't know if that is the intention or mistake of the author, but we have a workaround for this as below.

Download file aem-project-archetype-23.maven-archetype to your local and rename it to be aem-project-archetype-23.jar. Then copy it into your local repository folder may be under .m2/com/adobe/granite/archetypes/aem-project-archetype/23/.

After that, your maven command to generate the project will work properly.