Documentation

3.0.10-GA to 3.0.11-GA Migration

While none of the below steps are required, this is recommended when upgrading to 3.0.11-GA. The full diff of the changes that we made the the stock DemoSite project is at https://github.com/broadleafcommerce/demosite/compare/broadleaf-3.0.10-GA...broadleaf-3.0.11-GA.

Update Google Analytics snippet

Replace the following invocation of the GoogleAnalyticsProcessor (usually in head.html):

<blc:googleAnalytics th:attr="orderNumber=${order != null ? order.orderNumber : null}" />
<script th:utext="${analytics}"></script>

with the following:

<blc:google_universal_analytics ordernumber="${order?.orderNumber}" />

Utilize the BroadleafCookieLocaleResolver

This ensures that the locale picked by Spring (like when resolving message bundles) can use the default locale specified in the database.

In applicationContext-servlet.xml, replace this snippet:

<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
    <property name="defaultLocale" value="en"/>
</bean>

with the following:

<bean id="localeResolver" class="org.broadleafcommerce.common.web.BroadleafCookieLocaleResolver" />

General Windows workspace modifications for finding tools.jar

In your root pom.xml include this profile and dependency:

<!-- These profiles are for Windows/Linux environments that cannot find tools.jar and regularly run from Eclipse. -->
<profiles>
    <profile>
        <id>default-profile</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <file>
                <exists>${java.home}/../lib/tools.jar</exists>
            </file>
        </activation>
        <properties>
            <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
        </properties>
    </profile>
    <profile>
        <id>mac-profile</id>
        <activation>
            <activeByDefault>false</activeByDefault>
            <file>
                <exists>${java.home}/../Classes/classes.jar</exists>
            </file>
        </activation>
        <properties>
            <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
        </properties>
    </profile>
</profiles>
<!-- Activated by the profiles above for the paths to tools.jar-->
<dependency>
    <groupId>com.sun</groupId>
    <artifactId>tools</artifactId>
    <version>[1.6,)</version>
   <scope>system</scope>
   <systemPath>${toolsjar}</systemPath>
</dependency>

Java 8 build changes

If you are using a Java 8 JVM for compiling and running locally, replace the keytool-maven-plugin with the following in both admin/pom.xml and site/pom.xml:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>keytool-maven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <id>clean</id>
            <goals>
                <goal>clean</goal>
            </goals>
        </execution>
        <execution>
            <phase>generate-resources</phase>
            <id>generateKeyPair</id>
            <goals>
                <goal>generateKeyPair</goal>
            </goals>
        </execution>
    </executions>
</plugin>