You don't necessarily need to do this. You can package only the sql script
and create the database during the product build

On Friday, February 12, 2016, Hemika Kodikara <[email protected]> wrote:

> Hi All,
>
> We already have something similar in our carbon-business-messaging repo
> [1].
>
> [1] -
> https://github.com/hemikak/carbon-business-messaging/blob/master/features/andes/org.wso2.carbon.andes.server.feature/pom.xml
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +94777688882
>
> On Fri, Feb 12, 2016 at 5:02 PM, Sameera Jayasoma <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> Hi All,
>>
>> You can easily create an H2 database form a given sql Script in your
>> project. I've attached a sample pom.xml.
>>
>> This can be used in products as well as components repos. You can easily
>> populate an H2 database from an sql file for your component level OSGi
>> testing as well.
>>
>> Thanks,
>> Sameera.
>>
>> On Fri, Feb 12, 2016 at 4:32 PM, Akalanka Pagoda Arachchi <
>> [email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>>
>> wrote:
>>
>>> What I meant was, I already tried upgrading the H2 version to the latest
>>> version. When I did, the previous database URL's we were using failed since
>>> the new H2 driver is not taking relative paths for the URL.
>>>
>>> Thanks,
>>> Akalanka.
>>>
>>> On Fri, Feb 12, 2016 at 3:48 PM, Akalanka Pagoda Arachchi <
>>> [email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>>
>>> wrote:
>>>
>>>> We can, but we will have to verify all the database URL's again, since
>>>> when I tried, it gave me an exception since it was no longer accepting
>>>> relative paths.
>>>>
>>>> On Fri, Feb 12, 2016 at 3:46 PM, Ramith Jayasinghe <[email protected]
>>>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>>>
>>>>> and shall we upgrade H2 version to latest?
>>>>>
>>>>> On Fri, Feb 12, 2016 at 2:24 PM, Ramith Jayasinghe <[email protected]
>>>>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>>>> > So whats the verdict?
>>>>> > @sameera: can we have some thing similar to 'carbon-persistence' or
>>>>> > something which contains H2?
>>>>> >
>>>>> > On Fri, Feb 12, 2016 at 11:48 AM, Niranjan Karunanandham
>>>>> > <[email protected]
>>>>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>>>> >> Hi Akalanka,
>>>>> >>
>>>>> >> On Fri, Feb 12, 2016 at 11:37 AM, Akalanka Pagoda Arachchi
>>>>> >> <[email protected]
>>>>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>>>> >>>
>>>>> >>> Hi Niranjan,
>>>>> >>>
>>>>> >>> Yes, we could have avoided adding h2-database-engine as a
>>>>> dependency in
>>>>> >>> 4.4.x Andes.
>>>>> >>>
>>>>> >>> If we add the h2 driver to the datasource feature, it would mean
>>>>> whenever
>>>>> >>> datasource feature is used h2 driver will be copied. Will that be
>>>>> OK? My
>>>>> >>> opinion is if the H2 driver is not a dependency for the feature,
>>>>> it should
>>>>> >>> not be contained in the feature. When we create a distribution
>>>>> from that
>>>>> >>> feature, if H2 DB is used as the default DB configuration, we
>>>>> should provide
>>>>> >>> the H2 driver with the distribution.
>>>>> >>
>>>>> >> Sorry about it. I was under the impression that the datasource core
>>>>> for C5
>>>>> >> supports by default is for H2 DB like in C4. This is why I
>>>>> suggested that we
>>>>> >> define it at the datasource core feature.
>>>>> >>
>>>>> >>>
>>>>> >>> WDYT?
>>>>> >>>
>>>>> >>> Thanks,
>>>>> >>> Akalanka.
>>>>> >>>
>>>>> >>> On Fri, Feb 12, 2016 at 11:05 AM, Niranjan Karunanandham
>>>>> >>> <[email protected]
>>>>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>>>> >>>>
>>>>> >>>> Hi Akalanka / all
>>>>> >>>>
>>>>> >>>> On Fri, Feb 12, 2016 at 10:46 AM, Akalanka Pagoda Arachchi
>>>>> >>>> <[email protected]
>>>>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>>>> >>>>>
>>>>> >>>>> Hi All,
>>>>> >>>>>
>>>>> >>>>> In the previous distributions, we had H2 database driver as a
>>>>> dependency
>>>>> >>>>> for our features so that it will be copied to the plugins folder
>>>>> when the
>>>>> >>>>> pack is created.However, in this scenario, H2 database driver is
>>>>> not exactly
>>>>> >>>>> a dependency of the Andes Core feature since it is not using the
>>>>> H2 driver.
>>>>> >>>>
>>>>> >>>> Are you referring to the h2-database-engine jar? This was there
>>>>> in the
>>>>> >>>> plugins folder of kernel core zip in 4.4.x. If so, then why is
>>>>> andes core
>>>>> >>>> feature also packing this?
>>>>> >>>>
>>>>> >>>>>
>>>>> >>>>> Therefore, my suggestion is to avoid adding H2 database driver
>>>>> as a
>>>>> >>>>> dependency for the Andes Core feature, but rather add it as a
>>>>> dependency for
>>>>> >>>>> product distribution module so that when the distribution pack
>>>>> is created,
>>>>> >>>>> the H2 driver, which is required for default database
>>>>> configurations is
>>>>> >>>>> copied to the plugins folder.
>>>>> >>>>>
>>>>> >>>>> This will be useful in reducing the Andes Core feature bundle
>>>>> size as
>>>>> >>>>> well.
>>>>> >>>>>
>>>>> >>>>> If any product is to install Andes Core feature, they will have
>>>>> to copy
>>>>> >>>>> the relevant jar file to the dropins folder if they don't
>>>>> already have it.
>>>>> >>>>>
>>>>> >>>>> WDYT?
>>>>> >>>>>
>>>>> >>>>> If we're to go ahead with this approach we need a way to install
>>>>> osgi
>>>>> >>>>> bundles to the distribution that are not available in the
>>>>> features or create
>>>>> >>>>> a new feature containing H2 database driver.
>>>>> >>>>
>>>>> >>>> If we require a default DB, then I would suggest to have it with
>>>>> database
>>>>> >>>> core feature. WDYT?
>>>>> >>>>
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>> Please provide your thoughts.
>>>>> >>>>>
>>>>> >>>>> Thanks,
>>>>> >>>>> Akalanka.
>>>>> >>>>>
>>>>> >>>>> --
>>>>> >>>>> Darshana Akalanka Pagoda Arachchi,
>>>>> >>>>> Software Engineer
>>>>> >>>>> 078-4721791
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> Regards,
>>>>> >>>> Nira
>>>>> >>>>
>>>>> >>>> --
>>>>> >>>>
>>>>> >>>> Niranjan Karunanandham
>>>>> >>>> Senior Software Engineer - WSO2 Inc.
>>>>> >>>> WSO2 Inc.: http://www.wso2.com
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>> --
>>>>> >>> Darshana Akalanka Pagoda Arachchi,
>>>>> >>> Software Engineer
>>>>> >>> 078-4721791
>>>>> >>
>>>>> >>
>>>>> >> Regards,
>>>>> >> Nira
>>>>> >>
>>>>> >> --
>>>>> >>
>>>>> >> Niranjan Karunanandham
>>>>> >> Senior Software Engineer - WSO2 Inc.
>>>>> >> WSO2 Inc.: http://www.wso2.com
>>>>> >
>>>>> >
>>>>> >
>>>>> > --
>>>>> > Ramith Jayasinghe
>>>>> > Technical Lead
>>>>> > WSO2 Inc., http://wso2.com
>>>>> > lean.enterprise.middleware
>>>>> >
>>>>> > E: [email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>
>>>>> > P: +94 777542851
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Ramith Jayasinghe
>>>>> Technical Lead
>>>>> WSO2 Inc., http://wso2.com
>>>>> lean.enterprise.middleware
>>>>>
>>>>> E: [email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>
>>>>> P: +94 777542851
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Darshana Akalanka Pagoda Arachchi,*
>>>> *Software Engineer*
>>>> *078-4721791*
>>>>
>>>
>>>
>>>
>>> --
>>> *Darshana Akalanka Pagoda Arachchi,*
>>> *Software Engineer*
>>> *078-4721791*
>>>
>>
>>
>>
>> --
>> Sameera Jayasoma,
>> Software Architect,
>>
>> WSO2, Inc. (http://wso2.com)
>> email: [email protected]
>> <javascript:_e(%7B%7D,'cvml','[email protected]');>
>> blog: http://blog.sameera.org
>> twitter: https://twitter.com/sameerajayasoma
>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
>> Mobile: 0094776364456
>>
>> Lean . Enterprise . Middleware
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>

-- 
Sameera Jayasoma,
Software Architect,

WSO2, Inc. (http://wso2.com)
email: [email protected]
blog: http://blog.sameera.org
twitter: https://twitter.com/sameerajayasoma
flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
Mobile: 0094776364456

Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to