Grails(23)Grails with Multi Tenant and Executor Plugins - Maven Deploy

Grails(23)Grails with Multi Tenant and Executor Plugins - Maven Deploy

Multi Tenant Plugin
http://grails.org/plugin/multi-tenant

Executor Plugin
http://www.grails.org/plugin/executor

It seem that these 2 plugins will not work if we put them together. Fetch and get the source codes from Multi Tenant.

>git clone https://github.com/multi-tenant/grails-multi-tenant-core.git

Change some of the codes in here.
if (currentTenant.get() != 0 && setTenantId != currentTenant.get()) {
        println "Failed Update Because TenantId Doesn't Match"
        shouldFail = true;
}

The class is grails.plugin.multitenant.core.hibernate.TenantEventHandler

Build and Package this plugin.
>grails clean
>grails upgrade
>grails compile
>grails package-plugin

This command will generate the eclipse project configuration files.
>grails integrate-with --eclipse

Install the maven publisher plugin
>grails install-plugin maven-publisher

These configuration in BuildConfig.groovy will publish to target server
grails.project.dependency.distribution = {
     remoteRepository(id: "pluginSnapshots", url: "http://repository.sillycat.com/artifactory/plugins-snapshot-local/") {
          authentication username: "builder", password: “change me"
     }
     remoteRepository(id: "pluginReleases", url: "http://repository.sillycat.com/artifactory/plugins-release-local/") {
          authentication username: "builder", password: “change me"
     }
     remoteRepository(id: "pluginFeature", url: "http://repository.sillycat.com/artifactory/plugins-feature-local/") {
          authentication username: "builder", password: “change me"
     }
}

This command will do to publish the jar to the repository.
>grails "maven-deploy --repository=pluginSnapshots"


References:
http://grails.org/plugin/multi-tenant


相关推荐