So I spent a bunch of time f***ing around with the demo and the instructions. I finally got it working after trying a bunch of stuff. I took the Broadleaf getting started page pasted it into word and added comments to it, then made a PDF, which I TRIED to attach - did you know that '.pdf' was an illegal attachment! So after f**ing around again just trying to do anything, I simply cut and pasted the word doc below. All the formatting and the pictures were lost but I hope you get some use out of it. Good luck. My comments in bold.
Cheers
Documentation
Answers to your Broadleaf How-to Questions
Getting Started
Overview
Thanks for exploring Broadleaf Commerce! With this tutorial, you'll have your eCommerce site launched in no time. We'll get your environment up and running, show you where things live, and walk you through a few examples of some of the cool things you can do with Broadleaf.
ALL MY COMMENTS IN THIS FONT
Prerequisites
• First, download the Java 8 Development Kit (JDK)
I downloaded and installed this version:
D: >java –version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
Debugging Startup Issues
• You will also need the latest version of Maven (at least version 3.1, version 3.2 is recommended), which you can get on the official Apache Maven site
I downloaded and installed this version:
D: >mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T10:29:23-07:00)
Maven home: d:\bin\apache-maven-3.2.5
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_60\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
Version 3.3.3 did NOT work
Remember to set the environment variable M2_HOME
IDE Setup
Note: The first part of this Getting Started guide will cover using our prepackaged Eclipse workspace. If you are an advanced user and would prefer to set up the project yourself, please feel free to follow the Eclipse Setup or Intellij Setup guide.
I could not get IntelliJ (14) to work the instructions are at least a version of IntelliJ behind.
Once you have the Java SDK installed, we're ready to get your IDE up and running. Let's start by downloading Eclipse.
Download Link: Eclipse IDE for Java EE Developers
I used
Eclipse Java EE IDE for Web Developers.
Version: Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
Once Eclipse is done downloading, extract the archive and start it up. You'll be prompted for a workspace:
Go ahead and accept the initial value.
Note: Don't save this as the default workspace -- we're going to be setting up a new workspace shortly.
Click on Help --> Eclipse Marketplace and search for Maven Integration. Make sure you pick the plugin provided by Eclipse.org as highlighted below:
I checked and in the version of Eclipse (Luna) I downloaded above, this is already there so you don’t have to install this plug-in.
Click Install followed by Next. After that, Accept the License Terms and Finish.
Once the plugin is done installing, you will be prompted to restart Eclipse. Go ahead and do so.
You'll once again be asked for a workspace. This time, we're going to pick a different one. To make getting started with Broadleaf as easy as possible, we've already set up a workspace with some reasonable defaults and tweaks to help you out. Let's download it!
Broadleaf 4.0 workspace Download Link: Broadleaf Eclipse Workspace
This downloads a file named:
DemoSite-4.0.0-GA-eclipse-workspace.zip
Note: If you're not prompted for a workspace, simply go to File --> Switch Workspace and select the path
Extract this archive to the location you want your workspace to live in, and point Eclipse to the appropriate path. This time, your workspace should look like this:
Now we need to import the root ant targets. In the ant view pane, click the 'Add Build Files' button (the button farthest to the left). Select the build.xml from the root DemoSite project and then hit 'Ok':
Before you do the next step, While Importing Projects I got the error
Could not update project core configuration
org.eclipse.wst.common.componentcore.internal.impl.ReferencedComponentXMIResourceImpl cannot be cast to org.eclipse.jpt.common.core.resource.xml.JptXmlResource
On Stackoverflow I found a solution - Thanks StackOverflow!
Disable the active Java EE configurator 'JPA Configurator' under: Preferences -> Maven -> Java EE Integration -> Select active Java EE configurators -> disable 'JPA Configurator'
This allowed the next step, import, to continue without errors. If you don’t do this BEFORE you import it will not work and the only solution I found was to delete the directory and start over.
We now need to import the subprojects, core, site, and admin. We do this by going to File --> Import, and picking Existing Maven Projects, like this:
Click Browse and pick the DemoSite folder as the project root, and click Open
On this screen, make sure you check the Add project(s) to working set box and pick the My Broadleaf Site working set. Also make sure that all four project boxes are checked
This process may take a while. You can see the progress in the bottom right of Eclipse or open the Maven Console for more detail progress reports.
Once the import is complete, you'll have to add two buildfiles, one for site and one for admin. Click on the Add Buildfiles button on the Ant pane
and select the two buildfiles to add:
The last thing to do is configure the path of your local maven installation. This is done in DemoSite/build.properties on the maven.home line.
NOTE Windows users must use forward slashes (/) for paths, not backslashes ()
That's it! Now you have your IDE completely setup to work with Broadleaf Commerce, and your workspace should look like this
Configuring Project Name
Note: Some have reported issues at this step. You can safely skip the "Configuring Project Name" step in its entirety. We are investigating.
The workspace project and maven artifact all refers to "com.mycompany". For your convenience, we've provided an Ant task that will perform all necessary rename and move operations to customize the project to your organization. Simply run the change-identifier Ant task and type in a suitable name.
Note: The name should be two alphabetic strings separated by a dot. For example, "com.heatclinic"
I did not do this step as it sometimes just broke everything! I’ll have to eventually but ….
You will be prompted to confirm your selection. It should identify the Maven Group as the string you typed in and the Company Name as the part after the dot.
Once that task is run, Right click inside Package Explorer --> Refresh.
Note: You will only be allowed to configure the project name via this script once.
Running Site
Now that we have our workspace properly configured, we're able to get our demo site up and running. First, we will have to let Maven fetch the necessary dependencies and install our own project locally. To do that, Right click on DemoSite --> Run As --> Maven Install.
Note: Running a Maven install is only necessary initially. To shorten your development iteration times, you utilize JRebel, which will allow you to modify files without having to restart the server. We've detailed out how to setup JRebel for you.
The build failed on me with errors about the JRE being not found. I discovered that the Java Compiler (Preferences) was set to 1.7. SO, after selecting the 'DemoSite' I went into Window->Preferences->Java-> and set the JDK Compliance level to 1.8.
I then ran RunAs->MavenInstall again and it now failed on the site module. I selected the ‘site’ module in the project window in Eclipse and then went into Preferences. … Window->Preferences-> Java->Compiler and saw that everything was set as 1.8 so I went into ‘Configure Project Specific Settings (on that same page), selected ‘site’ and saw that everything here was 1.8 as well. I click apply and then ok all the way out. I ran ‘RunAs->MavenInstall’ again and it worked. I've built it on a Mac and Windows box and have had to do the same thing each time on each box. Weird.
As well, just as an aside, I don't know what kind of a machine they are using that it took 4+ minutes to build and install but I think it must be a Commadore64 or something.
This process will take a few minutes to execute, and will end on the following success message:
[INFO] Reactor Summary:
[INFO]
[INFO] ecommerce ......................................... SUCCESS [0.440s]
[INFO] core .............................................. SUCCESS [2.505s]
[INFO] admin ............................................. SUCCESS [3:37.628s]
[INFO] site .............................................. SUCCESS [24.109s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:05.052s
[INFO] Finished at: Mon Jul 30 10:01:19 CDT 2012
[INFO] Final Memory: 13M/81M
At this point, we're ready to start up! Let's run the tomcat Ant task for the site.
You'll see some logging messages in the Console scroll by, and eventually stop on
Lots of Database errors as no privileges or tables/index/etc not found – apparently this is fine since with an in memory DB, there aren’t any tables to drop so it returns that error. You will also see some errors for a deprecated vm arg – just remove those lines from the ant builds in admin and site under the tomcat-xxxx and tomcat targets.
[artifact:mvn] Apr 19, 2015 11:16:24 PM org.apache.coyote.AbstractProtocol start
[artifact:mvn] INFO: Starting ProtocolHandler ["http-bio-8080"]
[artifact:mvn] Apr 19, 2015 11:16:24 PM org.apache.coyote.AbstractProtocol start
[artifact:mvn] INFO: Starting ProtocolHandler ["http-bio-8443"]
That's it! The server's up! Let's check it out: http://localhost:8080/
So this and the admin below worked after this for me. However the tomcat-shutdown target does NOT shut tomcat down. I suspect it is because I’m running Tomcat 1.8 and they assume 1.7, but I’m not sure yet.
Running Admin
Once the site has been started up, we can start up the admin as well
Note: The site startup will conveniently populate some database tables, including the admin users tables. Therefore, the site must be running before starting up the admin.
This time, we'll hit the tomcat Ant task for the admin.
This console will end up at
[artifact:mvn] Apr 19, 2015 11:16:24 PM org.apache.coyote.AbstractProtocol start
[artifact:mvn] INFO: Starting ProtocolHandler ["http-bio-8081"]
[artifact:mvn] Apr 19, 2015 11:16:24 PM org.apache.coyote.AbstractProtocol start
[artifact:mvn] INFO: Starting ProtocolHandler ["http-bio-8444"]
And now we can hit the admin! https://localhost:8081/admin. At the login prompt, enter the default username/password of admin/admin and you should see the below screen:
Note: The admin to serves all of its pages over https by default. This means that you will encounter a security exception in your browser because the certificates do not match up. You should be able to safely ignore this warning (when running locally).
Any issues? Please come post in the Broadleaf forums - We would love to help you out!
This forum is in readonly mode and serves as an archive of old information. All posting, registration and commenting abilities have been turned off. To get help, the Broadleaf team reguarly monitors the broadleaf-commerce tag on Stack Overflow so please ask your questions there.