question-mark
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.

Gradle multi-module, Windows 10 & KTEs lock shared jars

See original GitHub issue

There’s a combination we use of Windows, Gradle (latest version) and precompileJte (now KTE), which caused shared built jars to be “locked” so a gradle clean won’t work. This problem didn’t happen with JTEs and plugin & library version 1.8, but happens now with KTEs & plugin & library version 1.9. Could it be a file/resource opening and you’re not closing it perhaps? I can do a gradle clean on the compileKotlin task for instance, but as soon as I do precompileJte then this problem happens so I’m fairly sure there’s an issue somewhere in the jte kotlin module. I tried it all on Ubuntu and it seems fine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
casidcommented, Apr 9, 2021

I just pushed System.setProperty("kotlin.environment.keepalive", "false"); to the gradle and maven compiler. I think mvnd will have the same problem on windows.

Glad you got it working! I’m gonna close this issue, feel free to reopen if there’s something still missing 👍

1reaction
Jerbellcommented, Apr 9, 2021

The kotlin.environment.keepalive=false seems to work as well.

tasks.precompileJte {
  System.setProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY, "false")
  sourceDirectory = Path.of(project.projectDir.absolutePath, "src", "main", "jte")
  targetDirectory = Path.of(project.projectDir.absolutePath, "build", "resources", "main")
  compilePath = project.the<SourceSetContainer>()["main"].runtimeClasspath
  contentType = gg.jte.ContentType.Html
  dependsOn(tasks.compileKotlin)
}

Perhaps this should be the responsibility of the plugin?

Thanks for tracking down the solution 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learning the Basics - Gradle User Manual
In most cases, a project relies on reusable functionality in the form of libraries or is broken up into individual components to compose...
Read more >
Gradle multiple jars from single source folder - Stack Overflow
The advantage of this solution is that we make a proper Gradle multi module project with correct dependencies, not just tasks for building...
Read more >
Gradle daemons lock KSP-related JAR files on Windows #1040
I use KSP in a multi-platform multi-module project with Idea CE. (But currently KSP is applied only on one JVM project.)
Read more >
Using Gradle and the App Engine Plugin - Java 8
This page explains how to use Gradle with an App Engine project in the standard ... repositories { // repositories for Jar's you...
Read more >
Gradle multi project build — substituting jar dependencies ...
One of the projects we're working on recently is using a multi-module architecture. Each feature module is kept in a separate Git repository ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found