Skip to content

Commit

Permalink
Merge branch 'master' into modules-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
melrief committed Jun 25, 2017
2 parents 9006ce7 + d07c596 commit 76d05ee
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 42 deletions.
22 changes: 1 addition & 21 deletions README.md
Expand Up @@ -32,7 +32,7 @@ A boilerplate-free Scala library for loading configuration files.
- [Support for Duration](docs/support-for-duration.md)
- [Integrating with other libraries](#integrating-with-other-libraries)
- [Contribute](#contribute)
- [FAQ](#faq)
- [FAQ](docs/faq.md)
- [License](#license)
- [Special thanks](#special-thanks)

Expand Down Expand Up @@ -189,26 +189,6 @@ A non-comprehensive list of other libraries which have integrated with PureConfi

- `refined-pureconfig` allows PureConfig to play nicely with [`refined`](https://github.com/fthomas/refined/)'s type refinements. Viktor Lövgren's blog post gleefully explains how [PureConfig and refined work together](https://blog.vlovgr.se/posts/2016-12-24-refined-configuration.html).

## FAQ

### How can I use PureConfig with Spark 2.1.0 (problematic Shapeless dependency)?

Apache Spark (specifically version 2.1.0) has a transitive dependency
on [Shapeless](https://github.com/milessabin/shapeless) 2.0.0. This version is
too old to be used by PureConfig, making your Spark project fail when using
`spark-submit`.

If you are using the [sbt-assembly](https://github.com/sbt/sbt-assembly) plugin
to create your JARs you
can [shade this dependency](https://github.com/sbt/sbt-assembly#shading) by
adding

```scala
assemblyShadeRules in assembly := Seq(ShadeRule.rename("shapeless.**" -> "new_shapeless.@1").inAll)
```

to your `assembly.sbt` file.

## Contribute

PureConfig is a free library developed by several people around the world.
Expand Down
22 changes: 1 addition & 21 deletions core/src/main/tut/README.md
Expand Up @@ -32,7 +32,7 @@ A boilerplate-free Scala library for loading configuration files.
- [Support for Duration](docs/support-for-duration.md)
- [Integrating with other libraries](#integrating-with-other-libraries)
- [Contribute](#contribute)
- [FAQ](#faq)
- [FAQ](docs/faq.md)
- [License](#license)
- [Special thanks](#special-thanks)

Expand Down Expand Up @@ -187,26 +187,6 @@ A non-comprehensive list of other libraries which have integrated with PureConfi

- `refined-pureconfig` allows PureConfig to play nicely with [`refined`](https://github.com/fthomas/refined/)'s type refinements. Viktor Lövgren's blog post gleefully explains how [PureConfig and refined work together](https://blog.vlovgr.se/posts/2016-12-24-refined-configuration.html).

## FAQ

### How can I use PureConfig with Spark 2.1.0 (problematic Shapeless dependency)?

Apache Spark (specifically version 2.1.0) has a transitive dependency
on [Shapeless](https://github.com/milessabin/shapeless) 2.0.0. This version is
too old to be used by PureConfig, making your Spark project fail when using
`spark-submit`.

If you are using the [sbt-assembly](https://github.com/sbt/sbt-assembly) plugin
to create your JARs you
can [shade this dependency](https://github.com/sbt/sbt-assembly#shading) by
adding

```scala
assemblyShadeRules in assembly := Seq(ShadeRule.rename("shapeless.**" -> "new_shapeless.@1").inAll)
```

to your `assembly.sbt` file.

## Contribute

PureConfig is a free library developed by several people around the world.
Expand Down
54 changes: 54 additions & 0 deletions docs/faq.md
@@ -0,0 +1,54 @@
## FAQ

### How can I use PureConfig with Spark 2.1.0 (problematic shapeless dependency)?

Apache Spark (specifically version 2.1.0) has a transitive dependency
on [shapeless](https://github.com/milessabin/shapeless) 2.0.0. This version is
too old to be used by PureConfig, making your Spark project fail when using
`spark-submit`. The solution is to shade, i.e. rename, the version of shapeless
used by PureConfig.

#### SBT

If you are using the [sbt-assembly](https://github.com/sbt/sbt-assembly) plugin
to create your JARs you
can [shade](https://github.com/sbt/sbt-assembly#shading) shapeless by
adding

```scala
assemblyShadeRules in assembly := Seq(ShadeRule.rename("shapeless.**" -> "new_shapeless.@1").inAll)
```

to your `assembly.sbt` file.

#### Maven

The [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin/)
can shade shapeless by adding

```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>shapeless</pattern>
<shadedPattern>shapelesspureconfig</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
```

to your `pom.xml` file.
54 changes: 54 additions & 0 deletions docs/src/main/tut/faq.md
@@ -0,0 +1,54 @@
## FAQ

### How can I use PureConfig with Spark 2.1.0 (problematic shapeless dependency)?

Apache Spark (specifically version 2.1.0) has a transitive dependency
on [shapeless](https://github.com/milessabin/shapeless) 2.0.0. This version is
too old to be used by PureConfig, making your Spark project fail when using
`spark-submit`. The solution is to shade, i.e. rename, the version of shapeless
used by PureConfig.

#### SBT

If you are using the [sbt-assembly](https://github.com/sbt/sbt-assembly) plugin
to create your JARs you
can [shade](https://github.com/sbt/sbt-assembly#shading) shapeless by
adding

```scala
assemblyShadeRules in assembly := Seq(ShadeRule.rename("shapeless.**" -> "new_shapeless.@1").inAll)
```

to your `assembly.sbt` file.

#### Maven

The [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin/)
can shade shapeless by adding

```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>shapeless</pattern>
<shadedPattern>shapelesspureconfig</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
```

to your `pom.xml` file.

0 comments on commit 76d05ee

Please sign in to comment.