diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

bndmanifest and java-library intermodule dependencies #114

Open nedtwigg opened 4 years ago

nedtwigg commented 4 years ago

In https://github.com/diffplug/durian-swt/pull/7/commits/496386ecebd023075b03a041d238af8d02a29469 I used java-library in a multi-module project, and I declared an api dependency on another module within the project. I then saw intermittent errors like this:

> Task :durian-swt:jar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':durian-swt:jar'.
> A Jar can only accept a file or directory that exists: /home/travis/build/diffplug/durian-swt/durian-swt.os/build/libs/durian-swt.os-3.3.0.jar

The workaround is https://github.com/diffplug/durian-swt/pull/7/commits/b3df3311d6ef3d6ce22756512a7e742227091e3c

loetifuss commented 3 years ago

I'm experiencing the same error after switching from biz.aQute.bnd.builder to the bndmanifest plugin. The problem is that the java-library plugin has a dependency on the class-folder of dependent modules instead of the jar (as it used to be in Gradle before). Thus, the jar-task of a module may be executed before any of the dependent JARs have been built.

Workaround: You can force Gradle to use the "old" behaviour of depending on JARs by adding the following switch -Dorg.gradle.java.compile-classpath-packaging=true

It would be great though if the plugin can be adjusted to the new behaviour.