Git Product home page Git Product logo

adobe / aem-project-archetype Goto Github PK

View Code? Open in Web Editor NEW
521.0 105.0 402.0 60.4 MB

Maven template to create best-practice websites on AEM.

Home Page: https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html

License: Apache License 2.0

HTML 9.62% Java 13.61% JavaScript 43.44% CSS 3.88% Groovy 8.54% TypeScript 11.44% Dockerfile 0.77% Shell 1.68% Less 1.11% SCSS 5.91%
aem adobe aem-site java maven maven-archetype project-template best-practices cloud-service

aem-project-archetype's Introduction

AEM Project Archetype

Test Maven Central

Maven template that creates a minimal, best-practices-based Adobe Experience Manager (AEM) project as a starting point for your website.

Welcome

Documentation

  • Archetype Documentation: The product documentation provides an overview of the archetype and its general features.
  • GitHub Documentation: The README.md documentation in this repo provides detailed technical usage detail of the archetype and all of its modules.
  • Tutorials: The following tutorials are based off this archetype:
    • WKND Site: Learn how to start a fresh new website.
    • WKND SPA Learn how to build a React or Angular webapp that is fully authorable in AEM.

Features

  • Best Practice: Bootstrap your site with all of Adobe's latest recommended practices.
  • Low-Code: Edit your templates, create content, deploy your CSS, and your site is ready for go-live.
  • Cloud-Ready: If desired, use AEM as a Cloud Service to go-live in few days and ease scalability and maintenance.
  • Dispatcher: A project is complete only with a Dispatcher configuration that ensures speed and security.
  • Multi-Site: If needed, the archetype generates the content structure for a multi-language and multi-region setup.
  • Core Components: Authors can create nearly any layout with our versatile set of standardized components.
  • Editable Templates: Assemble virtually any template without code, and define what the authors are allowed to edit.
  • Responsive Layout: On templates or individual pages, define how the elements reflow for the defined breakpoints.
  • Header and Footer: Assemble and localize them without code, using the localization features of the components.
  • Style System: Avoid building custom components by allowing authors to apply different styles to them.
  • Front-End Build: Front-end devs can mock AEM pages and build client libraries with Webpack, TypeScript, and SASS.
  • Decoupled Front-End: When choosing the frontend module to be decoupled, the project is preconfigured to use the AEMaaCS Frontend Pipeline. See the AEM React SPA template for more details how to get started with a decoupled frontend module using React.
  • WebApp-Ready: For sites using React or Angular, use the SPA SDK to retain in-context authoring of the app.
  • Commerce Enabled: For projects that want to use Commerce Integration Framework (CIF) to integrate with commerce solutions like Magento.
  • Forms Enabled: For projects that want to use (Forms).
  • Testing: ready-to-use Functional and UI testing modules, start adding your own tests
  • Example Code: Checkout the HelloWorld component, and the sample models, servelets, filters, and schedulers.
  • Open Sourced: If something is not as it should, contribute your improvements!

Usage

To generate a project, adjust the following command line to your needs:

  • Set aemVersion=cloud for AEM as a Cloud Service;
    Set aemVersion=6.5.7 for Adobe Managed Services, or on-premise. The Core Components dependency is only added for non cloud aem versions as the Core Components are provided OOTB for AEM as a Cloud Service.
  • Adjust appTitle="My Site" to define the website title and components groups.
  • Adjust appId="mysite" to define the Maven artifactId, the component, config and content folder names, as well as client library names.
  • Adjust groupId="com.mysite" to define the Maven groupId and the Java Source Package.
  • Lookup the list of available properties to see if there's more you want to adjust.
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=48\
 -D appTitle="My Site" \
 -D appId="mysite" \
 -D groupId="com.mysite"

Note: Make sure you use at least 3.1.0+ of maven-archetype-plugin (#400)

Note: To run above command with older versions, you have to use the old archetypeGroupId: -D archetypeGroupId=com.adobe.granite.archetype

Available Properties

Name Default Description
appTitle Application title, will be used for website title and components groups (e.g. "My Site").
appId Technical name, will be used for component, config and content folder names, as well as client library names (e.g. "mysite").
artifactId ${appId} Base Maven artifact ID (e.g. "mysite").
groupId Base Maven group ID (e.g. "com.mysite"). This value must be a valid Java package name.
package ${groupId} Java Source Package (e.g. "com.mysite").
version 1.0-SNAPSHOT Project version (e.g. 1.0-SNAPSHOT).
aemVersion cloud Target AEM version (can be cloud for AEM as a Cloud Service; or 6.5.5 for Adobe Managed Services or on-premise).
sdkVersion latest When aemVersion=cloud an SDK version can be specified (e.g. 2020.02.2265.20200217T222518Z-200130).
includeDispatcherConfig y Includes a dispatcher configuration either for cloud or for AMS/on-premise, depending of the value of aemVersion (can be y or n).
frontendModule general Includes a Webpack frontend build module that generates the client libraries (can be general or none for regular sites; can be angular, react or decoupled for a Single Page App that implements the SPA Editor. In the later case the project will be preconfigured to use the AEM as a Cloud Service Frontend Pipeline).
language en Language code (ISO 639-1) to create the content structure from (e.g. en, deu).
country us Country code (ISO 3166-1) to create the content structure from (e.g. US).
singleCountry y Includes a language-master content structure (can be y, or n).
includeExamples n Includes a Component Library example site (can be y, or n).
includeErrorHandler n Includes a custom 404 response page that will be global to the entire instance (can be y or n).
includeCif n Includes CIF Core Components dependencies and generates corresponding artifacts.
commerceEndpoint Required for CIF only. Optional endpoint of the commerce system GraphQL service to be used (e.g. https://hostname.com/grapql).
includeFormscommunications n Includes Forms Core Components dependencies and generates corresponding artifacts.
includeFormsenrollment n Includes Forms Core Components dependencies and generates corresponding artifacts.
sdkFormsVersion latest When aemVersion=cloud and one of includeFormsenrollment=y or includeFormscommunications=y an Forms SDK version can be specified (e.g. 2020.12.17.02).
datalayer y Activate integration with Adobe Client Data Layer.
amp n Enable AMP support for generated project templates.
enableDynamicMedia n Enabled foundation DynamicMedia components in project policy settings and activates Dynamic Media features in Core Image component's policy.
enableSSR n Option to enable SSR for the front-end project
precompiledScripts n Option to precompile the server-side scripts from ui.apps and attach them to the build as a secondary bundle artifact in the ui.apps project. aemVersion should be set to cloud.
includeFormsheadless n Includes Forms Core Components dependencies, ui.frontend.react.forms.af and headless artifacts.
uiTestingFramework cypress Testing framework used for generating UI tests (can be cypress or wdio).

System Requirements

Archetype AEM as a Cloud Service AEM 6.5 Java SE Maven
48 Continual 6.5.7.0+ 8, 11 3.3.9+

Setup your local development environment for AEM as a Cloud Service SDK or for older versions of AEM.

Known Issues

  • When running on Windows and generating the dispatcher configuration, you should be running in an elevated command prompt or the Windows Subsystem for Linux (see #329).

  • When executing the archetype in interactive mode (without the -B parameter), the properties with default values cannot be changed, unless the final confirmation gets dismissed, which then repeats the questions by including the properties with default values in the questions (see ARCHETYPE-308 for details).

  • You can't use this archetype in Eclipse when starting a new project with File -> New -> Maven Project since the post generation script archetype-post-generate.groovy will not be executed due to an Eclipse issue. Workaround is to use the above command line and then in Eclipse use File -> Import -> Existing Maven Project.

aem-project-archetype's People

Contributors

adobe-bot avatar barshat7 avatar bosschaert avatar bpauli avatar buuhuu avatar cjelger avatar cziegeler avatar dependabot[bot] avatar dulvac avatar eglistefan avatar feikevisser avatar gabrielwalt avatar godanny86 avatar herzog31 avatar joerghoh avatar justinedelson avatar krystiannowak avatar lsantha avatar mhaack avatar msagolj avatar niekraaijmakers avatar pankaj-parashar avatar richardhand avatar rombert avatar sakshi-arora1 avatar samuelmeuli avatar stefanseifert avatar suryansh29 avatar vladbailescu avatar wimsymons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aem-project-archetype's Issues

Integration Tests execute twice

When running mvn clean install -PautoInstallPackage,integrationTests I see the following output in the maven log, and it appears the integration tests are executing twice.

2421 [main] INFO org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient - Executing test remotely, path=/com.test.it.tests.json JUnit servlet URL=http://localhost:4502/test/sling/1446666680947.junit
2437 [main] INFO org.apache.sling.junit.remote.testrunner.SlingRemoteTestRunner - Server-side tests executed as admin at http://localhost:4502/test/sling/1446666680947.junit with path /com.test.it.tests.json
Running com.test.it.launcher.SlingServerSideTest
2440 [main] INFO org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient - Executing test remotely, path=/com.test.it.tests.json JUnit servlet URL=http://localhost:4502/test/sling/1446666680947.junit
2454 [main] INFO org.apache.sling.junit.remote.testrunner.SlingRemoteTestRunner - Server-side tests executed as admin at http://localhost:4502/test/sling/1446666680947.junit with path /com.test.it.tests.json

This can be verified by attaching a remote debugger and setting a breakpoint in the test class.

SimpleServlet not working

I don't think that SimpleServlet is working.
I can't find the text it is supposed to output at the page.

Could you please re check this?
If it does work for you, could you tell me where did you find the outputted text and AEM version?

Thanks

Local build instructions in README.MD

local installation instructions would help developers use the pre-release versions of this archetype

Building

To compile and use an edge, local version of this archetype:

mvn clean install archetype:update-local-catalog

mvn archetype:generate \
 -DarchetypeCatalog=local
 -DarchetypeGroupId=com.adobe.granite.archetypes \
 -DarchetypeArtifactId=aem-project-archetype \
 -DarchetypeVersion=9-SNAPSHOT.

Failed publishing "Item is protected" using New MultiModule Project wizard

I tried using the new project wizard and created the aem-project-archetype-10 project and deploy to a quickstart, and saw the following error message during publish.

Failed publishing path=/, result=JcrResult[ success:false, exception: org.apache.sling.ide.transport.RepositoryException - javax.jcr.nodetype.ConstraintViolationException: Item is protected]

OSGi bundle not getting uninstalled in case un-installation is done after new version installation of AEM package

When we are overwriting a new package with new version, on un-installation the OSGi bundle is not getting removed from web console. Following are the steps to reproduce.

  1. Create a new multimodule project from AEM Plugin
  2. Build and deploy to AEM instance in Package Manager. (OSGi console shows bundle with version A)
  3. Change the version of project created in step 1 to something different say B.
  4. Build and deploy to AEM instance in Package Manager (OSGi console shows bundle with version B)
  5. Uninstall the AEM package from Package Manager.
  6. Notice that OSGi console still shows bundle with version B. It should be version A.

Also refer issue raised on AEM Plugin Page. This has some analysis done on this issue.

From the archetypes list

Following works fine

<groupId>com.day.jcr.vault</groupId>
<artifactId>multimodule-content-package-archetype</artifactId>

While following does not

<groupId>com.adobe.granite.archetypes</groupId>
<artifactId>aem-project-archetype</artifactId>

The aem-project-archetype generates extra exclude pattern

<filter root="/apps/myapp">
    <exclude pattern="/apps/myapp/install" />
</filter>

This exclude pattern is not present in the multimodule-content-package-archetype

Did few tests, after we remove this from filter, the aem-project-archetype works fine, not sure if there would be any side-effects due to this.

Include best practice for clientlib CSS support files

Hi, just a small request, as there is no easy consensus on how clientlibs work. And probably this archetype would be the best way to provide best practice

It is suggested to use Component-Level clientlibs, these are all grouped up by a clientlib at the /etc/design level, which guarantees they are not being exposed from the /apps level

However, this gets a bit blurry when there are images or fonts involved. If lets say component A has the following CSS rule

.bg {
background-image: url(../img/cloud-img.png);}

That resolves to

background-image: url(../../../apps/my-project/components/content/componentA/clientlib/img/cloud-img.png);

despite of the clientlib being offered via /etc/clientlib-all

Whats your take on this case?

Could you add an image folder to the archetype and provide a nice read-me suggesting best practice?

Don't reference the Granite parent pom

I see no particular reason to use an (Adobe) Granite parent pom, as

  • this is an open-source project, so it should not inherit any settings or configurations which are not visible/controllable by all contributors
  • the parent pom is not publicly available, so this prevents at least some contributions and the Travis build from working
  • the parent pom does not add much in terms of functionality for the archetype

outputDirectory in configuration doesn't validate

The 'outputDirectory' configuration for the Felix SCR plugin throws a 'element not allowed here' error in the POM editors; I'm wondering if we need to include an additional namespace?

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <version>1.20.0</version>
                <executions>
                    <execution>
                        <id>generate-scr-scrdescriptor</id>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                        <configuration>
                            <!-- Private service properties for all services. -->
                            <properties>
                                <service.vendor>Adobe</service.vendor>
                            </properties>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-simple</artifactId>
                        <version>1.5.11</version>
                    </dependency>
                </dependencies>
            </plugin>

\t vs N spaces

I'm considering creating a pull request replacing tab characters with spaces. Is \t the adobe best practice for AEM indentation?

Logger configs break Logging

The Logger configs provided in the archetype are breaking the normal logging of the AEM instance. After first deployment of the package, this is what I see as the last line in error.log:

03.10.2014 11:36:41.128 *INFO* [JcrInstaller.1] org.apache.sling.installer.provider.jcr.impl.JcrInstaller Registering resource with OSGi installer: [InstallableResource, priority=200, id=/apps/lego/config/org.apache.sling.commons.log.LogManager.factory.config-mgp]
03.10.2014 11:36:41.183 *INFO* [OsgiInstallerImpl] org.apache.sling.audit.osgi.installer Installed configuration org.apache.sling.commons.log.LogManager.factory.config.b8d6cd0c-e48c-4b73-bf9d-cf189e932318 from resource TaskResource(url=jcrinstall:/apps/lego/config/org.apache.sling.commons.log.LogManager.factory.config-mgp, entity=config:org.apache.sling.commons.log.LogManager.factory.config.mgp, state=INSTALL, attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:27:84:, service.factoryPid=org.apache.sling.commons.log.LogManager.factory.config, service.pid=mgp], digest=491c6b6ab83b703942ffc3a726a9b999)

And everything start to be written in stdout.log aftewards, including these Logger errors:

11:36:41,458 |-INFO in org.apache.sling.commons.log.logback.internal.util.SlingRollingFileAppender[/logs/my-aem-project.log] - Active log file name: /Users/cbuzoiu/cq/instances/
sp1/crx-quickstart/logs/my-aem-project.log
11:36:41,458 |-INFO in org.apache.sling.commons.log.logback.internal.util.SlingRollingFileAppender[/logs/my-aem-project.log] - File property is set to [/Users/cbuzoiu/cq/instanc
es/sp1/crx-quickstart/logs/my-aem-project.log]
11:36:41,458 |-INFO in LogWriter{configurationPID='null', fileName='/Users/cbuzoiu/cq/instances/sp1/crx-quickstart/logs/my-aem-project.log', logNumber=7, logRotation=''.'yyyy-MM
-dd'} - Completed configuring appender with name /Users/cbuzoiu/cq/instances/sp1/crx-quickstart/logs/my-aem-project.log
11:36:41,459 |-ERROR in org.apache.sling.commons.log.logback.internal.LogbackManager@47befe3d - Error occurred while configuring Logback java.lang.IllegalArgumentException: Cann
ot format given Object as a Date
        at java.lang.IllegalArgumentException: Cannot format given Object as a Date
        at      at java.text.DateFormat.format(DateFormat.java:301)
        at      at java.text.Format.format(Format.java:157)
        at      at java.text.MessageFormat.subformat(MessageFormat.java:1313)
        at      at java.text.MessageFormat.format(MessageFormat.java:860)
        at      at java.text.Format.format(Format.java:157)
        at      at java.text.MessageFormat.format(MessageFormat.java:836)
        at      at org.apache.sling.commons.log.logback.internal.LogConfig.createLayout(LogConfig.java:124)
        at      at org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.addLogConfig(LoggerSpecificEncoder.java:72)
        at      at org.apache.sling.commons.log.logback.internal.LogConfigManager.onResetComplete(LogConfigManager.java:290)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.fireResetCompleteListeners(LogbackManager.java:268)
        at      at org.apache.sling.commons.log.logback.internal.OsgiInternalAction$ConfigCompleteListener.inPlay(OsgiInternalAction.java:158)
        at      at ch.qos.logback.core.joran.spi.InterpretationContext.fireInPlay(InterpretationContext.java:183)
        at      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:61)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager$DefaultCallback.perform(LogbackManager.java:604)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:325)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:305)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.access$300(LogbackManager.java:51)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager$1.run(LogbackManager.java:252)
        at      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at      at java.lang.Thread.run(Thread.java:745)
11:36:41,459 |-WARN in org.apache.sling.commons.log.logback.internal.LogbackManager@47befe3d - No previous configuration to fall back on.

Issue with apps package filters

Any reason for the /apps/install package being excluded in the apps filters?

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/apps/${appsFolderName}">
        <exclude pattern="/apps/${appsFolderName}/install" />
    </filter>
    <filter root="/apps/sling" />
    <filter root="/etc/designs/${appsFolderName}"/>
</workspaceFilter>

It causes issues when exporting built packages at a later point. The core.jar file is then not included in builds, which means you have to install that manually on different servers?(We do not only use maven)

mvn install fails in generated project

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project basic.it.launcher: The packaging for this project did not assign a file to the build artifact -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project basic.it.launcher: The packaging for this project did not assign a file to the build artifact
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:497)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: org.apache.maven.plugin.MojoExecutionException: The packaging for this project did not assign a file to the build artifact
[INFO] at org.apache.maven.plugin.install.InstallMojo.installProject(InstallMojo.java:220)
[INFO] at org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:126)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[INFO] ... 20 more
[INFO] [ERROR]
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] [ERROR]
[INFO] [ERROR] After correcting the problems, you can resume the build with the command
[INFO] [ERROR] mvn -rf :basic.it.launcher

Provide dependencies for AEM 6.1

In AEM 6.1 the dependencies JAR moved from

<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>aem-api</artifactId>
    <version>6.0.0.1</version>
</dependency>

to

<dependency>
    <groupId>com.day.cq</groupId>
    <artifactId>cq-quickstart</artifactId>
    <version>6.1.0</version>
    <classifier>apis</classifier>
</dependency>

maven-content-package-plugin does not support 2 active profiles

When you execute

mvn -PautoInstallPackage,autoInstallPackagePublish clean install

You would expect to have the packages installed on both the author instance on port 4502 as the publish instance on port 4503, but that's not true.

It will install the packages twice on the port specified for the last active profile, in this case profile autoInstallPackagePublish, thus port 4503.

...
[INFO] Installing xxxx.ui.apps (/xxxx/ui.apps/target/xxxx.ui.apps-1.0.0-SNAPSHOT.zip) to http://localhost:4503/crx/packmgr/service.jsp
...
[INFO] Installing xxxx.ui.apps (/xxxx/ui.apps/target/xxxx.ui.apps-1.0.0-SNAPSHOT.zip) to http://localhost:4503/crx/packmgr/service.jsp
...

(real filenames and package names stripped out)

At first I thought it was because the profile id is the same on both profiles, but even after changing that, the output remains the same.

Below the section from the pom.xml:

  <profiles>
    <profile>
      <id>autoInstallPackage</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.day.jcr.vault</groupId>
            <artifactId>content-package-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>install-package</id>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
              <failOnError>true</failOnError>
              <failOnMissingEmbed>true</failOnMissingEmbed>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>autoInstallPackagePublish</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.day.jcr.vault</groupId>
            <artifactId>content-package-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>install-package-publish</id>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <targetURL>http://${aem.publish.host}:${aem.publish.port}/crx/packmgr/service.jsp</targetURL>
              <failOnError>true</failOnError>
              <failOnMissingEmbed>true</failOnMissingEmbed>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

