0

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

Eman
  • 1
  • 2
  • 1
    can you share youre `settings.xml`. The error indicates, that maven is not aware of the [adobe repo](https://repo.adobe.com/nexus/content/groups/public/com/adobe/granite/archetypes/aem-project-archetype/23/aem-project-archetype-23.pom) – luckyluke Jan 26 '23 at 19:20
  • @luckyluke this file does not exist anywhere – Eman Jan 31 '23 at 08:15
  • It is not created automatically. You should create it here: `${user.home}/.m2/settings.xml` Please check out the [maven documention](https://maven.apache.org/settings.html). Then add the settings in the [link](https://stackoverflow.com/a/56299699/1514647) you added yourself in your question. – luckyluke Jan 31 '23 at 10:15

2 Answers2

0

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.

Lê Thọ
  • 334
  • 1
  • 9
-1

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

ronnyfm
  • 1,973
  • 25
  • 31
  • how should this work, if the settings.xml is not present and therefore the profile is not present? – luckyluke Feb 02 '23 at 20:11
  • It is present in the pom.xml generated by the Archetype, but if you have not been able to do it successfully at least one time, then, there is not issue, running maven once should create a .m2 folder. Just create a default settings.xml (from here https://maven.apache.org/settings.html) and add the Adobe public profile. Get it from here: https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-17454.html?lang=en – ronnyfm Feb 03 '23 at 17:27