How to deploy hybris with storefront addon - deployment

We are using the b2bacceleratoraddon and commerceorgaddon addons in our hybris 6.5.0.1.
For the local development it is enough to run the ant addoninstall command.
But what is the official way to integrate these addons in a deployment process? We tried to check-in the generated sources in the repository but that does not seem to work.
We don't want to manually install the plugin after every deployment.
Also, as we are doing our deployments with ydeploy, is there a way to integrate this in the ydeploy process?

The ant addoninstall task is meant to be executed only once. It manipulates some files die the addon to work correctly. These files are:
myaddon/project.properties
mystorefront/extensioninfo.xml
The first file is created with properties that register the addons JavaScript and CSS sources as well as a property which includes the addons spring web context in the storefronts web context.
In the second file it created a dependency from the storefront to the addon. That way during startup spring beans of the addon are created before the storefront beans are created. Also during build, hybris copies the addons web sources into designated folders in the storefront extension.
So as long as you deploy these files along with the other files, you can skip the addoninstall task.

You have a file called localextensions.xml inside the hybris config folder where you can select the extensions that your project will use.

Related

Hot-deploy Liferay 7 webapp resource (JavaScript/CSS/HTML)

I am developing a Liferay 7 portlet with bundled Tomcat 7.
To deploying a portlet, I copy the war file into deploy folder under Liferay home folder, and then I have to wait a lot of minutes to see my file modified.
Usually I work only on javascript, css and html, I want to see immediately what I changed, then, is there a way to have hot deploy for webapp resource?
Thanks
You should use the Liferay workspaces and modules. If it is a theme, the gulp watch task will help.
Liferay cache all resources by default, because that you have to wait a lot of time to see the changes. You have 3 ways to force Liferay to delete this cache.
Before deploy the module you must delete the module cache folder. This is in the following path (this applies to js and jsp resources):
liferay-ce-portal-7.0-ga3/work/your_module_name
Delete the module cache servlet folder located in:
liferay-ce-portal-7.0-ga3/tomcat-8.0.32/work/Catalina/localhost/ROOT/css/http_/o
/your_module_name
The other option is enter in Liferay Control Panel and click the cache action tasks:

update code and reflect the changes in AEM CQ5

How to see instantly update the code and see that it is reflected without firing up Maven Clean Install again and again in AEM CQ5 project? I know it can be possible through JRebel in normal Java projects. But I am not sure in AEM Projects.
As mentioned by jiggy, code changes in /apps(component jsps ..), /etc (css, js..), etc can be synced with AEM using vault plugin. This does not require rebuild/package/deploy to AEM using 'mvn clean install'.
Server side(java files) changes however requires firing up 'maven clean install' and installing the new generated bundle either manually or automatically via profiles in maven POM to AEM.
You can sync repository items with vault. One at a time or with vault sync. There vault plugins available for both Eclipse and IntelliJ.

How to deploy generated resources to tomcat with m2e-wtp?

I am pulling JavaScript from a jar as part of my build process. I wish this js to be part of my web resources for the app deployed on tomcat and I have updated my build process to allow this to happen. Doing a maven build (outside eclipse) works as expected and I can package up a war with everything in its proper order.
However, when building with eclipse I have run into some headaches. My understanding was in order to have web resources deployed to tomcat through an incremental build, I needed to put these build-time generated js files into the target/m2e-wtp/web-resources directory. However, when I publish these new files are ignored and the web-resources deployed to tomcat seem to be pulled from my source.
I also adjusted my project's deployment assembly settings. Through this I still don't have it working. I have the entry [source:/target/m2e-wtp/web-resources, DeployPath:/] which should find the newly generated files when I perform a "publish" to the server. However, the same thing happens where m2e-wtp seems to be pulling from source.
Am I missing something? How can I get standard behavior from m2e-wtp (i.e. make it comparable to a build done outside of eclipse)? Or can I have eclipse just build the war and deploy it as such (not do the incremental builds, I can sacrifice some speed)?
FYI (versions):
eclipse: (Using Spring Tool Suite) 3.2.0
m2e: 1.3.1
m2e-wtp: 0.17.0
tomcat: 7.0
Experiment added later:
After deleting my target dir, I performed a publish to Tomcat and all the web-resources were copied from my source. I also got a popup about files not found, most of which are compiled classes. However, it was looking for three files in the /target/m2e-wtp/web-resources/META-INF. Does the m2e-wtp plugin only look for specific files in a folder rather than the entire specified folder?
The problem is that the target directory was not being refreshed. Eclipse (or m2e plugin for that matter) doesn't recognize or care that files change in the target directory during a build, something that I was assuming. For now I have the auto-refresh (for the workspace) option on. The refresh on access option didn't working as it seemed to trigger the refresh only when I was publishing to tomcat for the first time.

Exporting RCP as a product

I am deploying my eclipse rcp product into some folder say C:\deploy\eclipse.
But
Here i am facing a problem,while i was exporting to the same location it says export failed,
Since my project is in development stage each time i do changes in the code,i need to deploy to perform unit testing its pretty time consuming.All that i want to achieve is just override the same deployed location, i don't know if it is possible? The current approach was just go and delete the currently deployed folder and then export again, this is odd i guess, can someone drive me in a better approach
I suggest to setup a headless build which means that you're able to trigger a build of your RCP application from the commandline. Once you've established a headless build you can write some sort of batch file which for example cleans up the deployment directory before the build.
You can integrate this batch file in your Eclipse IDE via External Tools.
Here is a tutorial on how to setup a headless build.

Best practice for handling environment specific settings for a Java web app?

I have a Java web app that offloads some environment specific settings (Hibernate configurations, required directory paths, etc.) in a properties file that is ultimately packaged in the deployed WAR. If I wish to distribute this web app, what's the best way to handle the mangement of these settings? It's not feasible to ask the user to open up the WAR, update the properties file, repackage the WAR, and then deploy. I was thinking of either creating an installer (e.g. NSIS, WiX) that asks for the properties, writes them in the WAR, and then asks for the deployment location for the WAR. The other option is to have the properties file external to the WAR, and based on convention the web app will know where to read the file. What's the best practice in this case?
Some projects that require this sort of configuration, and face this issue, use the approach of building the projects (and the .war) on the server where it will be deployed.
So instead of:
Copy a pre-packaged .war file to a meaningful location
You get:
Check source code out of SCM (Subversion, CVS, etc.)
Configure to taste
Build the project (automated with Maven or Ant)
Deploy the project (also typically automated using Maven or Ant)
From here you can get fancy by checking each server's configuration files into SCM as well. This approach allows you to version & audit configuration changes.
I was also facing the same problem in the project. The developer before me had done crude fix for the solution which was adding all the required configuration in the hibernate.hbm.cfg.xml file and commenting them. The required configurations were uncommented as per the need. There is a better solution to problem however.
Use a configuration folder schema
Using configuration Parameter Reader
Use of ConfigurationReader component
Source : http://www.javaworld.com/javaworld/jw-11-2004/jw-1108-config.html