inspire-software / yes-cart

YesCart - pure eCommerce
http://www.yes-cart.org
Apache License 2.0
107 stars 79 forks source link

Environment specific builds (mvn install -Pci) #47

Closed Mohankonnect closed 6 years ago

Mohankonnect commented 6 years ago

Hi, When i run mvn install -Pci in command line. it shows the following error..

 [echo] YC module yes-cart-3.5.0-SNAPSHOT-rev.${buildNumber} configurations:
 [echo] 
 [echo] Environment configuration (use -Denv=x to switch)                 : ci
 [echo] Database provider (use -Pmysql or -Pderby)                        : ${env.db}
 [echo] Full text search provider (use -PftEmbededLucene or -PftDisabled) : ${env.search}
 [echo] Tomcat SSL configuration (use -Pssl)                              : off
 [echo] JAM npm goal (use -Dnpm.goal=x to switch)                         : build.prod
 [echo] JAM npm target (use -Dnpm.target.home=x to switch)                : prod (typescript/dist/prod)
 [echo] JAM npm modules (use -Dnpm.target.modules=x to switch)            : node_modules_prod (typescript/node_modules_prod)
 [echo] 
 [echo] Payment modules
 [echo] LiqPay payments (use -PpaymentLiqPay or -PpaymentAll)             : off
 [echo] Cybersource payments (use -PpaymentCybersource or -PpaymentAll)   : off
 [echo] Authorize.Net payments (use -PpaymentAuthorize or -PpaymentAll)   : off
 [echo] PayPal payments (use -PpaymentPaypal or -PpaymentAll)             : off
 [echo] PostFinance payments (use -PpaymentPostFinance or -PpaymentAll)   : off
 [echo] 
 [echo] Add-on modules
 [echo] Marketing price rules integration  (use -Ppricerules)             : off
 [echo] 
 [echo] Web Apps
 [echo] Storefront: ROOT.war
 [echo] REST API  : yes-api.war
 [echo] ADMIN     : yes-manager.war
 [echo] 
 [echo] Tips:
 [echo] * use mvn help:all-profiles or help:active-profiles to list profiles available
 [echo] * use mvn dependency:tree to list all dependencies
 [echo] * documentation for YC profiles is available at:
 [echo] http://www.inspire-software.com/documentation/wiki/docyescart/view/3.3.x/For%20Technical%20Users/Installation/From%20source/
 [echo] ==============================================================

[INFO] Executed tasks [INFO] [INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-required-profiles-are-used) @ yes-cart --- [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireProperty failed with message: == YC build config error =============================================================================== | env.db is missing! | | If you are running custom build using profiles make sure you selected all necessary profiles for DB. | | Possible values: mysql, derby |

[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireProperty failed with message: == YC build config error ======================================================================================= | env.search is missing! | | If you are running custom build using profiles make sure you selected all necessary profiles for FT support. | | Possible values: ftEmbededLucene, ftDisabled |

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Yes Cart ........................................... FAILURE [ 2.465 s] [INFO] Yes cart common API ................................ SKIPPED [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.649 s [INFO] Finished at: 2018-07-26T16:53:25+05:30 [INFO] Final Memory: 28M/1409M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (enforce-required-profiles-are-used) on project yes-cart: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.

Could you please help me to solve this issue..

inspire-software commented 6 years ago

You are not using profiles correctly. "ci" on its own is not enough, which is what the error explains. See the error you posted has this in it:

| env.db is missing! |
| If you are running custom build using profiles make sure you selected all necessary profiles for DB. |
| Possible values: mysql, derby |

You need to specify all profiles as explained in the documentation: http://www.inspire-software.com/documentation/wiki/docyescart/view/3.3.x/For%20Technical%20Users/Installation/From%20source/#HMavenprofilesandvariables

A good place to look for the working example would be the convenience build scripts, e.g. https://github.com/inspire-software/yes-cart/blob/master/makedev.sh

YC is a modular system which is achieved by selecting correct maven profile sets during build. The outcome is fully flexible environment specific builds, with the downside that all profiles must be explicitly stated. The recommendation is to create convenience scripts such as "makedev.sh" that you will use instead of typing mvn install command by hand.