Readme:
This project is based on the Broadleaf Commerce demo: https://github.com/BroadleafCommerce/DemoSite
-
Windows 10
-
Ubuntu with :
-
Java
-
Maven
-
Visual Studio Code
-
Vscode Extension:
- Mobioos Forge (extension id: Mobioos.mobioos-forge)
- Extension Pack for Java (extension id: vscjava.vscode-java-pack)
- Dependency Analytics (extension id: redhat.fabric8-analytics)
-
Clone the GitHub repository to your directory
-
Delete the .git file, as Mobioos will attempt to create a branch for each variant created in this repository.
-
Open the project in Vscode
-
There are 2 options:
- have the variants created on GitHub -> Initialize a public GitHub repository
- have the variants created locally -> do nothing
-
Click on the M of Mobioos Forge Explorer in the left vertical bar
-
A tab named "BroadleafCommerce" will appear
In the Mobioos Forge Explorer tab, right-click on "BroadleafCommerce" -> MF: Design the feature model. A new tab will open with the diagram.
Go to BroadleafCommerce -> DemoSite -> site -> src\main and click on individual files.
- no color = not mapped (because it's essential or not relevant to the user but potentially unused in certain variants)
- a color = mapped, hover over it and the corresponding feature name for that code will appear.
-
In the Mobioos Forge Explorer tab, scroll down to "Customization Scenarios" and click on the "+" icon on the right of the title
-
Enter the name of your configuration and press Enter (It should be a name that is not already taken. To see the list of already created configurations, expand the "Customization Scenarios" tab)
-
A new tab will appear. Some checkboxes are already checked in yellow, which are the minimum elements required for the site to function properly. You can add options by clicking on them. (Some options depend on others, like "Login" and "Customer Account Informations," so if you want one, the other will be automatically checked.)
-
Click on "Save"
Sometimes Mobioos fails to delete the previous variant with the same name. To delete it, go to
Users\YourUsername\mobioos-forge-customizations
-
Click on "Generate": There are 2 possibilities depending on your choice above:
- If you want your variant on a GitHub branch, make sure your current branch is committed. Enter the name of the branch that will be created and wait for the variant to be pushed. (Do not rely on the notification that says it is being pushed, go directly to your browser to check if it's done). Go to the desired branch (refresh the GitHub information to make the branch appear in Vscode)
- If you want your variant locally, press Esc when prompted for the branch name. Click on the pop-up on the right that offers to open the created project in Vscode. The variant is by default stored at
Users\YourUsername\mobioos-forge-customizations
-
Now that the variant is created, there are 2 options:
-
Quick: Open a terminal and enter:
cd DemoSite ; mvn clean install ; cd site ; mvn spring-boot:run ; mvn spring-boot:run ; mvn spring-boot:run
-
Step-by-step: go to the "DemoSite" directory, open a terminal, and launch the compilation with
mvn clean install
(It may fail, relaunch it if necessary. If it continues to fail after several attempts, try moving on to the next step, sometimes it still launches.)
Go to the "site" folder and launch in a terminal:
mvn spring-boot:run
(If you stop the program with Ctrl + C, the port remains open, so when you try to relaunch it, an error will appear. It's not a problem, just relaunch the command again, maximum 3 times).
-
-
Connect to the client site:
In http with port 8080
In https with port 8443
For connecting elsewhere, see the other ports on the Broadleaf Commerce Demo GitHub
-
Shutdown the server:
Ctrl + C in the terminal.
Then don't forget to confirm.