https://kotlinlang.org logo
#announcements
Title
# announcements
w

widar

09/12/2019, 12:49 PM
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

tddmonkey

09/12/2019, 1:04 PM
I can’t read the article right now, but we use this plugin with no issues:
com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
w

widar

09/12/2019, 1:07 PM
Thanks both of you. I managed to get it working looking at @Big Chungus’s example 🙂
j

jimn

09/19/2019, 6:57 AM
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
13 Views