Skip to content

Add Maven Support  #202

Closed
Closed

Description

@danyaljj

Original post
I can see some maven releases here:
https://bintray.com/nikola-ilo/maven/or-tools/view
Q: Why the releases are not continued? Are you guys planning to release a new version on maven?
A: Not done by Google LLC

For v8.0 we are migrating to use maven to create java package
Todo List:

  • Use Maven in CMake based build
    • Add Maven package to CMake based build
    • Use Maven for samples (ortools/*/samples)
    • Use Maven for examples (examples/contrib examples/java)
    • Use Maven for tests (examples/tests)
  • Use Maven in Make based build
    • Add Maven packages to Make based build
    • Use Maven for samples
    • Use Maven for examples
    • Use Maven for tests
  • Rework archive to use Maven packages
    • Linux archive
    • MacOS archive
    • Windows archive
  • Add internal doc in:
    • ortools/java/README.md
    • ortools/java/doc/local_pipeline.dot
    • cmake/doc/java.md

Activity

  1. lperron commented on Jun 30, 2016

    @lperron
    Collaborator

    These are actual contributed and we did not do it.
    I will contact the author to see if we can transfer it to or-tools.

    Thanks

    Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
    00

    2016-06-30 0:20 GMT+02:00 Daniel Khashabi notifications@github.com:

    I can see some maven releases here:
    https://bintray.com/nikola-ilo/maven/or-tools/view

    Why the releases are not continued? Are you guys planning to release a new
    version on maven?

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #202, or mute the thread
    https://github.com/notifications/unsubscribe/AKj17YzVqy9EP7GJ-Xo901KJQETAPzZ0ks5qQu-tgaJpZM4JBn-L
    .

  2. punkeel commented on Aug 26, 2016

    @punkeel

    I would definitely appreciate being able to integrate or-tools using Maven

  3. dlahlou commented on Aug 26, 2016

    @dlahlou

    Hello Punkeel,
    It's on our to-do list to support Maven. Thank you.
    Regards,
    Driss

    On Aug 26, 2016 03:36, "PunKeel" notifications@github.com wrote:

    I would definitely appreciate being able to integrate or-tools using Maven

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #202 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/ASwpfG_r17r_em0h0ROiUDNRupAb5C2cks5qjkL8gaJpZM4JBn-L
    .

  4. guizmaii commented on Nov 30, 2017

    @guizmaii

    Any news ?

  5. fcorneli commented on Dec 8, 2017

    @fcorneli

    Maven support would be interesting...

  6. Mizux commented on Dec 8, 2017

    @Mizux
    Collaborator

    hi all,

    Yes I would like to provide a maven (gradle ? ivy ?) package for or-tools ASAP and ideas are welcome !

    How I see it currently:
    1.Have a clean and modern CMake project to replace Makefile (cf WIP mizux/cmake branch)
    2. Have a gradle project with cpp-plugin/JNI to wrap libortools.so
    3. Use gradle plugin "maven-publish'
    4. Profit !

  7. added this to the milestone on Mar 8, 2018
  8. self-assigned this
    on Mar 8, 2018
  9. changed the title [-]new maven releases? [/-] [+]Add Maven Support [/+] on Mar 8, 2018
  10. removed this from the Backlog milestone on Mar 12, 2018
  11. 49 remaining items

  12. amucunguzi commented on Nov 18, 2020

    @amucunguzi

    @dillonmabry our team has been using this: https://github.com/panavis/google-or-tools-maven. We hope that there will be an official release soon. @Mizux.

  13. suming commented on Nov 21, 2020

    @suming

    @amucunguzi thank you for working on this! I saw that https://github.com/panavis/google-or-tools-maven doesn't have a dependency for mac -- is that on it's way at all?

  14. magneticflux- commented on Nov 21, 2020

    @magneticflux-

    @suming My version #202 (comment) has all OS distributions available 👀

  15. lalithsuresh commented on Nov 21, 2020

    @lalithsuresh
    Contributor

    Yes, I've been using @magneticflux-'s version on OSX and it works fine.

  16. suming commented on Nov 21, 2020

    @suming

    @magneticflux- & @lalithsuresh thank you for the heads-up, I just tested it out and it's great. I can develop locally on OSX and deploy on Linux easily. Appreciate it!

  17. dillonmabry commented on Dec 6, 2020

    @dillonmabry

    @suming My version #202 (comment) has all OS distributions available 👀

    Using this version currently with no issues, thanks for your support! Works as expected.

  18. ErickPol commented on Dec 22, 2020

    @ErickPol

    @suming My version #202 (comment) has all OS distributions available 👀

    For those that had trouble running Makefile in order to install the jars follows a detailed set-up guide based on @magneticflux- 's solution:

    1. Guarantee maven (mvn) executable folder (e.g. /bin) is on your classpath
    2. Download binaries (version 8.0) for your OS at https://github.com/google/or-tools/releases/tag/v8.0. For Windows the link is https://github.com/google/or-tools/releases/download/v8.0/or-tools_VisualStudio2019-64bit_v8.0.8283.zip
    3. Extract the zip file and run these 2 commands inside the folder:
      mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-win32-x86-64-8.0.8283.jar" -DpomFile="pom-runtime.xml"
      mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-java-8.0.8283.jar" -DpomFile="pom-local.xml"
    4. Add the following dependencies to your project (in my case, to run or-tools over windows) :
      <dependency> <groupId>com.skaggsm.ortools</groupId> <artifactId>ortools-natives-all</artifactId> <version>8.0.8283</version> <type>pom</type> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-java</artifactId> <version>8.0.8283</version> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-win32-x86-64</artifactId> <version>8.0.8283</version> </dependency>
    5. Run a test file , calling first the loader and then setting up the solver:
      @Test public void test(){ OrToolsHelper.loadLibrary(); MPSolver solver = MPSolver.createSolver("SCIP"); }
  19. magneticflux- commented on Dec 23, 2020

    @magneticflux-

    @suming My version #202 (comment) has all OS distributions available 👀

    For those that had trouble running Makefile in order to install the jars follows a detailed set-up guide based on @magneticflux- 's solution:

    1. Guarantee maven (mvn) executable folder (e.g. /bin) is on your classpath
    
    2. Download binaries (version 8.0) for your OS at https://github.com/google/or-tools/releases/tag/v8.0. For Windows the link is https://github.com/google/or-tools/releases/download/v8.0/or-tools_VisualStudio2019-64bit_v8.0.8283.zip
    
    3. Extract the zip file and run these 2 commands inside the folder:
       `mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-win32-x86-64-8.0.8283.jar" -DpomFile="pom-runtime.xml"`
       `mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="ortools-java-8.0.8283.jar" -DpomFile="pom-local.xml"`
    
    4. Add the following dependencies to your project (in my case, to run or-tools over windows) :
       `       <dependency> <groupId>com.skaggsm.ortools</groupId> <artifactId>ortools-natives-all</artifactId> <version>8.0.8283</version> <type>pom</type> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-java</artifactId> <version>8.0.8283</version> </dependency> <dependency> <groupId>com.google.ortools</groupId> <artifactId>ortools-win32-x86-64</artifactId> <version>8.0.8283</version> </dependency>`
    
    5. Run a test file , calling first the loader and then setting up the solver:
       `   @Test public void test(){ OrToolsHelper.loadLibrary(); MPSolver solver = MPSolver.createSolver("SCIP"); }`
    

    I'm not sure why you're installing both my distribution and the official one. You don't need both; mine has everything included and has extra extraction functionality.

  20. jbellis commented on Jan 11, 2021

    @jbellis

    This is the next step, but we need to test few things:

    Is there a ticket for maven central publishing?

  21. magneticflux- commented on Mar 24, 2021

    @magneticflux-

    Is there a ticket for maven central publishing?

    With the sunsetting of JCenter, this is more urgent for me in particular. I'm not keen on shouldering the cost of hosting large binaries myself going forward, so I'd like my solution to just depend on official binaries on Maven Central.

  22. Mizux commented on Apr 21, 2021

    @Mizux
    Collaborator
  23. lalithsuresh commented on Apr 21, 2021

    @lalithsuresh
    Contributor

    @Mizux thanks! I just tested the Darwin version and it works.

    note: I failed the linux artifact which is currently depending on GLIBC 2.33

    Could you elaborate more on this?

    If it helps, I'm getting an error about needing GLIBC 2.29 when running on Ubuntu 18.04.

    java.lang.UnsatisfiedLinkError: /tmp/ortools-java7239044082451951181/linux-x86-64/libjniortools.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/ortools-java7239044082451951181/linux-x86-64/libortools.so)
    
  24. Mizux commented on Apr 22, 2021

    @Mizux
    Collaborator

    see #2520
    TLDR the runtime has been built against GLIBC 33 (archlinux) need to build the package against an "older" Linux distro

  25. dillonmabry commented on May 5, 2021

    @dillonmabry

    see #2520
    TLDR the runtime has been built against GLIBC 33 (archlinux) need to build the package against an "older" Linux distro

    This is great news, and we appreciate your hard work!

    Question: Is there a solution to have this work with Docker? For example, it works fine for me locally but whenever I run my docker build it cannot find the JNI/Library resource files like it can when I run locally, it extracts and discovers them automatically with my Spring/Java build.

    I am using JDK 11 and Maven if that helps.

    Thank you!

  26. Mizux commented on May 6, 2021

    @Mizux
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions