[teiid-issues] [JBoss JIRA] (TEIID-4234) Gradle blueprint

jay vyas (JIRA) issues at jboss.org
Tue May 31 13:15:02 EDT 2016


    [ https://issues.jboss.org/browse/TEIID-4234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13245630#comment-13245630 ] 

jay vyas edited comment on TEIID-4234 at 5/31/16 1:14 PM:
----------------------------------------------------------

Example of what i built to solve this problem.  In particular it was tricky to find the right maven deps combination (Teeid jdbc driver is hidden and there are transitive red hat deps that can trip things up).  

If we publish this alongside a simple teiid server dockerfile, it would be a really natural experience for attracting java app developers to the data virt community.

the source code isnt attached for the java parts, because after all that is pretty easy to write (class.ForName the teiid driver and issue a sql query). 


{{
group 'd.analytics'
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin:'application'

/***
 *
 *  Boilerplate for a 1.8 java app
 */
sourceCompatibility = 1.8

// mainClassName = "poc.TeiidInternalJDBC"
mainClassName = "poc.TeiidSpark"

startScripts {
    applicationDefaultJvmArgs = ["-Xms4g","-Xmx4g"]
}

sourceCompatibility = 1.8
version = '1.0'

manifest {
    attributes 'Main-Class': mainClassName
}

task fatJar(type: Jar) {
    manifest {
        attributes 'Implementation-Title': 'Gradle Jar File Example',
        'Implementation-Version': version,
        'Main-Class': mainClassName
    }
    baseName = project.name + '-all'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}


repositories {
    mavenCentral()
    maven{
        url "https://repository.jboss.org/"
    }
    maven {
        url "https://repository.jboss.org/nexus/content/repositories/releases/"
    }
    maven {
        url "http://repository.jboss.org/nexus/content/groups/public/"
    }
    maven {
        url "https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads/"
    }
    maven {
        url "http://repository.jboss.org/nexus/content/groups/developer/"
    }

    // necessary to avoid "Could not find org.jboss.as:jboss-as-parent:7.5.0.Final-redhat-15."
    // not sure which ones we need, need to prune.
    maven {
        url "https://maven.repository.redhat.com/techpreview/all/"
    }
    maven {
        url "https://maven.repository.redhat.com/earlyaccess/all/"
    }
}
ext {
    sparkVersion = "1.3.0"
    scalaVersion = "2.10"
}

dependencies {

    testCompile group: 'junit', name: 'junit', version: '4.11'


    compile "org.jboss.teiid:teiid:8.9.1"
    compile "org.jboss.teiid:teiid-client:8.9.1"

    // compile "org.jboss.teiid:teiid:8.12.5"
    // compile "org.jboss.teiid:teiid-client:8.12.5"


    // compile "org.jboss.teiid:teiid:8.11.1"
    // compile "org.jboss.teiid:teiid-client-jdbc:6.0.0"
    // compile "org.jboss.teiid:teiid-client:8.11.1"
    // compile "org.jboss.teiid:teiid-common-core:8.11.1"

    compile "org.apache.spark:spark-core_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-mllib_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-network-shuffle_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-sql_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-graphx_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-hive_${scalaVersion}:${sparkVersion}"
    compile "joda-time:joda-time:2.7"
    compile "org.json4s:json4s-jackson_2.10:3.1.0"
}
}}



was (Author: jayunit100):
Example of what i built to solve this problem.  In particular it was tricky to find the right maven deps combination (Teeid jdbc driver is hidden and there are transitive red hat deps that can trip things up).  

If we publish this alongside a simple teiid server dockerfile, it would be a really natural experience for attracting java app developers to the data virt community.

the source code isnt attached for the java parts, because after all that is pretty easy to write (class.ForName the teiid driver and issue a sql query). 

[noformat]
{{group 'd.analytics'
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin:'application'

/***
 *
 *  Boilerplate for a 1.8 java app
 */
sourceCompatibility = 1.8

// mainClassName = "poc.TeiidInternalJDBC"
mainClassName = "poc.TeiidSpark"

startScripts {
    applicationDefaultJvmArgs = ["-Xms4g","-Xmx4g"]
}

sourceCompatibility = 1.8
version = '1.0'

manifest {
    attributes 'Main-Class': mainClassName
}

task fatJar(type: Jar) {
    manifest {
        attributes 'Implementation-Title': 'Gradle Jar File Example',
        'Implementation-Version': version,
        'Main-Class': mainClassName
    }
    baseName = project.name + '-all'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}


repositories {
    mavenCentral()
    maven{
        url "https://repository.jboss.org/"
    }
    maven {
        url "https://repository.jboss.org/nexus/content/repositories/releases/"
    }
    maven {
        url "http://repository.jboss.org/nexus/content/groups/public/"
    }
    maven {
        url "https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads/"
    }
    maven {
        url "http://repository.jboss.org/nexus/content/groups/developer/"
    }

    // necessary to avoid "Could not find org.jboss.as:jboss-as-parent:7.5.0.Final-redhat-15."
    // not sure which ones we need, need to prune.
    maven {
        url "https://maven.repository.redhat.com/techpreview/all/"
    }
    maven {
        url "https://maven.repository.redhat.com/earlyaccess/all/"
    }
}
ext {
    sparkVersion = "1.3.0"
    scalaVersion = "2.10"
}

dependencies {

    testCompile group: 'junit', name: 'junit', version: '4.11'


    compile "org.jboss.teiid:teiid:8.9.1"
    compile "org.jboss.teiid:teiid-client:8.9.1"

    // compile "org.jboss.teiid:teiid:8.12.5"
    // compile "org.jboss.teiid:teiid-client:8.12.5"


    // compile "org.jboss.teiid:teiid:8.11.1"
    // compile "org.jboss.teiid:teiid-client-jdbc:6.0.0"
    // compile "org.jboss.teiid:teiid-client:8.11.1"
    // compile "org.jboss.teiid:teiid-common-core:8.11.1"

    compile "org.apache.spark:spark-core_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-mllib_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-network-shuffle_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-sql_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-graphx_${scalaVersion}:${sparkVersion}"
    compile "org.apache.spark:spark-hive_${scalaVersion}:${sparkVersion}"
    compile "joda-time:joda-time:2.7"
    compile "org.json4s:json4s-jackson_2.10:3.1.0"
}
}}
[noformat]

> Gradle blueprint
> ----------------
>
>                 Key: TEIID-4234
>                 URL: https://issues.jboss.org/browse/TEIID-4234
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: Tools
>            Reporter: jay vyas
>            Assignee: Steven Hawkins
>             Fix For: 8.13.5
>
>
> As a app developer, I'd like to spin up a teiid/JDV application with all client-side dependencies 
> without needing to use an IDE.
> Currently, most of the TEiid resources and videos are based on IDE features, bootstrapping teiid on the local machine.
> Ideally, we might host a simple Teiid server that can run in a dockerfile with sample data, along side a gradle runnable file.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list