Maven deployment onto heroku issue for ORtools + Import for local maven dependency not appearing

I am trying to use the jar file for google OR tools as a dependency in order for it to run on heroku, because on heroku I get this error

 $ ./mvnw -DskipTests clean dependency:list install
   [INFO] Scanning for projects...
   [WARNING] The POM for org.apache.maven.plugins:ortools-java:jar:9.5.2237 is missing, no dependency information available
   [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:ortools-java:9.5.2237: Plugin org.apache.maven.plugins:ortools-java:9.5.2237 or one of its dependencies could not be resolved: org.apache.maven.plugins:ortools-java:jar:9.5.2237 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
   [INFO] 
   [INFO] -------------------------< com.grdfs:backend >--------------------------
   [INFO] Building backend 0.0.1-SNAPSHOT
   [INFO] --------------------------------[ jar ]---------------------------------
   [WARNING] The POM for org.apache.maven.plugins:ortools-java:jar:9.5.2237 is missing, no dependency information available
   [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:ortools-java:9.5.2237: Plugin org.apache.maven.plugins:ortools-java:9.5.2237 or one of its dependencies could not be resolved: org.apache.maven.plugins:ortools-java:jar:9.5.2237 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
   [INFO] 
   [INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ backend ---
   [INFO] 
   [INFO] --- maven-dependency-plugin:3.3.0:list (default-cli) @ backend ---
   [INFO] Can't extract module name from ortools-linux-x86-64-9.5.2237.jar: ortools.linux.x86.64: Invalid module name: '64' is not a Java identifier
   [INFO] Can't extract module name from ortools-darwin-x86-64-9.5.2237.jar: ortools.darwin.x86.64: Invalid module name: '64' is not a Java identifier
   [INFO] Can't extract module name from ortools-win32-x86-64-9.5.2237.jar: ortools.win32.x86.64: Invalid module name: '64' is not a Java identifier

I decided the solution would be solved using this process : https://devcenter.heroku.com/articles/local-maven-dependencies

I followed it step by step and yet the local maven dependency isnt showing up when I try to import it Broken import

This is whats in the pom.xml

 <dependency>
        <groupId>com.example</groupId>
        <artifactId>ortools</artifactId>
        <version>1.0</version>
    </dependency>

</dependencies>


<repositories>
    <!--other repositories if any-->
    <repository>
        <id>project.local</id>
        <name>project</name>
        <url>file:${project.basedir}/repo</url>
    </repository>
</repositories>

I added another change in order to try to draw the .dylib file directly but that still didnt work, I replaced

Loader.loadNativeLibraries();

for the ortools with

String filePath = new File("").getAbsolutePath();
        filePath = new File(filePath+"/ortools/ortools-darwin-x86-64/libjniortools.dylib").getAbsolutePath();
        System.load(filePath);

And while this works locally, I get this error on heroku

java.lang.UnsatisfiedLinkError: /app/ortools/ortools-darwin-x86-64/libjniortools.dylib: /app/ortools/ortools-darwin-x86-64/libjniortools.dylib: invalid ELF header

I still have yet to find a different solution to get OR-tools onto heroku



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)