Page 1 of 1

Reference pomDeps not found in site-war/build.xml

Posted: Sun May 20, 2012 1:07 pm
by skip
Hi

I am seeing Reference pomDeps not found as a warning in site-war/build.xml at the following ant task definition:

Code: Select all

<taskdef name="hibernatetool" classname="org.broadleafcommerce.common.util.sql.HibernateToolTask" classpathref="build.runtime.classpath" />


Is it the default behavior?
I have not make any changes to the build file besides changing the dialect for MySql database.

Following is the complete build-sql target:

Code: Select all

    <target name="build-sql">
        <!--
            You will need to run a mvn install on your project before attempting to execute this task.
            Also, you will likely need to assign additional heap space to your ANT process. A setting
            of -XX:MaxPermSize=256M -Xmx512M should be sufficient.
        -->
        <mkdir dir="target/sql"/>
        <artifact:pom id="myPom" file="pom.xml" />
        <artifact:dependencies filesetId="pomDeps" pomRefId="myPom" useScope="compile" />
        <property name="baseTarget" location="target/${myPom.build.finalName}/WEB-INF"/>
        <fileset id="libDir" dir="${baseTarget}/lib"/>
        <path id="build.runtime.classpath">
            <!--There are some additional libraries needed at compile time that are not included
                in WEB-INF/lib - find those libraries via a difference algorithm-->
            <restrict>
                <difference>
                    <fileset refid="pomDeps" />
                    <intersect>
                        <fileset refid="pomDeps" />
                        <fileset refid="libDir" />
                    </intersect>
                </difference>
                <rsel:not>
                    <rsel:name name="**/*.pom" />
                </rsel:not>
            </restrict>
            <!--Add the lib directory to get all the dependencies required for the demo app-->
            <fileset refid="libDir"/>
            <!--Add the classes directory in the war project, if required-->
            <!--<pathelement location="${baseTarget}/classes"/>-->
        </path>
        <!--If the war project does not contain custom entities (best practice), then it is not necessary to include application context from the WEB-INF directory-->
        <!--<property name="my.app.context" location="src/main/webapp/WEB-INF/applicationContext.xml"/>-->
        <taskdef name="hibernatetool" classname="org.broadleafcommerce.common.util.sql.HibernateToolTask" classpathref="build.runtime.classpath" />
        <hibernatetool destDir="target/sql" combinePersistenceUnits="false" refineFileNames="true">
            <!--add in additional persistence configuration related to the admin -->
            <classPathApplicationContext path="bl-open-admin-contentClient-applicationContext.xml"/>
            <!--add in additional persistence configuration related to the cms -->
            <classPathApplicationContext path="bl-cms-contentClient-applicationContext.xml"/>
            <!--add in additional persistence configuration for our core -->
            <classPathApplicationContext path="mycompany-applicationContext.xml"/>
            <!--see description for my.app.context above -->
            <!--<fileSystemApplicationContext path="${my.app.context}"/>-->
            <!--select the dialects and persistence units to export-->
            <jpaconfiguration persistenceUnit="blPU" dialect="org.hibernate.dialect.MySQLDialect" />
            <jpaconfiguration persistenceUnit="blSecurePU" dialect="org.hibernate.dialect.MySQLDialect" />
            <jpaconfiguration persistenceUnit="blCMSStorage" dialect="org.hibernate.dialect.MySQLDialect" />
            <!--other required elements-->
            <classpath refid="build.runtime.classpath" />
            <hbm2ddl export="false"/>
        </hibernatetool>
    </target>


Thanks.

Re: Reference pomDeps not found in site-war/build.xml

Posted: Fri May 25, 2012 11:18 am
by aazzolini
This ant task task will basically dump the schema for your current application into a sql file so that you can create it on another database.

If you don't require that functionality, you can safely ignore that warning.

Let me know if you do need it and I can get instructions on solving it (I haven't used that task, so I'd need to go talk to another developer to get the correct set of instructions for you).

Re: Reference pomDeps not found in site-war/build.xml

Posted: Sat May 26, 2012 11:49 pm
by skip
Hi aazzolini

I have been able to run 1.6.0-GA both BroadleafCommerceDemoSite and myecommerce-app with blPrecompressedArtifactFilter commented out in the latter case to run the admin and I will be moving the application to MySQL 5.5 soon, will I need the dumped schema to run against the database to get things working with MySQL 5.5?

Moving to another database doesn't mention any use of those dumped files as hibernate.hbm2ddl.auto property to create-drop should suffice for automatically creating the schema and running it against MySQL 5.5 considering the dialect, driverClassName and other properties to be set appropriately as well.

Will I need that dumped scheme to use it against MySQL 5.5 for the application to work properly with it? If yes then could you please tell me the instructions for getting that warning resolved? If not then could I still ask you to give me the instructions to resolve that warning :)?

Many thanks for the reply :).

Re: Reference pomDeps not found in site-war/build.xml

Posted: Tue May 29, 2012 11:50 pm
by aazzolini
Hey, sorry for the delay in responding.

You don't need the dumped schema for the app to function in MySQL. You can simply rely on Hibernate to create the database schema for you.

Re: Reference pomDeps not found in site-war/build.xml

Posted: Wed May 30, 2012 10:38 am
by jefffischer
I tested the build-sql task with the latest archetype (1.6.0-GA). It worked fine without any warnings and generated DDL for HSQL (by default). Here are the steps I took:

1. Created a multi-module maven project using the 1.6.0-GA archetype
2. Performed a 'mvn install' at the command line in the root of the project (this is required first)
3. Executed the 'build-sql' task in build.xml of site-war using Ant.

At this point, I saw the standard output on the console and the task emitted the DDL to a directory entitled 'sql' in the target directory of site-war.