Expose flattbuffers as compile time dependency not as runtime
I am creating a library (jar) to be consumed by different java applications.
Both need to be able to serialize. So I do need the com.google.flatbuffers:flatbuffers-java dependency in both projects to access FlatBufferBuilder.
So my library project is not using the java gradle plugin instead it uses java-library and maven-publish as plugins. The generated pom contains the dependency but not as compile dependency but as runtime.
<dependencies>
<dependency>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java</artifactId>
<version>2.0.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
This basically means I need to pull in flattbuffers-java my self or expose it manually by adding it via
api("com.google.flatbuffers:flatbuffers-java:...") where I need to duplicate the version number flatBuffersVersion (i.e. using version catalogs or variables) but especially I duplicate the dependency definition itself.
I would like to see this plugin detecting the java-library plugin and replacing the implicit implementation dependency definition with an api definition.
Alternatively a switch to control the dependency definition would be nice and would allow usage in some other scenarios, i.e. compileOnly.