[ 
https://issues.apache.org/jira/browse/BEAM-4357?focusedWorklogId=104792&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-104792
 ]

ASF GitHub Bot logged work on BEAM-4357:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/May/18 21:24
            Start Date: 22/May/18 21:24
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #5443: 
[BEAM-4357] [SQL] Fix shadow jar and test it
URL: https://github.com/apache/beam/pull/5443#discussion_r190057717
 
 

 ##########
 File path: sdks/java/extensions/sql/build.gradle
 ##########
 @@ -45,23 +48,27 @@ dependencies {
   compile "org.apache.calcite:calcite-core:$calcite_version"
   compile "org.apache.calcite:calcite-linq4j:$calcite_version"
   compile "org.apache.calcite.avatica:avatica-core:$avatica_version"
-  compile "com.alibaba:fastjson:1.2.12"
   compileOnly library.java.findbugs_jsr305
   compileOnly library.java.findbugs_annotations
   shadow project(path: ":beam-sdks-java-core", configuration: "shadow")
   shadow project(path: ":beam-sdks-java-extensions-join-library", 
configuration: "shadow")
   shadow library.java.slf4j_api
+  shadow library.java.slf4j_jdk14
   shadow library.java.commons_csv
+  shadow library.java.commons_lang3
+  shadow library.java.jackson_databind
   shadow library.java.joda_time
+  shadow "com.alibaba:fastjson:1.2.12"
   shadow project(path: ":beam-runners-direct-java", configuration: "shadow")
   provided project(path: ":beam-sdks-java-io-kafka", configuration: "shadow")
   provided project(path: ":beam-sdks-java-io-google-cloud-platform", 
configuration: "shadow")
   provided library.java.kafka_clients
-  testCompile library.java.slf4j_jdk14
   testCompile library.java.junit
   testCompile library.java.hamcrest_core
   testCompile library.java.mockito_core
   testCompile library.java.quickcheck_core
+  shadowJarTest project(path: project.path, configuration: "shadow")
 
 Review comment:
   The tests run against the classes which aren't shaded (same as Maven before) 
since the default is `project.sourceSets.test.runtimeClasspath` as per [Gradle 
Test 
documentation](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:classpath).
 Only the dependencies are correctly pulled in as shaded jars (an improvement 
over Maven).
   
   It might be better to attempt to run all unit tests using the shadowTest 
configuration by specifying `classpath = configurations.shadowTest` on the 
`test { }` closure in `build_rules.gradle`
   
   The test wouldn't need to become an IT then.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 104792)
    Time Spent: 1h 20m  (was: 1h 10m)

> SQL shaded jar returns NoClassDefFoundError
> -------------------------------------------
>
>                 Key: BEAM-4357
>                 URL: https://issues.apache.org/jira/browse/BEAM-4357
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql
>    Affects Versions: 2.5.0
>            Reporter: Andrew Pilloud
>            Assignee: Andrew Pilloud
>            Priority: Blocker
>             Fix For: 2.5.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> com/fasterxml/jackson/databind/ObjectMapper
> I ran this:
> {code:java}
> java -cp 
> ./sdks/java/extensions/sql/build/libs/beam-sdks-java-extensions-sql-2.5.0-SNAPSHOT-shaded.jar:$HOME/sqlline/sqlline-1.3.0.jar:$HOME/sqlline/jline-2.14.6.jar
>  sqlline.SqlLine -u 'jdbc:beam:' -n admin -p admin{code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to