Coder Social home page Coder Social logo

wcm-io / io.wcm.maven.archetypes.aem Goto Github PK

View Code? Open in Web Editor NEW
7.0 11.0 4.0 8.33 MB

Maven Archetype for creating new AEM projects.

Home Page: https://wcm.io/tooling/maven/archetypes/aem/

License: Apache License 2.0

Groovy 15.63% Shell 18.93% CSS 0.91% JavaScript 7.89% Java 32.06% HTML 14.53% Handlebars 9.32% SCSS 0.73%
wcm-io aem maven archetype adobe-experience-manager

io.wcm.maven.archetypes.aem's People

Contributors

chillinpanda avatar dependabot[bot] avatar mrozati avatar stefanseifert avatar tobias-richter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

io.wcm.maven.archetypes.aem's Issues

AEM headless project with wcm.io Site API fails to build with optionAemVersion=6.5

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.