May 9, 2020
Estimated Post Reading Time ~

Maven archetypes for AEM

If you’ve been trying to create your first AEM project using a Maven archetype provided by Adobe and all you got is the message

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.day.jcr.vault:multimodule-content-package-archetype:1.0.2) -> [Help 1]
1. Locate your settings.xml
ls -l "${HOME}/.m2/settings.xml"

If you don’t have one, use the global file as base:

cp "${MAVEN_HOME}/conf/settings.xml" "${HOME}/.m2/settings.xml"

(Alternatively, if you know which version of Maven you are using, you can copy a sample file from https://raw.githubusercontent.com/apache/maven/maven-[[your-version]]/apache-maven/src/conf/settings.xml)
2. Modify the file
  • Open your settings.xml in a text editor;
  • Search for the tag <profiles>;
  • Insert the following into it:
<profile>
  <id>adobe-public</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
  <repositories>
    <repository>
      <id>adobe</id>
      <name>Nexus Proxy Repository</name>
      <url>http://repo.adobe.com/nexus/content/groups/public/</url>
      <layout>default</layout>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>adobe</id>
      <name>Nexus Proxy Repository</name>
      <url>http://repo.adobe.com/nexus/content/groups/public/</url>
      <layout>default</layout>
    </pluginRepository>
  </pluginRepositories>
</profile>

3. Run the maven command again

mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault \
-DarchetypeArtifactId=multimodule-content-package-archetype \
-DarchetypeVersion=1.0.2 -DarchetypeRepository=adobe-public-releases

4. Enjoy your recently created project!


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.