I am using maven for Eclipse to build a jar that will run on a remote server. My system is running OS X, the server is running CestOS. For the project I need tensorflow library. Maven successfully resolves dependencies so I am able to run the project locally. However, on the server I am getting error that tensorflow library is not there because by default maven includes only macosx version. How can I force maven to substitute macosx version of tensorflow by the linux version during build?
TensorFlow java libraries for different platforms can be found here.
P.S. I already tried adding a dependency in pom with the system scope pointing to jar.
In order to compile the project into an executable jar, please run Maven with mvn clean package command.
The Maven JAR plugin builds your Maven project as a JAR file, including the resources generated by the BND Maven plugin. The above configuration also sets the default project MANIFEST. MF file path for your project, which is essential when packaging your module using the BND Maven plugin.
Try this in your POM:
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tensorflow</artifactId>
<version>0.9.0-1.2</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tensorflow</artifactId>
<version>0.9.0-1.2</version>
<classifier>linux-x86_64</classifier>
</dependency>
Or linux-x86
instead, if your server is 32-bit.
Of course, defining a conditional dependency with profiles would be nice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With