You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何阻止Broadleaf Heat Clinic演示站点加载初始数据,搭建空商店?

How to Set Up a Blank Broadleaf Heat Clinic Store (No Demo Data/Catalog, Only Admin Roles)

Got it, let's break down exactly how to configure your Broadleaf Heat Clinic instance to skip all initial demo data, catalogs, and translations—while keeping the admin roles and permissions intact so you have a clean, empty store to work with.

1. Disable Initial Data Loaders

Broadleaf uses data loader beans to populate initial data on startup. You'll need to disable the ones responsible for demo content, while keeping the admin security-related loaders active:

  • Navigate to your project's core configuration files (typically core/src/main/resources/broadleaf-framework-applicationContext.xml or similar).
  • Locate beans like blCatalogDataLoader, blCustomerDataLoader, blTranslationDataLoader, and any demo-specific loaders (e.g., blHeatClinicDemoDataLoader).
  • Set enabled="false" on these beans, or comment them out entirely.
  • Important: Leave beans like blAdminSecurityDataLoader enabled—this ensures admin roles (e.g., ROLE_ADMIN) and permissions are still created.

2. Remove Demo Catalog & Translation Files

Even if loaders are disabled, it's safe to delete the actual demo data files to avoid any accidental loading:

  • Delete all files under heatclinic-site/src/main/resources/data/catalog/ (this is where the demo product catalog lives).
  • Remove translation files from heatclinic-site/src/main/resources/data/translation/ to eliminate demo language content.
  • Keep the data/admin/ directory intact—this contains the admin role/permission data you need.

3. Adjust Liquibase Changelogs (If Applicable)

If your setup uses Liquibase for database migrations, check for demo-specific changelogs:

  • Open the main Liquibase changelog file (usually liquibase/master.xml).
  • Remove any references to demo data changelogs (e.g., changelog/demo-catalog-changelog.xml).
  • Ensure changelogs related to admin security (like changelog/admin-security-changelog.xml) remain in place.

4. Add Runtime Configuration (Optional)

For an extra layer of safety, you can add a JVM argument when starting the app to explicitly disable demo data:

-Dbroadleaf.demo.data.enabled=false

Or if you're using Spring Boot, add this to your application.properties:

broadleaf.demo.data.enabled=false

5. Verify the Setup

After making these changes, start your application and:

  • Log into the admin panel using the default admin credentials (usually admin/admin).
  • Check that the catalog section is empty—no products, categories, or demo content should be present.
  • Confirm admin roles and permissions are still available under the "Security" tab.

内容的提问来源于stack exchange,提问作者IgorF

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:38:48