I am getting archetype does not exist error while creating a project as mentioned.
Details regarding the versions -
AEM version - 6.5.0
Service pack - 6.5.17
Maven version - 3.9.8
Archetype - 49
Command that I am trying to use -
mvn archetype:generate -B -DarchetypeCatalog=remote -DarchetypeGroupId=com.adobe.com -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=49 -DaemVersion=6.5.17 -DsdkVersion=2021.11.6058.20211123T163652Z-211000 -DappTitle="New Site" -DappId="newsite" -DgroupId="com.newsite" -DfrontendModule=general -DincludeDispatcherConfig=y -DincludeErrorHandler=y -DincludeDynamicMedia=y
Command Prompt Snapshot for reference -
I have attached below the settings.xml that I am using.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi, please check these threads:
https://maven.apache.org/settings.html
https://blog.devgenius.io/what-is-m2-folder-and-the-setttings-xml-inside-it-82f43c3474a4
https://www.baeldung.com/maven-local-repository
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate
Can you try mentioning the archetype plugin version like above instead of using like mvn -B archetype:generate. I just tried the below command and it is generating properly.
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=49 -D archetypeRepository=https://repo1.maven.org/maven2/ -D aemVersion=cloud -D appTitle="mysite" -D appId="mysite" -D groupId="com.mysite" -D frontendModule=general -D includeExamples=n
Hello @narendiran100 Thanks for the response. This works, I tried with mentioning the plugin version.
But can you please elaborate how these two commands differ?
Also I tried placing a folder structure in .m2, containing maven versions and release details which my colleague had but I did not have that folder in my .m2. When I place this folder in my .m2 the command which I shared works fine and the project is built successfully.
Can you please elaborate how this below folder structure is generated in .m2 and how does adding the plugin version affect the build?
Please refer below snapshots for the folder structure I am talking
about.
Hi,
Please check the official documentation which shows an example of the command you should follow as well as the available options while generating the project from the archetype:https://github.com/adobe/aem-project-archetype?tab=readme-ov-file#usage
You should do something like this:
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate \
-D archetypeGroupId=com.adobe.aem \
-D archetypeArtifactId=aem-project-archetype \
-D archetypeVersion=49\
-D appTitle="My Site" \
-D appId="mysite" \
-D groupId="com.mysite"
Please validate your options as well against the documentation.
Hope this helps
Thank you for your response @EstebanBustamante.
I just had this doubt that, the command having the archetype version works absolutely fine.
I would like to know how these two commands differ, how they work internally and why the other one failed?
The issue is that your command uses the default version of the Maven plugin to generate the archetype. In contrast, the working command specifies the exact Maven plugin and version needed for creating the archetype. The archetype was designed to be compatible with a particular archetype plugin and version, which is why the default configuration does not work.
Check this: https://github.com/adobe/aem-project-archetype/issues/400
Hope this helps
Hey @EstebanBustamante thanks for the response. That was really helpful.
One more doubt, so now I understand how adding the version to this command differs from the default version but can you please elaborate below scenario?
I tried placing a folder structure in .m2, containing maven versions and release details which my colleague had but I did not have that folder in my .m2.
When I place this folder in my .m2 the command which I shared works fine and the project is built successfully.
Can you please elaborate how this below folder structure is generated in .m2 ?
Please refer below snapshots for the folder structure I am talking
about.
Hey, this is a more generic maven question, so basically the folder structure in .m2
is generated and managed by Maven based on the artifacts you use in your projects. Manually adding folders or files to .m2
can be a workaround to ensure that all required artifacts are available, but it’s generally better to rely on Maven’s automated dependency management and repository configurations. The same happen for your plugins, however you can check this thread: https://stackoverflow.com/questions/73992967/how-to-add-plugins-to-m2-repository-for-those-not-found... . My reasoning would be that the folder you added in your .m2 folder contains the "maven-archetype-plugin" that helps your build to be success.
Hope this helps.
Sorry for this question if it's a basic but when is this folder structure inside m2 folder generated?
Hi, please check these threads:
https://maven.apache.org/settings.html
https://blog.devgenius.io/what-is-m2-folder-and-the-setttings-xml-inside-it-82f43c3474a4
https://www.baeldung.com/maven-local-repository
Thanks a lot for all this info.
Views
Likes
Replies
Views
Likes
Replies