Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Self containing jar

See original GitHub issue


I have just migrated my page from pebble to jte and I love it. Thank you very much for this great project!

When trying to compile a self containing a jar, I tried your approach, which did not properly work for some reason, and also fcked up my project since the build/ directory got added to the srcSet. So what I did instead, is quite simple, and seems to work very well:

I used the other approach, but kept the precompiled-loading from the other approach (TemplateEngine.createPrecompiled(ContentType.Html)). I then added this snippet to my gradle jar task:

from fileTree("jte-classes") {
    include "**/*.class"

Which copies the compile output to the jar. (I also had to add dependsOn precompileJte at the beginning of my jar task). Just wanted to let you know, maybe it is of some use to you or fellow users of this library.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

gringofecommented, Mar 5, 2021

@gringofe thank you, that’s amazing to hear!

Thanks for sharing your setup, that indeed sounds very good.

Do you think it makes sense to add this to the documentation, as a third way to setup gradle?

I think it would make sense, even if it’s just a “fallback” option btw, when using binary output mode, you also need to add include "**/*.bin"

edward3hcommented, Feb 24, 2021

I only have a small experimental project, but the documented approach is working fine for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating self-contained executable JARs - A Java geek
This post aims to describe ways to create self-contained executable JARs, also known as uber-JARs or fat JARs.
Read more >
How to use maven to build an self-contained executable jar?
Now, I need to deploy this project on a server, so I want to create a self-contained executable jar, which includes all the...
Read more >
Creating self-contained executable JARs : r/java - Reddit
A self-executing jar works on any system where Java is already installed. That might be perfect for e.g. a developer tool. jpackage produces...
Read more >
Self-Contained, Rich Web Application JARs - DZone
Self -contained JAR files are taking Java web projects by storm, providing great simplification in complex and bloated enterprise containers ...
Read more >
The Executable Jar Format - Spring
The spring-boot-loader modules lets Spring Boot support executable jar and war files. ... This can be problematic if you need to distribute a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found