Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Maven Support #202

Closed
18 tasks done
danyaljj opened this issue Jun 29, 2016 · 39 comments
Closed
18 tasks done

Add Maven Support #202

danyaljj opened this issue Jun 29, 2016 · 39 comments
Assignees
Labels
Feature Request Missing Feature/Wrapper Lang: Java Java wrapper issue OS: Linux GNU/Linux OS OS: Mac MacOS OS: Windows Windows OS
Milestone

Comments

@danyaljj
Copy link

danyaljj commented Jun 29, 2016

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
@lperron
Copy link
Collaborator

lperron commented Jun 30, 2016

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
.

@punkeel
Copy link

punkeel commented Aug 26, 2016

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

@dlahlou
Copy link

dlahlou commented Aug 26, 2016

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
.

@guizmaii
Copy link

Any news ?

@fcorneli
Copy link

fcorneli commented Dec 8, 2017

Maven support would be interesting...

@Mizux
Copy link
Collaborator

Mizux commented Dec 8, 2017

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 !

@Mizux Mizux added this to the v6.X milestone Mar 8, 2018
@Mizux Mizux added Feature Request Missing Feature/Wrapper OS: Windows Windows OS OS: Linux GNU/Linux OS OS: Mac MacOS Lang: Java Java wrapper issue labels Mar 8, 2018
@Mizux Mizux self-assigned this Mar 8, 2018
@Mizux Mizux changed the title new maven releases? Add Maven Support Mar 8, 2018
@Mizux Mizux modified the milestones: Backlog, v6.8 Mar 12, 2018
@gsavvid
Copy link

gsavvid commented Mar 26, 2018

Hello,

I was wondering whether this feature is still planned to be included in v6.8 and also whether the due date of v6.8 (April 1st) is still valid.

@Mizux
Copy link
Collaborator

Mizux commented Mar 26, 2018

Hi,

Not sure it will be included in v6.8 and not sure when v6.8 will be out (more mid-april I think).
The Goal is to have a Release (which means a version (aka SHA1) generated on Linux/Mac/Win) every month if possible.
For features, it's a best effort basis and depends to the bugs/features found by the community.

So for Maven, I would say, hope to do it ASAP (so I put it in my kaban/ToDo list) but I can't really give you a strong/mandatory date...

@Mizux Mizux modified the milestones: v6.8, v6.9 Apr 27, 2018
@oliviercailloux
Copy link

I have prepared a Maven project to release Google OR-Tools for Java (meaning, the SWIG classes) in Maven central. Please see here. The goal is to be able to depend on it in my projects that use Google OR-Tools.

Please give me any comment you like, preferably soon if possible because I have other projects that depend on this for easy consumption.

I am ready to change the groupId if you prefer that I use Google’s (or artifactId if you prefer another one). Currently I put mine simply because there might be a question of trust (I am the one who release the code, after all, not Google, and users could want to know it for security reasons). OTOH, I certainly do not want to appear as trying to get credit for Google’s code.

I am also ready to hand it over to you if you prefer to release it yourself. That would be best, but only if you intend to release it soon… (Otherwise, I’d suggest I release under my groupId now and then hand it to you for the future releases.)

I still have to check for how to release to Maven central without javadoc, I believe it is required by default.

As the Maven release will include only the Java classes and not the native library (it’s there in my project just for the test but is not transmitted by Maven to consumers), users will still have to manually download the library (on linux, libjniortools.so and libortools.so). It does not seem possible to automate this in a clean way using Maven. At least, compilation will be made possible automatically thanks to this release.

@oliviercailloux
Copy link

The project is now published to Maven Central

@guizmaii
Copy link

Hi,

Any official release in Maven ?

@lalithsuresh
Copy link
Contributor

@Mizux will the maven packages for release 8.0 be made available on Maven Central?

@Mizux
Copy link
Collaborator

Mizux commented Oct 13, 2020

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

I'll should work on it next week

@dillonmabry
Copy link

@Mizux any update on this or from someone else? I believe quite a few people would be very happy to have this added on maven central for Java since quite a few teams would be using this for optimization problems :)

@amucunguzi
Copy link

@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.

@suming
Copy link

suming commented Nov 21, 2020

@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?

@magneticflux-
Copy link

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

@lalithsuresh
Copy link
Contributor

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

@suming
Copy link

suming commented Nov 21, 2020

@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!

@dillonmabry
Copy link

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

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

@ErickPol
Copy link

ErickPol commented Dec 22, 2020

@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"); }

@magneticflux-
Copy link

@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.

@jbellis
Copy link

jbellis commented Jan 11, 2021

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

Is there a ticket for maven central publishing?

@magneticflux-
Copy link

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.

@Mizux
Copy link
Collaborator

Mizux commented Apr 21, 2021

FYI, first 8.2 RC (8.2.9004)
https://search.maven.org/search?q=g:com.google.ortools
https://mvnrepository.com/artifact/com.google.ortools

note: I failed the linux artifact which is currently depending on GLIBC 2.33 (archlinux ^^;)

example usage: https://github.com/or-tools/java_or-tools/blob/6df2f03abe2b869f197eafe4c0846a376dbe04a0/pom.xml#L51-L59

@lalithsuresh
Copy link
Contributor

lalithsuresh commented Apr 21, 2021

@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)

@Mizux
Copy link
Collaborator

Mizux commented Apr 22, 2021

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

@dillonmabry
Copy link

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!

@Mizux
Copy link
Collaborator

Mizux commented May 6, 2021

@dillonmabry let's open a new issue with your docker issue.
note: You are not the only one with this feedback IIRC but I was never be able to reproduce it...
see: https://github.com/or-tools/java_or-tools/blob/main/Dockerfile and https://github.com/or-tools/java_or-tools/runs/2441985470?check_suite_focus=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Missing Feature/Wrapper Lang: Java Java wrapper issue OS: Linux GNU/Linux OS OS: Mac MacOS OS: Windows Windows OS
Projects
None yet
Development

No branches or pull requests