1. Ensuring that component/ servelet works in specific environment only
There are several workarounds to it. But the suggested solution is to bind a configuration policy with your component which might be a service, servlet, job, workflow etc. The declaration looks like this-
@Component(policy=ConfigurationPolicy.REQUIRE)
Now, you need to create configuration settings file for only those environment where you want your component to work i.e. runmode based configuration file. For example if you want your component to work only in authoring environment then create a configuration file for your component under "/apps/{yourProjectCodeRoot}/config.author".
2. Configuration preferences order
Resolution order at startup-
- /apps/*/config
- /libs/*/config
- crx-quickstart/launchpad/config
Resolution order at runtime-
- Chnage in OSGi console
- /apps/*/config
- /libs/*/config
3. Runmode preferences order
There are several methods for specifying which run mode to use; the order of resolution is:
- sling.properties file
- -r option through command line
- system properties (-D) in start up script
- Filename detection/ Jar name
4. Production Ready Mode
If you start AEM instance with "nosamplecontent" runmode, it will ensure that by default the instance is pre-configured with major security measures.
5. AEM instance behavior to author/ publish
Behavior of an AEM instance is driven by the run mode. For authoring instance- run mode must be set to "author". For publisher instance- run mode must be set to "publish". "author, publish, samplecontent, nosamplecontent" - are the Installation run modes. They can not be changed after installation.
In addition, the "Day CQ WCM Filter" should be set to "edit" on author and "disabled" on publish instances from the OSGi console or through the OSGi configuration file.
The simple way to integrate the two is - "Analyzing with the SonarQube Scanner for Maven". Follow the instructions on the above link. When setting up the Build profile in Jenkin set the Goal as shown in below snapshot-
In addition, the "Day CQ WCM Filter" should be set to "edit" on author and "disabled" on publish instances from the OSGi console or through the OSGi configuration file.
6. Linking SonarQube with Jenkins
Refer the instruction on the SonarQube website- https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+JenkinsThe simple way to integrate the two is - "Analyzing with the SonarQube Scanner for Maven". Follow the instructions on the above link. When setting up the Build profile in Jenkin set the Goal as shown in below snapshot-
7. Accessing AEM logs
You can use this URL- http://{host:port}/system/console/slinglog/tailer.txt?tail=500&name=/logs/error.log
No comments:
Post a Comment