wcm-io / io.wcm.maven.archetypes.aem Goto Github PK
View Code? Open in Web Editor NEWMaven Archetype for creating new AEM projects.
Home Page: https://wcm.io/tooling/maven/archetypes/aem/
License: Apache License 2.0
Maven Archetype for creating new AEM projects.
Home Page: https://wcm.io/tooling/maven/archetypes/aem/
License: Apache License 2.0
I tried to use the archetype for a Site API project as documented here:
https://wcm.io/tooling/maven/archetypes/aem/usage.html
Generating / building the project works as expected with DoptionAemVersion=cloud
, but we are targeting AEM 6.5 so I adjusted the parameters like this:
mvn org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate -DinteractiveMode=false \
-DarchetypeGroupId=io.wcm.maven.archetypes \
-DarchetypeArtifactId=io.wcm.maven.archetypes.aem \
-DarchetypeVersion=3.8.0 \
-DprojectName=site-api-error-handling \
-DgroupId=com.github.feffef \
-DartifactId=site-api-error-handling \
-Dversion=1.0.0-SNAPSHOT \
-Dpackage=com.github.feffef.siteapi.errorhandling \
-DpackageGroupName=com.github.feffef \
-DaemAuthorPort=4502 \
-DaemPublishPort=4503 \
-DoptionJavaVersion=11 \
-DoptionAemVersion=6.5 \
-DoptionAemServicePack=n \
-DoptionAemServicePackAPI=n \
-DoptionSlingInitialContentBundle=y \
-DoptionEditableTemplates=y \
-DoptionMultiBundleLayout=y \
-DoptionContextAwareConfig=y \
-DoptionWcmioHandler=y \
-DoptionWcmioSiteApi=y \
-DoptionSlingModelsLatest=n \
-DoptionContextAwareConfigLatest=n \
-DoptionAcsCommons=n \
-DoptionFrontend=n \
-DoptionNodeJsPlugin=n \
-DoptionIntegrationTests=y
The project is successfully generated, but a mvn clean install
fails, because all of the unit-tests are failing, e.g.
[ERROR] com.github.feffef.siteapi.errorhandling.components.CurrentDateTest.testYear Time elapsed: 0.03 s <<< ERROR!
java.lang.RuntimeException: After setup failed (io.wcm.testing.mock.wcmio.siteapi.processor.ContextPlugins$1@25d2f66): Could not initialize class io.wcm.siteapi.processor.util.impl.JsonObjectMapperImpl
at org.apache.sling.testing.mock.osgi.context.ContextPlugins.executeAfterSetUpCallback(ContextPlugins.java:216)
at io.wcm.testing.mock.aem.junit5.AemContextExtension.lambda$beforeEach$1(AemContextExtension.java:129)
at io.wcm.testing.mock.aem.junit5.AemContextExtension.applyAemContext(AemContextExtension.java:180)
at io.wcm.testing.mock.aem.junit5.AemContextExtension.beforeEach(AemContextExtension.java:127)
....
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.wcm.siteapi.processor.util.impl.JsonObjectMapperImpl
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.instantiateServiceWithActivateInject(OsgiServiceUtil.java:521)
at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateInjectServices(OsgiServiceUtil.java:475)
at org.apache.sling.testing.mock.osgi.MockOsgi.registerInjectActivateService(MockOsgi.java:272)
at org.apache.sling.testing.mock.osgi.context.OsgiContextImpl.registerInjectActivateService(OsgiContextImpl.java:191)
at org.apache.sling.testing.mock.osgi.context.OsgiContextImpl.registerInjectActivateService(OsgiContextImpl.java:179)
at io.wcm.testing.mock.wcmio.siteapi.processor.ContextPlugins.setUp(ContextPlugins.java:59)
at io.wcm.testing.mock.wcmio.siteapi.processor.ContextPlugins$1.afterSetUp(ContextPlugins.java:50)
at io.wcm.testing.mock.wcmio.siteapi.processor.ContextPlugins$1.afterSetUp(ContextPlugins.java:47)
at org.apache.sling.testing.mock.osgi.context.ContextPlugins.executeAfterSetUpCallback(ContextPlugins.java:213)
... 58 more
[INFO] Running com.github.feffef.siteapi.errorhandling.reference.LinkReferenceTest
[main] WARN org.apache.sling.models.impl.AdapterImplementations - Unable to reflect on com.adobe.cq.wcm.core.components.internal.models.v1.ImageImpl
java.lang.NoClassDefFoundError: Lcom/adobe/cq/wcm/spi/AssetDelivery;
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
at java.base/java.lang.Class.getDeclaredFields(Class.java:2248)
Note sure if this is an issue with the archetype, or something with the sites API dependencies. But since it builds for cloud I assume it's not caused by something with my local build environment. Here are the details anyway:
% mvn -v
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: /Users/feffef/.sdkman/candidates/maven/current
Java version: 11.0.17, vendor: Azul Systems, Inc., runtime: /Users/feffef/.sdkman/candidates/java/11.0.17-zulu/zulu-11.jdk/Contents/Home
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "12.0", arch: "x86_64", family: "mac"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.