Maven Introduction
The preferred communication method between your codebase and your instance of AEM is Maven. It enables the automation of both content and code packaging. Although it is a highly useful tool, it is also quite expansive, which creates complications. Through the use of build profiles in Maven, we can easily deploy code to our AEM instances. Services that enable users to connect Maven to their instance and write code are already set up in AEM. During the build process, Maven pushes material to specific AEM URLs, where it is received and correctly ingested by AEM.
For New Project
You may quickly begin a new project that is prepared to build for your local AEM instance using the AEM Maven Archetype. It effectively does all the laborious work for you. The structure that the archetype automatically creates might be familiar to those of you who have experience working with existing AEM projects.
https://github.com/adobe/aem-project-archetype
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=39\
-D appTitle="My Site" \
-D appId="mysite" \
-D groupId="com.mysite"
Check Properties: https://github.com/adobe/aem-project-archetype#available-properties
Why does Execution stop in the middle of creating a new Project?
Normally, this issue occurs due to a mismatched version between the AEM quickstart .jar file and the archetype version. You can check your version from Archetype Release. If you have a .jar file with the version of AEM 6.5. Then you need to check with archetype version 23. It will work.
Sometimes, the issue is due to a missing setting.xml file. You can place the setting.xml file at username/.m2/ folder. You can field the setting.xml file from Apache Settings.
You need to make sure that your author instance successfully running on htttp://localhost:4502 while installing your project on the author instance.
Troubleshooting
Regretfully, Maven just checks to see whether the package was properly uploaded; it doesn't always know if the package was successfully installed inside of AEM. You can manually reinstall the package your Maven build uploaded in AEM's package manager (/crx/packmgr/index.jsp) if you believe that modifications you made should have appeared in your instance but aren't. AEM has more detailed logging so you can see more clearly if there is a problem with the package Maven loaded for you.
Check the project's README.md file to determine if there are project-specific criteria that aren't being satisfied in your current run setup if you're experiencing build troubles.
Make sure all maven dependencies are perfectly loading in your pom.xml file.
Comments
Post a Comment