Github user vruusmann commented on the pull request:

    https://github.com/apache/spark/pull/3062#issuecomment-95080549
  
    @selvinsource @mengxr I created an small project 
https://github.com/vruusmann/jpmml-test in order to demonstrate how it's 
possible to reduce the number of dependencies.
    
    The idea is that you should keep JAXB dependencies (scope: `compile`) when 
building for Java 1.6, but you can safely  exclude them (scope: `provided`) 
when building for Java 1.7 or newer. 
    
    Here's the output of `mvn dependency:tree` command for Java 1.6 (the size 
of the resulting uber-JAR file is 1.8 MB):
    ```
    [INFO] org.jpmml:pmml-test:jar:1.0-SNAPSHOT
    [INFO] +- org.jpmml:pmml-model:jar:1.1.15:compile
    [INFO] |  +- org.jpmml:pmml-agent:jar:1.1.15:compile
    [INFO] |  \- org.jpmml:pmml-schema:jar:1.1.15:compile
    [INFO] \- com.sun.xml.bind:jaxb-impl:jar:2.2.7:compile
    [INFO]    \- com.sun.xml.bind:jaxb-core:jar:2.2.7:compile
    [INFO]       \- javax.xml.bind:jaxb-api:jar:2.2.7:compile
    ```
    
    Here's the same for Java 1.7 (the size of the uber-JAR file has shrunk by 
1.2 MB to 0.6 MB; all the remaining dependencies `pmml-model`, `pmml-schema` 
and `pmml-agent` are covered by the BSD 3-Clause License):
    ```
    [INFO] org.jpmml:pmml-test:jar:1.0-SNAPSHOT
    [INFO] +- org.jpmml:pmml-model:jar:1.1.15:compile
    [INFO] |  +- org.jpmml:pmml-agent:jar:1.1.15:compile
    [INFO] |  \- org.jpmml:pmml-schema:jar:1.1.15:compile
    [INFO] \- com.sun.xml.bind:jaxb-impl:jar:2.2.7:provided
    [INFO]    +- com.sun.xml.bind:jaxb-core:jar:2.2.7:provided
    [INFO]    |  +- javax.xml.bind:jaxb-api:jar:2.2.7:provided
    [INFO]    |  \- com.sun.istack:istack-commons-runtime:jar:2.16:provided
    [INFO]    \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.12:provided
    [INFO]       \- javax.xml.bind:jsr173_api:jar:1.0:provided
    ```
    
    JAXB dependencies were made part of Java runtime sometimes in the middle of 
Java 1.6 (for example, 1.6_u01 does not have them, whereas 1.6_u45 does). So, 
it's probably possible to fine-tune the activation of the Maven build profile 
some more.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to