portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Mark Donaghy" <philip.dona...@gmail.com>
Subject Re: Resolved the Maven 2 build error with the Derby embedded database
Date Fri, 26 Jan 2007 10:40:55 GMT
On 1/26/07, Hajo Birthelmer <Hajo@bluesunrise.com> wrote:
> I guess I found the real solution to our little "derby" problem.
>
> In the build xml:
>
> <target name="sql-test-database-classpath"> determines whether the EMBEDDED
> driver is used or not.
> In the current version, for derby (as for hsql) it checks
> <equals arg1="${org.apache.jetspeed.database.jdbc.drivers.path}" arg2=""/>
> Unfortunately that is never true since the settings.xml requires a valid
> <org.apache.jetspeed.production.database.jdbc.drivers.path> setting,
> otherwise the mvn main build fails!!! Whoops....
>
> The solution is changing the above test to use the driver itself and test:
> <equals arg1="${org.apache.jetspeed.database.driver}"
> arg2="org.apache.derby.jdbc.EmbeddedDriver"/>
>
> That works and should NOT have any negative impact on any other db.
>
> I would assume that HSQLDB has a similar problem but I have trouble (for
> whatever reason) to get any test going on HSQLDB - plus I don't want to take
> the all the fun of testing away from you....

I've set up a testing environment for derby embedded, derby network,
mysql, and hsql.
It uses maven 2 profiles. I'll be committing a new settings.xml.sample
to include these profiles.

>
> In the patch I will submit tomorrow to DST I will just comment out the
> driver.path check for HSQLDB.

The solution sounds good. I'll test it.

Philip

>
> Note that the same fix has to be applied to the artifact for custom build.
>
> Again: here is the new target:
>
>   <target name="sql-test-database-classpath">
>
>         <condition property="org.apache.jetspeed.database.use.drivers.path">
>             <and>
>                 <not><equals
> arg1="${org.apache.jetspeed.database.jdbc.drivers.path}" arg2=""/></not>
>                 <not><equals
> arg1="${org.apache.jetspeed.database.default.name}" arg2="derby"/></not>
>                 <not><equals
> arg1="${org.apache.jetspeed.database.default.name}" arg2="hsql"/></not>
>             </and>
>         </condition>
>         <condition
> property="org.apache.jetspeed.database.is.derby.embedded">
>             <and>
>                 <equals arg1="${org.apache.jetspeed.database.default.name}"
> arg2="derby"/>
>                 <equals arg1="${org.apache.jetspeed.database.driver}"
> arg2="org.apache.derby.jdbc.EmbeddedDriver"/>
>             </and>
>         </condition>
>         <condition property="org.apache.jetspeed.database.is.hsql.embedded">
>             <and>
>                 <equals arg1="${org.apache.jetspeed.database.default.name}"
> arg2="hsql"/>
> <!--
>                                 <equals
> arg1="${org.apache.jetspeed.database.jdbc.drivers.path}" arg2=""/>
> -->
>             </and>
>         </condition>
>     </target>
>
>
> Hajo Birthelmer
>
> hajo@bluesunrise.com
> office     : +01.707.773.4646
> cell        : +01.707.318.9275
>
>
> -----Original Message-----
> From: Hajo Birthelmer [mailto:Hajo@BlueSunrise.com]
> Sent: Thursday, January 25, 2007 11:12 PM
> To: 'Jetspeed Developers List'
> Subject: RE: Resolved the Maven 2 build error with the Derby embedded
> database
>
> Hi folks...
>
> This is also related to Mark's and Mikko's email thread " Resolved the Maven
> 2 build error with the Derby embedded database"...
>
> From http://ant.apache.org/manual/index.html :
> Ant will only check whether the property has been set, the value doesn't
> matter. A property set to the empty string is still an existing property.
> For example:
>
>     <target name="build-module-A" if="module-A-present"/>
>
>     <target name="build-own-fake-module-A" unless="module-A-present"/>
>
> In the first example, if the module-A-present property is set (to any value,
> e.g. false), the target will be run. In the second example, if the
> module-A-present property is set (again, to any value), the target will not
> be run.
>
>
> Having said that, setting the property below is not what we should do, since
> it would (let me get rid of the conditional - it does) break everything else
> since now the build file thinks that derby is always set.
> Mark is right in that the property needs to be set for derby (to anything
> for that matter) and only if derby is the database, but we need to find out
> why the condition to do so doesn't get executed
>
>
>
> Hajo Birthelmer
>
> hajo@bluesunrise.com
> office     : +01.707.773.4646
> cell        : +01.707.318.9275
>
>
> -----Original Message-----
> From: Philip Mark Donaghy [mailto:philip.donaghy@gmail.com]
> Sent: Wednesday, January 24, 2007 3:32 PM
> To: Jetspeed Developers List
> Subject: Resolved the Maven 2 build error with the Derby embedded database
>
> Hi, It seems the maven ant plugin requires that properties be declared
> in the build file to be acknowledged. Example,
>
>     <target name="help" if="mytest">
>
> The property mytest doesn't need to be declared when running this
> target with Ant. The command,
>
> ant -Dmytest=true help
>
> will execute the target help.
>
> Yet the target help will never execute using the maven plugin unless
> there is a property declaration.
>
>     <property name="mytest" value=""/>
>
> There are a number of properties used in the etc/build.xml that are
> not declared. This is preventing the target sql-execute-derby from
> running. Declaring the o.a.j.is.derby and o.a.j.is.derby.embedded
> properties will fix this.
>
>         <property name="org.apache.jetspeed.database.is.derby" value="" />
>         <property name="org.apache.jetspeed.database.is.derby.embedded"
> value="" />
>
> This and copying the derby jar to tomcat are blocking the maven 2
> build. At the moment I don't know where that should be done.
> --
> Philip Donaghy
> donaghy.blogspot.com del.icio.us/donaghy/philip
> Skype: philipmarkdonaghy
> Office: +33 5 56 60 88 02
> Mobile: +33 6 20 83 22 62
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>


-- 
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message