Skip to content

Commit

Permalink
Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Jul 29, 2024
1 parent f2c6b49 commit 7479883
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 42 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2024 VML Enterprise Solutions

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,23 @@ Main concepts of AEM Stubs tool are:

## Installation

Simply install ready to use AEM package downloaded from GitHub [releases](https://github.com/wttech/aem-stubs/releases) section.
The ready-to-install AEM packages are available on [GitHub releases](https://github.com/wttech/aem-stubs/releases).

There are two ways to install AEM Stubs on your AEM instances:

1. Using the 'all' package:
* Recommended for fresh AEM instances.
* This package will also install AEM Groovy Console and AEM Stubs examples.
2. Using the 'minimal' package:
* Recommended for AEM instances that already contain some dependencies shared with other tools.
* This package does not include Groovy bundles, which can be provided by other tools like [AEM Easy Content Upgrade](https://github.com/valtech/aem-easy-content-upgrade/releases) (AECU) or [AEM Groovy Console](https://github.com/orbinson/aem-groovy-console/releases).

### Post installation steps

Remember that using AEM Stubs on AEM Publish instances may require an additional configuration.
Remember that using AEM Stubs on AEM Publish instances through AEM Dispatcher may require an additional configuration.

In case of WireMock, ensure that AEM Stubs Filter prefix `/stubs` is not filtered by AEM Dispatcher configuration. Alternatively, by creating OSGi configuration, update that path prefix to path which is already accessible.
Simply ensure that AEM Stubs Filter prefix `/stubs` (configured in [AEM Stubs HTTP Filter](https://github.com/wttech/aem-stubs/blob/main-v4/core/src/main/java/com/wttech/aem/stubs/core/StubFilter.java) is not filtered by AEM Dispatcher configuration.
Alternatively, by creating OSGi configuration, update that path prefix (or regex pattern) to the something which is already accessible.

## Compatibility

Expand Down Expand Up @@ -76,8 +86,8 @@ via CRX package with corresponding Vault workspace filter:

### OSGi configuration

[Stub Filter](http://localhost:4502/system/console/configMgr/com.wttech.aem.stubs.core.StubFilter)
[Stub Repository](http://localhost:4502/system/console/configMgr/com.wttech.aem.stubs.core.StubRepository)
[AEM Stubs HTTP Filter](http://localhost:4502/system/console/configMgr/com.wttech.aem.stubs.core.StubFilter)
[AEM Stubs Repository](http://localhost:4502/system/console/configMgr/com.wttech.aem.stubs.core.StubRepository)

### Stub script API

Expand Down
22 changes: 17 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,24 @@ tasks:
desc: build AEM package
cmd: mvn clean install

deploy:
desc: deploy AEM package to AEM instances
deploy:all:
desc: deploy all AEM package to AEM instances
cmd: sh aemw package deploy --file "all/target/stubs.all-*.zip"

develop:
desc: build & deploy AEM packages to instances
deploy:min:
desc: deploy minimal AEM package to AEM instances
cmd: sh aemw package deploy --file "min/target/stubs.min-*.zip"

develop:all:
desc: build & deploy all AEM package to instances
cmds:
- task: build
- task: deploy:all

develop:min:
desc: build & deploy minimal AEM package to instances
cmds:
- task: build
- task: deploy
- sh aemw package deploy --url 'https://github.com/orbinson/aem-groovy-console/releases/download/19.0.5/aem-groovy-console-all-19.0.5.zip'
- task: deploy:min
- sh aemw package deploy --file 'ui.content/target/stubs.ui.content-4.0.0-SNAPSHOT.zip'
17 changes: 1 addition & 16 deletions all/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
<!--
| Copyright 2019 Adobe Systems Incorporated
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
Expand All @@ -34,7 +19,7 @@
<artifactId>stubs.all</artifactId>
<packaging>content-package</packaging>
<name>AEM Stubs - All</name>
<description>All content package for AEM Stubs</description>
<description>Complete distribution package for AEM Stubs</description>

<!-- ====================================================================== -->
<!-- B U I L D D E F I N I T I O N -->
Expand Down
15 changes: 0 additions & 15 deletions all/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2019 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<workspaceFilter version="1.0">
<filter root="/apps/stubs-packages"/>
<filter root="/apps/stubs-vendor-packages"/>
Expand Down
167 changes: 167 additions & 0 deletions min/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- ====================================================================== -->
<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<parent>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs</artifactId>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<artifactId>stubs.min</artifactId>
<packaging>content-package</packaging>
<name>AEM Stubs - Minimal</name>
<description>Minimal distribution package for AEM Stubs</description>

<!-- ====================================================================== -->
<!-- B U I L D D E F I N I T I O N -->
<!-- ====================================================================== -->
<build>
<plugins>
<!-- ====================================================================== -->
<!-- V A U L T P A C K A G E P L U G I N S -->
<!-- ====================================================================== -->
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>com.wttech.aem.stubs</group>
<packageType>container</packageType>
<!-- skip sub package validation for now as some vendor packages like CIF apps will not pass -->
<skipSubPackageValidation>true</skipSubPackageValidation>
<embeddeds>
<embedded>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs.ui.apps</artifactId>
<type>zip</type>
<target>/apps/stubs-packages/application/install</target>
</embedded>
<embedded>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs.ui.config</artifactId>
<type>zip</type>
<target>/apps/stubs-packages/application/install</target>
</embedded>
<embedded>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs.core</artifactId>
<target>/apps/stubs-packages/application/install</target>
</embedded>
</embeddeds>
</configuration>
</plugin>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<verbose>true</verbose>
<failOnError>true</failOnError>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>auto-clean</id>
<phase>initialize</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<!-- ====================================================================== -->
<!-- P R O F I L E S -->
<!-- ====================================================================== -->
<profiles>
<profile>
<id>autoInstallSinglePackage</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>
<configuration>
<targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>autoInstallSinglePackagePublish</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>
<configuration>
<targetURL>http://${aem.publish.host}:${aem.publish.port}/crx/packmgr/service.jsp</targetURL>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<!-- ====================================================================== -->
<!-- D E P E N D E N C I E S -->
<!-- ====================================================================== -->
<dependencies>
<dependency>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs.ui.apps</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs.ui.content</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>com.wttech.aem.stubs</groupId>
<artifactId>stubs.ui.config</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
</dependencies>
</project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions min/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/stubs-packages"/>
<filter root="/apps/stubs-vendor-packages"/>
</workspaceFilter>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<description>AEM Stubs</description>
<modules>
<module>all</module>
<module>min</module>
<module>core</module>
<module>ui.apps</module>
<module>ui.apps.structure</module>
Expand Down

0 comments on commit 7479883

Please sign in to comment.