Not sure if this is the right place to report this, though.

Wrong reference to servicecomponent in design config

The components property of /etc/designs/<project>/jcr:content/page-home/par misreferences the Service Component as

/apps/ggg/components/servicecomponent

instead of

/apps/ggg/components/content/servicecomponent

Running integration tests fails: Expecting HelloWorldModel to be injected by Sling test runner

  • Generate a project from version 10 of the archetype
  • Start a CQ 6.0 instance
  • Run mvn clean verify -PintegrationTests

Result

Results :

Failed tests:
SlingServerSideTest.testHelloWorldModelServerSide testHelloWorldModelServerSide(com.example.it.tests.HelloWorldModelServerSideTest): Expecting HelloWorldModel to be injected by Sling test runner

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

Warnings when building project

Doing a mvn clean install shows following warnings:

[INFO] --- maven-bundle-plugin:2.5.0:bundle (default-bundle) @ example.it.tests ---
[WARNING] Bundle org.myorg:example.it.tests:bundle:0.0.1-SNAPSHOT : Unused Export-Package instructions: [example.it.tests.*]

and

[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ example.it.launcher ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/username/Documents/workspace/example/it.launcher/target/example.it.launcher-0.0.1-SNAPSHOT.jar

semantic versioning defaultValue

The default value of ${version} might be better served for users if it defaulted to a semver[1] heuristic.

archetype-metadata.xml

    <requiredProperty key="version">
        <defaultValue>0.1.0-SNAPSHOT</defaultValue>
    </requiredProperty>

[1]http://semver.org/

Integration Tests break AEM server

When running integration tests the AEM package manager does not work anymore. It's because task installs old versions of httpclient-osgi and httpscore-osgi. As a workaround the pom.xml in launcher project can be modified by commenting the bundles. Integration tests work without installing these bundles.

<sling.additional.bundle.7>httpclient-osgi</sling.additional.bundle.7>
<sling.additional.bundle.8>httpcore-osgi</sling.additional.bundle.8>

Warning when building project in Eclipse

In the AEM Developer Tools, when starting a Run as > Maven install, then following warning is displayed in the Problems panel:

Description: No grammar constraints (DTD or XML Schema) referenced in the document.
Resource:    TEST-org.myorg.example.core.impl.TestHelloServiceImpl.xml
Path:        /example.core/target/surefire-reports
Location:    line 1
Type:        XML Problem

Centralise and update maven plugin versions

Move all of them to the parent/reactor pom and then bump to the latest versions. Especially the maven-resources-plugin would be nice to get to avoid the annoying

[debug] execute contextualize

Custom 404 Handler Returns HTTP 200

https://github.com/Adobe-Marketing-Cloud/aem-project-archetype/blob/master/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/sling/servlet/errorhandler/404.jsp

Teams using this archetype may encounter issues with this custom 404 handler as it returns HTTP 200 OK. Some hosting providers may leverage a healthcheck system or load balancing strategy which depends on a guaranteed non-existing page, and expect HTTP status code 404 to be served from a running AEM instance.

logger configured in archetype project

I created a new project with archetype 7, and find out I cannot find any output in error.log.
After investigation we find a dedicated logger is created for the log, and its log level is set to Error.

I have three suggestions here:
(1) the logger level is better to be Info or debug. Error is normally only used for project live env.
(2) In my case I only need back end coding for the project. but there is no specific archetype for it, so that I have to create the project with one available archetype and remove stuff not being used.
(3) sample-project-archetype 5, 6 or 7 is hard for users to tell the distinctions between them.

Installing bundle fails due to PUT method

Hi,

when using the archetype out-of-the-box, it is impossible to install the core bundle into a running AEM server using the maven-sling-plugin:

$ mvn -PautoInstallBundle sling:install
[..]
[INFO] Installing Bundle com.aperto.aem-example.core(/Users/joerg.frantzius/eclipse-workspaces/aem-training/aem-example/core/target/aem-example.core-0.0.1-SNAPSHOT.jar) to http://localhost:4502/crx/repository/crx.default/apps/aemexample/install/ via PUT
[..]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[..]
[ERROR] Failed to execute goal org.apache.sling:maven-sling-plugin:2.1.0:install (default-cli) on project aem-example.core: Installation on http://localhost:4502/crx/repository/crx.default/apps/aemexample/install/ failed, cause: Installation failed, cause: Method Not Allowed -> [Help 1]

When I change the maven-sling-plugin configuration to <usePut>false</usePut>, then the bundle install works as expected.

Maybe that's a bug either in the maven-sling-plugin implementation or documentation, as its documentation says that usePut is false by default.

AEM 5.6.1 support

By default this archetype creates a project for aem 6.0.0.1. Can we have support to create a project for aem 5.6.1 as well?

What is the purpose of the ui.content subproject? how do you prevent it from overwriting author generated content?

Hi, just that small question I have

I just noticed that if an author creates a page via WCM/CRXDE i won't have those changes in my codebase, and hence I run into the risk of replacing that content whenever I deploy the whole project.

Could someone tell me whats the goal of it? Is there a setting/flag for when I want to deploy to Staging/Production environments? Or does this assume that I will be building a package manually that DOES NOT include /content?

Maven compiler plugin config defaults to Java 6

Upon generating a project based on this archetype, the maven-compiler-plugin configuration in the resulting pom.xml defaults to Java 6

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

Whereas the currently supported versions of AEM require Java 7 or higher. It seems reasonable to me that the defaults to be changed to 1.7 or perhaps 1.8 (given how Oracle Java 7 reached end of life as of May 2015) in terms of both source and binaries.

Is there a reason to keep these defaults lower?

Error handler not working with SP2

Hi, I just run the project as is and had it working on AEM 6.0.0. After installing SP2 the error handler for missing pages will not fire and it will default to the one from Apache Sling.

This is the cause

Caused by: java.lang.IllegalArgumentException: Argument cannot be null if path is not absolute: resource.js
at io.sightly.java.api.ResourceResolution.resolveComponent(ResourceResolution.java:101)
at io.sightly.java.api.ResourceResolution.resolveComponentRelative(ResourceResolution.java:60)
at io.sightly.js.JsEnvironment.run(JsEnvironment.java:93)
at io.sightly.js.use.DependencyResolver.resolve(DependencyResolver.java:54)
at io.sightly.js.use.UseFunction.use(UseFunction.java:78)
at io.sightly.js.use.UseFunction.call(UseFunction.java:66)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine.eval(RhinoJavaScriptEngine.java:116)

Any ides as to what si breaking this?

TypeKit Console Errors

Not a big deal but the following error appears in the browser console for any We.Retail site page:

dje4ayd.js:48 Typekit: the domain [domain-name] isn't in the list of published domains for kit "dje4ayd".

Basically, our UNIT test server isn't in your TypeKit's (ID: dje4ayd) publish domain list. I went to create my own TypeKit for our test environments but the font being used (Proxima Nova) is a premium-only font, so I can't even technically replace your TypeKit ID with my own to get this to work properly.

Maybe I'm just being OCD about clean console output. If so, I apologize.

EDIT: I apologize, too many tabs open, wrong repo. This is embarassing.

Stray JSP Tag in Sightly Page Template

In the file aem-project-archetype/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/appsFolderName/components/page/page/page.html

There is still a JSP tag in there: <meta http-equiv="keywords" content="<%= WCMUtils.getKeywords(currentPage) %>">

I'm honestly not sure how to grab the keywords using Sightly, so I'm curious to see what the Sightly way of doing that is! :)

Advantages of using clientlib-all instead of single category to unify clientlibs.

I was looking at the clientlib-all and it seems to create a problem: every time a new component (with clientlib) is created, it is required to explicitly add in there.
I understand this gives flexibility to import the files in order.
I want to know if this gives anymore advantages when compared with putting all the components clientlibs in the same category.

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.