Anyone got experience packaging an executable fat ...
# announcements
w
Anyone got experience packaging an executable fat jar file with kotlin using gradle? Most resources I have found seem to be pointing toward doing like in this post https://medium.com/@preslavrachev/kotlin-basics-create-executable-kotlin-jars-using-gradle-d17e9a8384b9 But I still get the `NoClassDefFoundError: kotlin/jvm/internal/Intrinsics`even though I've done like that
t
I can’t read the article right now, but we use this plugin with no issues:
com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
w
Thanks both of you. I managed to get it working looking at @Big Chungus’s example 🙂
j
two things i find prefereable: use maven wrapper in a project, and avoid shadow/assembler headaches with a wildcard classpath:
Copy code
<plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
wherever "outputDirectory" lives makes for a simple -cp lib/* classpath with your unmangled maven deps, and all your manifests still intact
apoligies, says gradle, im a kurmudgeon